@@ -119,7 +119,43 @@ is divided into following sections:
119119 <property name =" module.name" value =" " />
120120 </target >
121121 <target depends =" -pre-init,-init-private,-init-user,-init-project,-init-macrodef-property,-init-modules-supported" name =" -do-init" >
122- <property name =" platform.java" value =" ${java.home}/bin/java" />
122+ <j2seproject1 : property name =" platform.home" value =" platforms.${platform.active}.home" />
123+ <j2seproject1 : property name =" platform.bootcp" value =" platforms.${platform.active}.bootclasspath" />
124+ <j2seproject1 : property name =" platform.compiler" value =" platforms.${platform.active}.compile" />
125+ <j2seproject1 : property name =" platform.javac.tmp" value =" platforms.${platform.active}.javac" />
126+ <condition property =" platform.javac" value =" ${platform.home}/bin/javac" >
127+ <equals arg1 =" ${platform.javac.tmp}" arg2 =" $${platforms.${platform.active}.javac}" />
128+ </condition >
129+ <property name =" platform.javac" value =" ${platform.javac.tmp}" />
130+ <j2seproject1 : property name =" platform.java.tmp" value =" platforms.${platform.active}.java" />
131+ <condition property =" platform.java" value =" ${platform.home}/bin/java" >
132+ <equals arg1 =" ${platform.java.tmp}" arg2 =" $${platforms.${platform.active}.java}" />
133+ </condition >
134+ <property name =" platform.java" value =" ${platform.java.tmp}" />
135+ <j2seproject1 : property name =" platform.javadoc.tmp" value =" platforms.${platform.active}.javadoc" />
136+ <condition property =" platform.javadoc" value =" ${platform.home}/bin/javadoc" >
137+ <equals arg1 =" ${platform.javadoc.tmp}" arg2 =" $${platforms.${platform.active}.javadoc}" />
138+ </condition >
139+ <property name =" platform.javadoc" value =" ${platform.javadoc.tmp}" />
140+ <condition property =" platform.invalid" value =" true" >
141+ <or >
142+ <contains string =" ${platform.javac}" substring =" $${platforms." />
143+ <contains string =" ${platform.java}" substring =" $${platforms." />
144+ <contains string =" ${platform.javadoc}" substring =" $${platforms." />
145+ </or >
146+ </condition >
147+ <fail unless =" platform.home" >Must set platform.home</fail >
148+ <fail unless =" platform.bootcp" >Must set platform.bootcp</fail >
149+ <fail unless =" platform.java" >Must set platform.java</fail >
150+ <fail unless =" platform.javac" >Must set platform.javac</fail >
151+ <fail if =" platform.invalid" >
152+ The J2SE Platform is not correctly set up.
153+ Your active platform is: ${platform.active}, but the corresponding property "platforms.${platform.active}.home" is not found in the project's properties files.
154+ Either open the project in the IDE and setup the Platform with the same name or add it manually.
155+ For example like this:
156+ ant -Duser.properties.file=< path_to_property_file> jar (where you put the property "platforms.${platform.active}.home" in a .properties file)
157+ or ant -Dplatforms.${platform.active}.home=< path_to_JDK_home> jar (where no properties file is used)
158+ </fail >
123159 <available file =" ${manifest.file}" property =" manifest.available" />
124160 <condition property =" splashscreen.available" >
125161 <and >
@@ -254,20 +290,6 @@ is divided into following sections:
254290 <condition else =" " property =" javac.profile.cmd.line.arg" value =" -profile ${javac.profile}" >
255291 <isset property =" profile.available" />
256292 </condition >
257- <condition else =" false" property =" jdkBug6558476" >
258- <and >
259- <matches pattern =" 1\.[56]" string =" ${java.specification.version}" />
260- <not >
261- <os family =" unix" />
262- </not >
263- </and >
264- </condition >
265- <condition else =" false" property =" javac.fork" >
266- <or >
267- <istrue value =" ${jdkBug6558476}" />
268- <istrue value =" ${javac.external.vm}" />
269- </or >
270- </condition >
271293 <property name =" jar.index" value =" false" />
272294 <property name =" jar.index.metainf" value =" ${jar.index}" />
273295 <property name =" copylibs.rebase" value =" true" />
@@ -355,7 +377,7 @@ is divided into following sections:
355377 </path >
356378 </resourcecount >
357379 </condition >
358- <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}" >
380+ <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}" >
359381 <src >
360382 <dirset dir =" @{gensrcdir}" erroronmissingdir =" false" >
361383 <include name =" *" />
@@ -406,7 +428,7 @@ is divided into following sections:
406428 <property location =" ${build.dir}/empty" name =" empty.dir" />
407429 <mkdir dir =" ${empty.dir}" />
408430 <mkdir dir =" @{apgeneratedsrcdir}" />
409- <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}" >
431+ <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}" >
410432 <src >
411433 <dirset dir =" @{gensrcdir}" erroronmissingdir =" false" >
412434 <include name =" *" />
@@ -448,7 +470,7 @@ is divided into following sections:
448470 <sequential >
449471 <property location =" ${build.dir}/empty" name =" empty.dir" />
450472 <mkdir dir =" ${empty.dir}" />
451- <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}" >
473+ <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}" >
452474 <src >
453475 <dirset dir =" @{gensrcdir}" erroronmissingdir =" false" >
454476 <include name =" *" />
@@ -527,7 +549,7 @@ is divided into following sections:
527549 <element name =" customizePrototype" optional =" true" />
528550 <sequential >
529551 <property name =" junit.forkmode" value =" perTest" />
530- <junit dir =" ${work.dir}" errorproperty =" tests.failed" failureproperty =" tests.failed" fork =" true" forkmode =" ${junit.forkmode}" showoutput =" true" tempdir =" ${build.dir}" >
552+ <junit dir =" ${work.dir}" errorproperty =" tests.failed" failureproperty =" tests.failed" fork =" true" forkmode =" ${junit.forkmode}" jvm = " ${platform.java} " showoutput =" true" tempdir =" ${build.dir}" >
531553 <syspropertyset >
532554 <propertyref prefix =" test-sys-prop." />
533555 <mapper from =" test-sys-prop.*" to =" *" type =" glob" />
@@ -555,7 +577,7 @@ is divided into following sections:
555577 <element name =" customizePrototype" optional =" true" />
556578 <sequential >
557579 <property name =" junit.forkmode" value =" perTest" />
558- <junit dir =" ${work.dir}" errorproperty =" tests.failed" failureproperty =" tests.failed" fork =" true" forkmode =" ${junit.forkmode}" showoutput =" true" tempdir =" ${build.dir}" >
580+ <junit dir =" ${work.dir}" errorproperty =" tests.failed" failureproperty =" tests.failed" fork =" true" forkmode =" ${junit.forkmode}" jvm = " ${platform.java} " showoutput =" true" tempdir =" ${build.dir}" >
559581 <syspropertyset >
560582 <propertyref prefix =" test-sys-prop." />
561583 <mapper from =" test-sys-prop.*" to =" *" type =" glob" />
@@ -631,7 +653,7 @@ is divided into following sections:
631653 </fileset >
632654 </union >
633655 <taskdef classname =" org.testng.TestNGAntTask" classpath =" ${run.test.classpath}" name =" testng" />
634- <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 =" JavaPskmailServer" testname =" TestNG tests" workingDir =" ${work.dir}" >
656+ <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 =" JavaPskmailServer" testname =" TestNG tests" workingDir =" ${work.dir}" >
635657 <xmlfileset dir =" ${build.test.classes.dir}" includes =" @{testincludes}" />
636658 <propertyset >
637659 <propertyref prefix =" test-sys-prop." />
@@ -862,6 +884,9 @@ is divided into following sections:
862884 <classpath >
863885 <path path =" @{classpath}" />
864886 </classpath >
887+ <bootclasspath >
888+ <path path =" ${platform.bootcp}" />
889+ </bootclasspath >
865890 </nbjpdastart >
866891 </sequential >
867892 </macrodef >
@@ -911,7 +936,7 @@ is divided into following sections:
911936 <attribute default =" jvm" name =" jvm" />
912937 <element name =" customize" optional =" true" />
913938 <sequential >
914- <java classname =" @{classname}" dir =" ${work.dir}" failonerror =" ${java.failonerror}" fork =" true" module =" @{modulename}" >
939+ <java classname =" @{classname}" dir =" ${work.dir}" failonerror =" ${java.failonerror}" fork =" true" jvm = " ${platform.java} " module =" @{modulename}" >
915940 <classpath >
916941 <path path =" @{classpath}" />
917942 </classpath >
@@ -945,7 +970,7 @@ is divided into following sections:
945970 <attribute default =" jvm" name =" jvm" />
946971 <element name =" customize" optional =" true" />
947972 <sequential >
948- <java classname =" @{classname}" dir =" ${work.dir}" failonerror =" ${java.failonerror}" fork =" true" >
973+ <java classname =" @{classname}" dir =" ${work.dir}" failonerror =" ${java.failonerror}" fork =" true" jvm = " ${platform.java} " >
949974 <classpath >
950975 <path path =" @{classpath}" />
951976 </classpath >
@@ -977,7 +1002,7 @@ is divided into following sections:
9771002 <attribute default =" jvm" name =" jvm" />
9781003 <element name =" customize" optional =" true" />
9791004 <sequential >
980- <java classname =" @{classname}" dir =" ${work.dir}" failonerror =" ${java.failonerror}" fork =" true" >
1005+ <java classname =" @{classname}" dir =" ${work.dir}" failonerror =" ${java.failonerror}" fork =" true" jvm = " ${platform.java} " >
9811006 <jvmarg line =" ${endorsed.classpath.cmd.line.arg}" />
9821007 <jvmarg value =" -Dfile.encoding=${runtime.encoding}" />
9831008 <redirector errorencoding =" ${runtime.encoding}" inputencoding =" ${runtime.encoding}" outputencoding =" ${runtime.encoding}" />
@@ -1197,7 +1222,7 @@ is divided into following sections:
11971222 <j2seproject3 : copylibs manifest =" ${tmp.manifest.file}" />
11981223 <echo level =" info" >To run this application from the command line without Ant, try:</echo >
11991224 <property location =" ${dist.jar}" name =" dist.jar.resolved" />
1200- <echo level =" info" >java -jar "${dist.jar.resolved}"</echo >
1225+ <echo level =" info" >${platform. java} -jar "${dist.jar.resolved}"</echo >
12011226 </target >
12021227 <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" >
12031228 <j2seproject1 : jar manifest =" ${tmp.manifest.file}" />
@@ -1299,8 +1324,8 @@ is divided into following sections:
12991324 <isset property =" main.class.available" />
13001325 </and >
13011326 </condition >
1302- <property name =" platform.jlink" value =" ${jdk .home}/bin/jlink" />
1303- <property name =" jlink.systemmodules.internal" value =" ${jdk .home}/jmods" />
1327+ <property name =" platform.jlink" value =" ${platform .home}/bin/jlink" />
1328+ <property name =" jlink.systemmodules.internal" value =" ${platform .home}/jmods" />
13041329 <exec executable =" ${platform.jlink}" >
13051330 <arg value =" --module-path" />
13061331 <arg path =" ${jlink.systemmodules.internal}:${run.modulepath}:${dist.jar}" />
@@ -1493,16 +1518,19 @@ is divided into following sections:
14931518 </not >
14941519 </and >
14951520 </condition >
1521+ <exec executable =" ${platform.java}" failonerror =" false" outputproperty =" platform.version.output" >
1522+ <arg value =" -version" />
1523+ </exec >
14961524 <condition else =" " property =" bug5101868workaround" value =" *.java" >
1497- <matches pattern =" 1\.[56](\..*)?" string =" ${java .version}" />
1525+ <matches multiline = " true " pattern =" 1\.[56](\..*)?" string =" ${platform .version.output }" />
14981526 </condition >
14991527 <condition else =" " property =" javadoc.html5.cmd.line.arg" value =" -html5" >
15001528 <and >
15011529 <isset property =" javadoc.html5" />
1502- <available file =" ${jdk .home}${file.separator}lib${file.separator}jrt-fs.jar" />
1530+ <available file =" ${platform .home}${file.separator}lib${file.separator}jrt-fs.jar" />
15031531 </and >
15041532 </condition >
1505- <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}" >
1533+ <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}" >
15061534 <classpath >
15071535 <path path =" ${javac.classpath}" />
15081536 </classpath >
0 commit comments