summary refs log tree commit diff
path: root/pkgs/build-support/release/ant-build.nix
diff options
context:
space:
mode:
authorRob Vermaas <rob.vermaas@gmail.com>2010-06-07 13:58:13 +0000
committerRob Vermaas <rob.vermaas@gmail.com>2010-06-07 13:58:13 +0000
commit94356324f5d57631d9b57745289455afc9e918fb (patch)
treea6a4ce273ab9ed3c2e6fca606f4d8a9eb877bb36 /pkgs/build-support/release/ant-build.nix
parent9d33e71fc416d37abc28a6489c1f88492b262d08 (diff)
downloadnixpkgs-94356324f5d57631d9b57745289455afc9e918fb.tar
nixpkgs-94356324f5d57631d9b57745289455afc9e918fb.tar.gz
nixpkgs-94356324f5d57631d9b57745289455afc9e918fb.tar.bz2
nixpkgs-94356324f5d57631d9b57745289455afc9e918fb.tar.lz
nixpkgs-94356324f5d57631d9b57745289455afc9e918fb.tar.xz
nixpkgs-94356324f5d57631d9b57745289455afc9e918fb.tar.zst
nixpkgs-94356324f5d57631d9b57745289455afc9e918fb.zip
antbuild: added 2 arguments, antbuildinputs (all jars are added to classpath) and buildfile (for different location of build.xml)
svn path=/nixpkgs/trunk/; revision=22169
Diffstat (limited to 'pkgs/build-support/release/ant-build.nix')
-rw-r--r--pkgs/build-support/release/ant-build.nix13
1 files changed, 10 insertions, 3 deletions
diff --git a/pkgs/build-support/release/ant-build.nix b/pkgs/build-support/release/ant-build.nix
index 04eec99c7ed..1e174f3e3f4 100644
--- a/pkgs/build-support/release/ant-build.nix
+++ b/pkgs/build-support/release/ant-build.nix
@@ -5,10 +5,12 @@
 , jars ? []
 , jarWrappers ? []
 , antProperties ? []
+, antBuildInputs ? []
+, buildfile ? "build.xml"
 , ... } @ args:
 
 let
-  antFlags = stdenv.lib.concatMapStrings ({name, value}: "-D${name}=${value}" ) antProperties ;
+  antFlags = "-f ${buildfile} " + stdenv.lib.concatMapStrings ({name, value}: "-D${name}=${value}" ) antProperties ;
 in
 stdenv.mkDerivation (
 
@@ -21,10 +23,13 @@ stdenv.mkDerivation (
     prePhases = 
       ["antSetupPhase"];
 
-    antSetupPhase = ''
+    antSetupPhase = with stdenv.lib; ''
       if test "$hydraAntLogger" != "" ; then
         export ANT_ARGS="-logger org.hydra.ant.HydraLogger -lib `ls $hydraAntLogger/lib/java/*.jar | head -1`"
       fi
+      for abi in ${concatStringsSep " " (map (f: "`find ${f} -name '*.jar'`") antBuildInputs)}; do
+        export ANT_ARGS="$ANT_ARGS -lib $abi"
+      done
     '';
 
     installPhase = ''
@@ -33,8 +38,10 @@ stdenv.mkDerivation (
            find . -name "*.jar" | xargs -I{} cp -v {} $out/lib/java
          '' else stdenv.lib.concatMapStrings (j: ''
            cp -v ${j} $out/lib/java
-           echo file jar $out/lib/java/${j} >> $out/nix-support/hydra-build-products
          '') jars }
+      for j in $out/lib/java ; do
+        echo file jar $out/lib/java/$j >> $out/nix-support/hydra-build-products
+      done
     '';
 
     generateWrappersPhase = ''