@@ -54,6 +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
+ <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 >
57
94
<available file =" ${manifest.file}" property =" manifest.available" />
58
95
<condition property =" splashscreen.available" >
59
96
<and >
@@ -187,15 +224,6 @@ is divided into following sections:
187
224
<condition else =" " property =" endorsed.classpath.cmd.line.arg" value =" -Xbootclasspath/p:'${toString:endorsed.classpath.path}'" >
188
225
<length length =" 0" string =" ${endorsed.classpath}" when =" greater" />
189
226
</condition >
190
- <condition else =" false" property =" jdkBug6558476" >
191
- <and >
192
- <matches pattern =" 1\.[56]" string =" ${java.specification.version}" />
193
- <not >
194
- <os family =" unix" />
195
- </not >
196
- </and >
197
- </condition >
198
- <property name =" javac.fork" value =" ${jdkBug6558476}" />
199
227
<property name =" jar.index" value =" false" />
200
228
<property name =" jar.index.metainf" value =" ${jar.index}" />
201
229
<available file =" ${meta.inf.dir}/persistence.xml" property =" has.persistence.xml" />
@@ -242,7 +270,7 @@ is divided into following sections:
242
270
<property location =" ${build.dir}/empty" name =" empty.dir" />
243
271
<mkdir dir =" ${empty.dir}" />
244
272
<mkdir dir =" @{apgeneratedsrcdir}" />
245
- <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}" >
273
+ <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}" >
246
274
<src >
247
275
<dirset dir =" @{gensrcdir}" erroronmissingdir =" false" >
248
276
<include name =" *" />
@@ -281,7 +309,7 @@ is divided into following sections:
281
309
<sequential >
282
310
<property location =" ${build.dir}/empty" name =" empty.dir" />
283
311
<mkdir dir =" ${empty.dir}" />
284
- <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}" >
312
+ <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}" >
285
313
<src >
286
314
<dirset dir =" @{gensrcdir}" erroronmissingdir =" false" >
287
315
<include name =" *" />
@@ -338,7 +366,7 @@ is divided into following sections:
338
366
<attribute default =" **" name =" testincludes" />
339
367
<sequential >
340
368
<property name =" junit.forkmode" value =" perTest" />
341
- <junit dir =" ${work.dir}" errorproperty =" tests.failed" failureproperty =" tests.failed" fork =" true" forkmode =" ${junit.forkmode}" showoutput =" true" tempdir =" ${build.dir}" >
369
+ <junit dir =" ${work.dir}" errorproperty =" tests.failed" failureproperty =" tests.failed" fork =" true" forkmode =" ${junit.forkmode}" jvm = " ${platform.java} " showoutput =" true" tempdir =" ${build.dir}" >
342
370
<batchtest todir =" ${build.test.results.dir}" >
343
371
<fileset dir =" ${test.src.dir}" excludes =" @{excludes},${excludes}" includes =" @{includes}" >
344
372
<filename name =" @{testincludes}" />
@@ -414,6 +442,9 @@ is divided into following sections:
414
442
<classpath >
415
443
<path path =" @{classpath}" />
416
444
</classpath >
445
+ <bootclasspath >
446
+ <path path =" ${platform.bootcp}" />
447
+ </bootclasspath >
417
448
</nbjpdastart >
418
449
</sequential >
419
450
</macrodef >
@@ -429,7 +460,9 @@ is divided into following sections:
429
460
</macrodef >
430
461
</target >
431
462
<target name =" -init-debug-args" >
432
- <property name =" version-output" value =" java version " ${ant.java.version}" />
463
+ <exec executable =" ${platform.java}" outputproperty =" version-output" >
464
+ <arg value =" -version" />
465
+ </exec >
433
466
<condition property =" have-jdk-older-than-1.4" >
434
467
<or >
435
468
<contains string =" ${version-output}" substring =" java version " 1.0" />
@@ -454,7 +487,7 @@ is divided into following sections:
454
487
<attribute default =" ${debug.classpath}" name =" classpath" />
455
488
<element name =" customize" optional =" true" />
456
489
<sequential >
457
- <java classname =" @{classname}" dir =" ${work.dir}" fork =" true" >
490
+ <java classname =" @{classname}" dir =" ${work.dir}" fork =" true" jvm = " ${platform.java} " >
458
491
<jvmarg line =" ${endorsed.classpath.cmd.line.arg}" />
459
492
<jvmarg line =" ${debug-args-line}" />
460
493
<jvmarg value =" -Xrunjdwp:transport=${debug-transport},address=${jpda.address}" />
@@ -479,7 +512,7 @@ is divided into following sections:
479
512
<attribute default =" ${run.classpath}" name =" classpath" />
480
513
<element name =" customize" optional =" true" />
481
514
<sequential >
482
- <java classname =" @{classname}" dir =" ${work.dir}" fork =" true" >
515
+ <java classname =" @{classname}" dir =" ${work.dir}" fork =" true" jvm = " ${platform.java} " >
483
516
<jvmarg line =" ${endorsed.classpath.cmd.line.arg}" />
484
517
<jvmarg value =" -Dfile.encoding=${runtime.encoding}" />
485
518
<redirector errorencoding =" ${runtime.encoding}" inputencoding =" ${runtime.encoding}" outputencoding =" ${runtime.encoding}" />
@@ -669,7 +702,7 @@ is divided into following sections:
669
702
<path path =" ${run.classpath}" />
670
703
<map from =" ${build.classes.dir.resolved}" to =" ${dist.jar.resolved}" />
671
704
</pathconvert >
672
- <echo level =" info" >java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo >
705
+ <echo level =" info" >${platform. java} -cp "${run.classpath.with.dist.jar}" ${main.class}</echo >
673
706
</target >
674
707
<target depends =" init" if =" do.archive" name =" -do-jar-with-libraries-create-manifest" unless =" manifest.available" >
675
708
<tempfile deleteonexit =" true" destdir =" ${build.dir}" property =" tmp.manifest.file" />
@@ -696,7 +729,7 @@ is divided into following sections:
696
729
<j2seproject3 : copylibs manifest =" ${tmp.manifest.file}" />
697
730
<echo level =" info" >To run this application from the command line without Ant, try:</echo >
698
731
<property location =" ${dist.jar}" name =" dist.jar.resolved" />
699
- <echo level =" info" >java -jar "${dist.jar.resolved}"</echo >
732
+ <echo level =" info" >${platform. java} -jar "${dist.jar.resolved}"</echo >
700
733
</target >
701
734
<target depends =" -do-jar-with-libraries-pack" if =" do.archive" name =" -do-jar-with-libraries-delete-manifest" >
702
735
<delete >
@@ -846,15 +879,16 @@ is divided into following sections:
846
879
-->
847
880
<target depends =" init" if =" have.sources" name =" -javadoc-build" >
848
881
<mkdir dir =" ${dist.javadoc.dir}" />
849
- <javadoc additionalparam =" ${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}" >
882
+ <javadoc additionalparam =" ${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}" >
850
883
<classpath >
851
884
<path path =" ${javac.classpath}" />
852
885
</classpath >
853
- <fileset dir =" ${src.dir}" excludes =" ${excludes}" includes =" ${includes}" >
886
+ <fileset dir =" ${src.dir}" excludes =" *.java, ${excludes}" includes =" ${includes}" >
854
887
<filename name =" **/*.java" />
855
888
</fileset >
856
889
<fileset dir =" ${build.generated.sources.dir}" erroronmissingdir =" false" >
857
890
<include name =" **/*.java" />
891
+ <exclude name =" *.java" />
858
892
</fileset >
859
893
</javadoc >
860
894
<copy todir =" ${dist.javadoc.dir}" >
0 commit comments