Skip to content

Commit 3938883

Browse files
author
pdavidc
committed
Modified the ANT build to correctly assemble the release JAR files. Fixes #87.
1 parent 580e040 commit 3938883

File tree

2 files changed

+23
-30
lines changed

2 files changed

+23
-30
lines changed

build.macros.xml

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,15 @@
1919
<macrodef name="compileJava">
2020
<attribute name="srcdir"/>
2121
<attribute name="classdir"/>
22-
<attribute name="type"/>
22+
<attribute name="debug"/>
2323
<attribute name="jdk"/>
2424
<element name="pathelements"/>
2525
<sequential>
26-
<condition property="compileJava.debug" value="true" else="false">
27-
<equals arg1="@{type}" arg2="debug"/>
28-
</condition>
2926
<javac srcdir="@{srcdir}"
3027
destdir="@{classdir}"
3128
source="@{jdk}"
3229
target="@{jdk}"
33-
debug="${compileJava.debug}"
30+
debug="@{debug}"
3431
encoding="UTF-8"
3532
fork="true"
3633
includeantruntime="false"
@@ -64,12 +61,9 @@
6461
<attribute name="srcdir"/>
6562
<attribute name="classdir"/>
6663
<attribute name="destdir"/>
67-
<attribute name="type"/>
64+
<attribute name="debug"/>
6865
<sequential>
69-
<condition property="bundleJarFiles.debug" value="true" else="false">
70-
<equals arg1="@{type}" arg2="debug"/>
71-
</condition>
72-
<jar jarfile="@{destdir}/worldwind-@{type}.jar">
66+
<jar jarfile="@{destdir}/worldwind.jar">
7367
<manifest>
7468
<attribute name="Permissions" value="all-permissions"/>
7569
<attribute name="Class-Path" value="jogl-all.jar gluegen-rt.jar gdal.jar"/>
@@ -81,17 +75,17 @@
8175
<type type="file"/>
8276
</fileset>
8377
<fileset dir="@{srcdir}">
84-
<include name="gov/nasa/worldwind/**/*.java" if="${bundleJarFiles.debug}"/>
78+
<include name="gov/nasa/worldwind/**/*.java" if="@{debug}"/>
8579
<include name="gov/nasa/worldwind/util/**/*.properties"/>
86-
<include name="com/zebraimaging/**/*.java" if="${bundleJarFiles.debug}"/>
87-
<include name="org/codehaus/jackson/**/*.java" if="${bundleJarFiles.debug}"
80+
<include name="com/zebraimaging/**/*.java" if="@{debug}"/>
81+
<include name="org/codehaus/jackson/**/*.java" if="@{debug}"
8882
unless="${worldwind.exclude.jackson}"/>
8983
<include name="config/**"/>
9084
<include name="images/**"/>
9185
<type type="file"/>
9286
</fileset>
9387
</jar>
94-
<jar jarfile="@{destdir}/worldwindx-@{type}.jar">
88+
<jar jarfile="@{destdir}/worldwindx.jar">
9589
<manifest>
9690
<attribute name="Class-Path" value="worldwind.jar"/>
9791
<attribute name="Main-Class" value="gov.nasa.worldwindx.examples.ApplicationTemplate"/>
@@ -102,7 +96,7 @@
10296
<type type="file"/>
10397
</fileset>
10498
<fileset dir="@{srcdir}">
105-
<include name="gov/nasa/worldwindx/**/*.java" if="${bundleJarFiles.debug}"/>
99+
<include name="gov/nasa/worldwindx/**/*.java" if="@{debug}"/>
106100
<include name="gov/nasa/worldwindx/applications/sar/*.html"/>
107101
<include name="gov/nasa/worldwindx/applications/sar/config/**"/>
108102
<include name="gov/nasa/worldwindx/applications/sar/data/**"/>

build.xml

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

4242
<target name="compileDebugSources">
4343
<mkdir dir="${worldwind.classes.dir}/debug"/>
44-
<compileJava srcdir="${worldwind.src.dir}" classdir="${worldwind.classes.dir}/debug" type="debug"
44+
<compileJava srcdir="${worldwind.src.dir}" classdir="${worldwind.classes.dir}/debug" debug="true"
4545
jdk="${worldwind.jdk}">
4646
<pathelements>
4747
<pathelement location="${basedir}/jogl-all.jar"/>
@@ -53,7 +53,7 @@
5353

