@@ -54,7 +54,43 @@ is divided into following sections:
54
54
<property file =" nbproject/project.properties" />
55
55
</target >
56
56
<target depends =" -pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name =" -do-init" >
57
- <property name =" platform.java" value =" ${java.home}/bin/java" />
57
+ <j2seproject1 : property name =" platform.home" value =" platforms.${platform.active}.home" />
58
+ <j2seproject1 : property name =" platform.bootcp" value =" platforms.${platform.active}.bootclasspath" />
59
+ <j2seproject1 : property name =" platform.compiler" value =" platforms.${platform.active}.compile" />
60
+ <j2seproject1 : property name =" platform.javac.tmp" value =" platforms.${platform.active}.javac" />
61
+ <condition property =" platform.javac" value =" ${platform.home}/bin/javac" >
62
+ <equals arg1 =" ${platform.javac.tmp}" arg2 =" $${platforms.${platform.active}.javac}" />
63
+ </condition >
64
+ <property name =" platform.javac" value =" ${platform.javac.tmp}" />
65
+ <j2seproject1 : property name =" platform.java.tmp" value =" platforms.${platform.active}.java" />
66
+ <condition property =" platform.java" value =" ${platform.home}/bin/java" >
67
+ <equals arg1 =" ${platform.java.tmp}" arg2 =" $${platforms.${platform.active}.java}" />
68
+ </condition >
69
+ <property name =" platform.java" value =" ${platform.java.tmp}" />
70
+ <j2seproject1 : property name =" platform.javadoc.tmp" value =" platforms.${platform.active}.javadoc" />
71
+ <condition property =" platform.javadoc" value =" ${platform.home}/bin/javadoc" >
72
+ <equals arg1 =" ${platform.javadoc.tmp}" arg2 =" $${platforms.${platform.active}.javadoc}" />
73
+ </condition >
74
+ <property name =" platform.javadoc" value =" ${platform.javadoc.tmp}" />
75
+ <condition property =" platform.invalid" value =" true" >
76
+ <or >
77
+ <contains string =" ${platform.javac}" substring =" $${platforms." />
78
+ <contains string =" ${platform.java}" substring =" $${platforms." />
79
+ <contains string =" ${platform.javadoc}" substring =" $${platforms." />
80
+ </or >
81
+ </condition >
82
+ <fail unless =" platform.home" >Must set platform.home</fail >
83
+ <fail unless =" platform.bootcp" >Must set platform.bootcp</fail >
84
+ <fail unless =" platform.java" >Must set platform.java</fail >
85
+ <fail unless =" platform.javac" >Must set platform.javac</fail >
86
+ <fail if =" platform.invalid" >
87
+ The J2SE Platform is not correctly set up.
88
+ Your active platform is: ${platform.active}, but the corresponding property "platforms.${platform.active}.home" is not found in the project's properties files.
89
+ Either open the project in the IDE and setup the Platform with the same name or add it manually.
90
+ For example like this:
91
+ ant -Duser.properties.file=< path_to_property_file> jar (where you put the property "platforms.${platform.active}.home" in a .properties file)
92
+ or ant -Dplatforms.${platform.active}.home=< path_to_JDK_home> jar (where no properties file is used)
93
+ </fail >
58
94
<available file =" ${manifest.file}" property =" manifest.available" />
59
95
<condition property =" splashscreen.available" >
60
96
<and >
@@ -183,20 +219,6 @@ is divided into following sections:
183
219
<condition else =" " property =" javac.profile.cmd.line.arg" value =" -profile ${javac.profile}" >
184
220
<isset property =" profile.available" />
185
221
</condition >
186
- <condition else =" false" property =" jdkBug6558476" >
187
- <and >
188
- <matches pattern =" 1\.[56]" string =" ${java.specification.version}" />
189
- <not >
190
- <os family =" unix" />
191
- </not >
192
- </and >
193
- </condition >
194
- <condition else =" false" property =" javac.fork" >
195
- <or >
196
- <istrue value =" ${jdkBug6558476}" />
197
- <istrue value =" ${javac.external.vm}" />
198
- </or >
199
- </condition >
200
222
<property name =" jar.index" value =" false" />
201
223
<property name =" jar.index.metainf" value =" ${jar.index}" />
202
224
<property name =" copylibs.rebase" value =" true" />
@@ -266,7 +288,7 @@ is divided into following sections:
266
288
<property location =" ${build.dir}/empty" name =" empty.dir" />
267
289
<mkdir dir =" ${empty.dir}" />
268
290
<mkdir dir =" @{apgeneratedsrcdir}" />
269
- <javac debug =" @{debug}" deprecation =" ${javac.deprecation}" destdir =" @{destdir}" encoding =" ${source.encoding}" excludes =" @{excludes}" fork =" ${javac.fork} " includeantruntime =" false" includes =" @{includes}" source =" ${javac.source}" sourcepath =" @{sourcepath}" srcdir =" @{srcdir}" target =" ${javac.target}" tempdir =" ${java.io.tmpdir}" >
291
+ <javac debug =" @{debug}" deprecation =" ${javac.deprecation}" destdir =" @{destdir}" encoding =" ${source.encoding}" excludes =" @{excludes}" executable =" ${platform.javac} " fork = " yes " includeantruntime =" false" includes =" @{includes}" source =" ${javac.source}" sourcepath =" @{sourcepath}" srcdir =" @{srcdir}" target =" ${javac.target}" tempdir =" ${java.io.tmpdir}" >
270
292
<src >
271
293
<dirset dir =" @{gensrcdir}" erroronmissingdir =" false" >
272
294
<include name =" *" />
@@ -306,7 +328,7 @@ is divided into following sections:
306
328
<sequential >
307
329
<property location =" ${build.dir}/empty" name =" empty.dir" />
308
330
<mkdir dir =" ${empty.dir}" />
309
- <javac debug =" @{debug}" deprecation =" ${javac.deprecation}" destdir =" @{destdir}" encoding =" ${source.encoding}" excludes =" @{excludes}" fork =" ${javac.fork} " includeantruntime =" false" includes =" @{includes}" source =" ${javac.source}" sourcepath =" @{sourcepath}" srcdir =" @{srcdir}" target =" ${javac.target}" tempdir =" ${java.io.tmpdir}" >
331
+ <javac debug =" @{debug}" deprecation =" ${javac.deprecation}" destdir =" @{destdir}" encoding =" ${source.encoding}" excludes =" @{excludes}" executable =" ${platform.javac} " fork = " yes " includeantruntime =" false" includes =" @{includes}" source =" ${javac.source}" sourcepath =" @{sourcepath}" srcdir =" @{srcdir}" target =" ${javac.target}" tempdir =" ${java.io.tmpdir}" >
310
332
<src >
311
333
<dirset dir =" @{gensrcdir}" erroronmissingdir =" false" >
312
334
<include name =" *" />
@@ -387,7 +409,7 @@ is divided into following sections:
387
409
<element name =" customize" optional =" true" />
388
410
<sequential >
389
411
<property name =" junit.forkmode" value =" perTest" />
390
- <junit dir =" ${work.dir}" errorproperty =" tests.failed" failureproperty =" tests.failed" fork =" true" forkmode =" ${junit.forkmode}" showoutput =" true" tempdir =" ${build.dir}" >
412
+ <junit dir =" ${work.dir}" errorproperty =" tests.failed" failureproperty =" tests.failed" fork =" true" forkmode =" ${junit.forkmode}" jvm = " ${platform.java} " showoutput =" true" tempdir =" ${build.dir}" >
391
413
<test methods =" @{testmethods}" name =" @{testincludes}" todir =" ${build.test.results.dir}" />
392
414
<syspropertyset >
393
415
<propertyref prefix =" test-sys-prop." />
@@ -410,7 +432,7 @@ is divided into following sections:
410
432
<element name =" customize" optional =" true" />
411
433
<sequential >
412
434
<property name =" junit.forkmode" value =" perTest" />
413
- <junit dir =" ${work.dir}" errorproperty =" tests.failed" failureproperty =" tests.failed" fork =" true" forkmode =" ${junit.forkmode}" showoutput =" true" tempdir =" ${build.dir}" >
435
+ <junit dir =" ${work.dir}" errorproperty =" tests.failed" failureproperty =" tests.failed" fork =" true" forkmode =" ${junit.forkmode}" jvm = " ${platform.java} " showoutput =" true" tempdir =" ${build.dir}" >
414
436
<batchtest todir =" ${build.test.results.dir}" >
415
437
<fileset dir =" ${test.src.dir}" excludes =" @{excludes},${excludes}" includes =" @{includes}" >
416
438
<filename name =" @{testincludes}" />
@@ -449,7 +471,7 @@ is divided into following sections:
449
471
</fileset >
450
472
</union >
451
473
<taskdef classname =" org.testng.TestNGAntTask" classpath =" ${run.test.classpath}" name =" testng" />
452
- <testng classfilesetref =" test.set" failureProperty =" tests.failed" listeners =" org.testng.reporters.VerboseReporter" methods =" ${testng.methods.arg}" mode =" ${testng.mode}" outputdir =" ${build.test.results.dir}" suitename =" Java8Features" testname =" TestNG tests" workingDir =" ${work.dir}" >
474
+ <testng classfilesetref =" test.set" failureProperty =" tests.failed" jvm = " ${platform.java} " listeners =" org.testng.reporters.VerboseReporter" methods =" ${testng.methods.arg}" mode =" ${testng.mode}" outputdir =" ${build.test.results.dir}" suitename =" Java8Features" testname =" TestNG tests" workingDir =" ${work.dir}" >
453
475
<xmlfileset dir =" ${build.test.classes.dir}" includes =" @{testincludes}" />
454
476
<propertyset >
455
477
<propertyref prefix =" test-sys-prop." />
@@ -529,7 +551,7 @@ is divided into following sections:
529
551
<element name =" customize" optional =" true" />
530
552
<sequential >
531
553
<property name =" junit.forkmode" value =" perTest" />
532
- <junit dir =" ${work.dir}" errorproperty =" tests.failed" failureproperty =" tests.failed" fork =" true" forkmode =" ${junit.forkmode}" showoutput =" true" tempdir =" ${build.dir}" >
554
+ <junit dir =" ${work.dir}" errorproperty =" tests.failed" failureproperty =" tests.failed" fork =" true" forkmode =" ${junit.forkmode}" jvm = " ${platform.java} " showoutput =" true" tempdir =" ${build.dir}" >
533
555
<test methods =" @{testmethods}" name =" @{testincludes}" todir =" ${build.test.results.dir}" />
534
556
<syspropertyset >
535
557
<propertyref prefix =" test-sys-prop." />
@@ -554,7 +576,7 @@ is divided into following sections:
554
576
<element name =" customize" optional =" true" />
555
577
<sequential >
556
578
<property name =" junit.forkmode" value =" perTest" />
557
- <junit dir =" ${work.dir}" errorproperty =" tests.failed" failureproperty =" tests.failed" fork =" true" forkmode =" ${junit.forkmode}" showoutput =" true" tempdir =" ${build.dir}" >
579
+ <junit dir =" ${work.dir}" errorproperty =" tests.failed" failureproperty =" tests.failed" fork =" true" forkmode =" ${junit.forkmode}" jvm = " ${platform.java} " showoutput =" true" tempdir =" ${build.dir}" >
558
580
<batchtest todir =" ${build.test.results.dir}" >
559
581
<fileset dir =" ${test.src.dir}" excludes =" @{excludes},${excludes}" includes =" @{includes}" >
560
582
<filename name =" @{testincludes}" />
@@ -734,6 +756,9 @@ is divided into following sections:
734
756
<classpath >
735
757
<path path =" @{classpath}" />
736
758
</classpath >
759
+ <bootclasspath >
760
+ <path path =" ${platform.bootcp}" />
761
+ </bootclasspath >
737
762
</nbjpdastart >
738
763
</sequential >
739
764
</macrodef >
@@ -749,7 +774,9 @@ is divided into following sections:
749
774
</macrodef >
750
775
</target >
751
776
<target name =" -init-debug-args" >
752
- <property name =" version-output" value =" java version " ${ant.java.version}" />
777
+ <exec executable =" ${platform.java}" outputproperty =" version-output" >
778
+ <arg value =" -version" />
779
+ </exec >
753
780
<condition property =" have-jdk-older-than-1.4" >
754
781
<or >
755
782
<contains string =" ${version-output}" substring =" java version " 1.0" />
@@ -774,7 +801,7 @@ is divided into following sections:
774
801
<attribute default =" ${debug.classpath}" name =" classpath" />
775
802
<element name =" customize" optional =" true" />
776
803
<sequential >
777
- <java classname =" @{classname}" dir =" ${work.dir}" failonerror =" ${java.failonerror}" fork =" true" >
804
+ <java classname =" @{classname}" dir =" ${work.dir}" failonerror =" ${java.failonerror}" fork =" true" jvm = " ${platform.java} " >
778
805
<jvmarg line =" ${endorsed.classpath.cmd.line.arg}" />
779
806
<jvmarg line =" ${debug-args-line}" />
780
807
<jvmarg value =" -Xrunjdwp:transport=${debug-transport},address=${jpda.address}" />
@@ -801,7 +828,7 @@ is divided into following sections:
801
828
<attribute default =" jvm" name =" jvm" />
802
829
<element name =" customize" optional =" true" />
803
830
<sequential >
804
- <java classname =" @{classname}" dir =" ${work.dir}" failonerror =" ${java.failonerror}" fork =" true" >
831
+ <java classname =" @{classname}" dir =" ${work.dir}" failonerror =" ${java.failonerror}" fork =" true" jvm = " ${platform.java} " >
805
832
<jvmarg line =" ${endorsed.classpath.cmd.line.arg}" />
806
833
<jvmarg value =" -Dfile.encoding=${runtime.encoding}" />
807
834
<redirector errorencoding =" ${runtime.encoding}" inputencoding =" ${runtime.encoding}" outputencoding =" ${runtime.encoding}" />
@@ -999,7 +1026,7 @@ is divided into following sections:
999
1026
<j2seproject3 : copylibs manifest =" ${tmp.manifest.file}" />
1000
1027
<echo level =" info" >To run this application from the command line without Ant, try:</echo >
1001
1028
<property location =" ${dist.jar}" name =" dist.jar.resolved" />
1002
- <echo level =" info" >java -jar "${dist.jar.resolved}"</echo >
1029
+ <echo level =" info" >${platform. java} -jar "${dist.jar.resolved}"</echo >
1003
1030
</target >
1004
1031
<target depends =" init,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen" if =" do.archive" name =" -do-jar-jar" unless =" do.mkdist" >
1005
1032
<j2seproject1 : jar manifest =" ${tmp.manifest.file}" />
@@ -1208,10 +1235,13 @@ is divided into following sections:
1208
1235
</not >
1209
1236
</and >
1210
1237
</condition >
1238
+ <exec executable =" ${platform.java}" failonerror =" false" outputproperty =" platform.version.output" >
1239
+ <arg value =" -version" />
1240
+ </exec >
1211
1241
<condition else =" " property =" bug5101868workaround" value =" *.java" >
1212
- <matches pattern =" 1\.[56](\..*)?" string =" ${java .version}" />
1242
+ <matches multiline = " true " pattern =" 1\.[56](\..*)?" string =" ${platform .version.output }" />
1213
1243
</condition >
1214
- <javadoc additionalparam =" -J-Dfile.encoding=${file.encoding} ${javadoc.additionalparam}" author =" ${javadoc.author}" charset =" UTF-8" destdir =" ${dist.javadoc.dir}" docencoding =" UTF-8" encoding =" ${javadoc.encoding.used}" failonerror =" true" noindex =" ${javadoc.noindex}" nonavbar =" ${javadoc.nonavbar}" notree =" ${javadoc.notree}" private =" ${javadoc.private}" source =" ${javac.source}" splitindex =" ${javadoc.splitindex}" use =" ${javadoc.use}" useexternalfile =" true" version =" ${javadoc.version}" windowtitle =" ${javadoc.windowtitle}" >
1244
+ <javadoc additionalparam =" -J-Dfile.encoding=${file.encoding} ${javadoc.additionalparam}" author =" ${javadoc.author}" charset =" UTF-8" destdir =" ${dist.javadoc.dir}" docencoding =" UTF-8" encoding =" ${javadoc.encoding.used}" executable = " ${platform.javadoc} " failonerror =" true" noindex =" ${javadoc.noindex}" nonavbar =" ${javadoc.nonavbar}" notree =" ${javadoc.notree}" private =" ${javadoc.private}" source =" ${javac.source}" splitindex =" ${javadoc.splitindex}" use =" ${javadoc.use}" useexternalfile =" true" version =" ${javadoc.version}" windowtitle =" ${javadoc.windowtitle}" >
1215
1245
<classpath >
1216
1246
<path path =" ${javac.classpath}" />
1217
1247
</classpath >
0 commit comments