summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--java/project/build.xml55
1 files changed, 34 insertions, 21 deletions
diff --git a/java/project/build.xml b/java/project/build.xml
index 7af697b..9e73341 100644
--- a/java/project/build.xml
+++ b/java/project/build.xml
@@ -71,7 +71,7 @@
</exec>
</target>
- <target name="compile" depends="configure,resolve,ctags">
+ <target name="compile.main" depends="configure,resolve,ctags">
<record name="build.log" loglevel="verbose" action="start" />
<mkdir dir="${classes.dir}/main" />
<javac srcdir="${src.dir}"
@@ -87,6 +87,9 @@
<compilerarg value="-Xmaxerrs"/>
<compilerarg value="10"/>
</javac>
+ </target>
+
+ <target name="compile.test" depends="configure,resolve">
<mkdir dir="${classes.dir}/test" />
<javac srcdir="${test.dir}"
destdir="${classes.dir}/test"
@@ -104,7 +107,9 @@
</javac>
</target>
- <target name="test" description="run JUnit tests" depends="compile">
+ <target name="compile.all" depends="compile.main,compile.test"/>
+
+ <target name="test" description="run JUnit tests" depends="compile.all">
<junit fork="true" dir="${basedir}" failureProperty="test.failed" printsummary="yes" haltonfailure="no">
<jvmarg value="-Xmx600M"/>
<classpath refid="cp.build"/>
@@ -115,13 +120,7 @@
<fail message="-- FAILED --" if="test.failed" />
</target>
- <target name="-jar.deps" if="filter.sign.out">
- <jar jarfile="${jar.name}-deps.jar">
- <zipgroupfileset refid="ivy.deps.runtime.fileset"/>
- </jar>
- </target>
-
- <target name="-jar.static" depends="compile">
+ <target name="-jar.static" depends="compile.all">
<manifestclasspath property="cp.manifest" jarfile="${jar.name}-static-cp.jar" maxParentLevels="10">
<classpath refid="ivy.deps.runtime"/>
</manifestclasspath>
@@ -134,27 +133,41 @@
</jar>
</target>
- <target name="-jar.fat" depends="compile,-jar.deps">
+ <target name="-jar.deps.check" unless="-jar.deps.exists">
+ <available property="-jar.deps.exists" file="${jar.name}-deps.jar"/>
+ </target>
+
+ <target name="-jar.deps" unless="-jar.deps.exists">
+ <jar jarfile="${jar.name}-deps.jar">
+ <zipgroupfileset refid="ivy.deps.runtime.fileset"/>
+ </jar>
+ </target>
+
+ <target name="-jar.fat.0" if="filter.sign.out" depends="compile.all,-jar.deps.check,-jar.deps">
<jar jarfile="${jar.name}-fat.jar" basedir="${classes.dir}/main">
<manifest>
<attribute name="Main-Class" value="${class.main}"/>
<attribute name="Class-Path" value="."/>
</manifest>
<fileset dir="${resources.dir}"/>
- <!-- FIXES Invalid signature file digest for Manifest main attributes -->
- <!-- TODO use filter.sign.out -->
<zipfileset src="${jar.name}-deps.jar" excludes="META-INF/*.SF" />
- <!-- <zipgroupfileset refid="ivy.deps.runtime.fileset"/> -->
</jar>
- <!-- FIXES Invalid signature file digest for Manifest main attributes -->
- <!-- <exec executable="zip"> -->
- <!-- <arg value="-d"/> -->
- <!-- <arg value="${jar.name}-fat.jar"/> -->
- <!-- <arg value="META-INF/*.SF"/> -->
- <!-- </exec> -->
</target>
- <target name="-jar.src" depends="compile">
+ <target name="-jar.fat.1" unless="filter.sign.out" depends="compile.all">
+ <jar jarfile="${jar.name}-fat.jar" basedir="${classes.dir}/main">
+ <manifest>
+ <attribute name="Main-Class" value="${class.main}"/>
+ <attribute name="Class-Path" value="."/>
+ </manifest>
+ <fileset dir="${resources.dir}"/>
+ <zipgroupfileset refid="ivy.deps.runtime.fileset"/>
+ </jar>
+ </target>
+
+ <target name="-jar.fat" depends="-jar.fat.0,-jar.fat.1"/>
+
+ <target name="-jar.src" depends="compile.all">
<jar jarfile="${jar.name}-src.jar" basedir="${basedir}" excludes="build/** dist/** *.log .tags" />
</target>
@@ -164,7 +177,7 @@
<target name="dist" description="generate the distribution" depends="-jar.dir,-jar.static,-jar.fat,-jar.src"/>
- <target name="run" description="execute built main Class" depends="compile">
+ <target name="run" description="execute built main Class" depends="compile.all">
<java classname="${class.main}" fork="true">
<classpath refid="cp.build"/>
<classpath refid="cp.resources"/>