5454
<target name="compileReleaseSources">
5555
<mkdir dir="${worldwind.classes.dir}/release"/>
56-
<compileJava srcdir="${worldwind.src.dir}" classdir="${worldwind.classes.dir}/release" type="release"
56+
<compileJava srcdir="${worldwind.src.dir}" classdir="${worldwind.classes.dir}/release" debug="false"
5757
jdk="${worldwind.jdk}">
5858
<pathelements>
5959
<pathelement location="${basedir}/jogl-all.jar"/>
@@ -64,17 +64,17 @@
6464
</target>
6565

6666
<target name="bundleDebug">
67-
<mkdir dir="${worldwind.jar.dir}"/>
67+
<mkdir dir="${worldwind.jar.dir}/debug"/>
6868
<bundleJarFiles srcdir="${worldwind.src.dir}" classdir="${worldwind.classes.dir}/debug"
69-
destdir="${worldwind.jar.dir}" type="debug"/>
69+
destdir="${worldwind.jar.dir}/debug" debug="true"/>
7070
</target>
7171

7272
<target name="bundleRelease">
73-
<mkdir dir="${worldwind.jar.dir}"/>
73+
<mkdir dir="${worldwind.jar.dir}/release"/>
7474
<bundleJarFiles srcdir="${worldwind.src.dir}" classdir="${worldwind.classes.dir}/release"
75-
destdir="${worldwind.jar.dir}" type="release"/>
76-
<copy file="${worldwind.jar.dir}/worldwind-release.jar" tofile="${basedir}/worldwind.jar"/>
77-
<copy file="${worldwind.jar.dir}/worldwindx-release.jar" tofile="${basedir}/worldwindx.jar"/>
75+
destdir="${worldwind.jar.dir}/release" debug="false"/>
76+
<copy file="${worldwind.jar.dir}/release/worldwind.jar" tofile="${basedir}/worldwind.jar"/>
77+
<copy file="${worldwind.jar.dir}/release/worldwindx.jar" tofile="${basedir}/worldwindx.jar"/>
7878
</target>
7979

8080
<!-- Targets for compiling and bundling the project documentation. -->
@@ -135,8 +135,8 @@
135135
<target name="bundleWebStartLibraries">
136136
<mkdir dir="${webstart.unsigned.dir}"/>
137137
<!-- World Wind library JAR files. -->
138-
<copy file="${worldwind.jar.dir}/worldwind-release.jar" tofile="${webstart.unsigned.dir}/worldwind.jar"/>
139-
<copy file="${worldwind.jar.dir}/worldwindx-release.jar" tofile="${webstart.unsigned.dir}/worldwindx.jar"/>
138+
<copy file="${worldwind.jar.dir}/release/worldwind.jar" tofile="${webstart.unsigned.dir}/worldwind.jar"/>
139+
<copy file="${worldwind.jar.dir}/release/worldwindx.jar" tofile="${webstart.unsigned.dir}/worldwindx.jar"/>
140140
<!-- JOGL and GlueGen library JAR files. -->
141141
<copy todir="${webstart.unsigned.dir}">
142142
<fileset dir="${basedir}">
@@ -314,11 +314,10 @@
314314

315315
<target name="compileUnitTestSources">
316316
<mkdir dir="${worldwind.classes.dir}/test"/>
317-
<compileJava srcdir="${worldwind.test.dir}" classdir="${worldwind.classes.dir}/test" type="debug"
317+
<compileJava srcdir="${worldwind.test.dir}" classdir="${worldwind.classes.dir}/test" debug="true"
318318
jdk="${worldwind.jdk}">
319319
<pathelements>
320-
<pathelement location="${worldwind.jar.dir}/worldwind-debug.jar"/>
321-
<pathelement location="${worldwind.jar.dir}/worldwindx-debug.jar"/>
320+
<pathelement location="${worldwind.classes.dir}/debug"/>
322321
<pathelement location="${basedir}/jogl-all.jar"/>
323322
<pathelement location="${basedir}/gluegen-rt.jar"/>
324323
<pathelement location="${basedir}/gdal.jar"/>
@@ -335,9 +334,9 @@
335334
forkmode="once"
336335
maxmemory="1024m">
337336
<classpath>
337+
<pathelement location="${worldwind.src.dir}"/>
338338
<pathelement location="${worldwind.classes.dir}/test"/>
339-
<pathelement location="${worldwind.jar.dir}/worldwind-debug.jar"/>
340-
<pathelement location="${worldwind.jar.dir}/worldwindx-debug.jar"/>
339+
<pathelement location="${worldwind.classes.dir}/debug"/>
341340
<pathelement location="${basedir}/jogl-all.jar"/>
342341
<pathelement location="${basedir}/gluegen-rt.jar"/>
343342
<pathelement location="${basedir}/gdal.jar"/>

0 commit comments

Comments
 (0)