@@ -79,7 +79,43 @@ is divided into following sections:
7979 <property file =" nbproject/project.properties" />
8080 </target >
8181 <target depends =" -pre-init,-init-private,-init-libraries,-init-user,-init-project,-init-macrodef-property" name =" -do-init" >
82- <property name =" platform.java" value =" ${java.home}/bin/java" />
82+ <j2seproject1 : property name =" platform.home" value =" platforms.${platform.active}.home" />
83+ <j2seproject1 : property name =" platform.bootcp" value =" platforms.${platform.active}.bootclasspath" />
84+ <j2seproject1 : property name =" platform.compiler" value =" platforms.${platform.active}.compile" />
85+ <j2seproject1 : property name =" platform.javac.tmp" value =" platforms.${platform.active}.javac" />
86+ <condition property =" platform.javac" value =" ${platform.home}/bin/javac" >
87+ <equals arg1 =" ${platform.javac.tmp}" arg2 =" $${platforms.${platform.active}.javac}" />
88+ </condition >
89+ <property name =" platform.javac" value =" ${platform.javac.tmp}" />
90+ <j2seproject1 : property name =" platform.java.tmp" value =" platforms.${platform.active}.java" />
91+ <condition property =" platform.java" value =" ${platform.home}/bin/java" >
92+ <equals arg1 =" ${platform.java.tmp}" arg2 =" $${platforms.${platform.active}.java}" />
93+ </condition >
94+ <property name =" platform.java" value =" ${platform.java.tmp}" />
95+ <j2seproject1 : property name =" platform.javadoc.tmp" value =" platforms.${platform.active}.javadoc" />
96+ <condition property =" platform.javadoc" value =" ${platform.home}/bin/javadoc" >
97+ <equals arg1 =" ${platform.javadoc.tmp}" arg2 =" $${platforms.${platform.active}.javadoc}" />
98+ </condition >
99+ <property name =" platform.javadoc" value =" ${platform.javadoc.tmp}" />
100+ <condition property =" platform.invalid" value =" true" >
101+ <or >
102+ <contains string =" ${platform.javac}" substring =" $${platforms." />
103+ <contains string =" ${platform.java}" substring =" $${platforms." />
104+ <contains string =" ${platform.javadoc}" substring =" $${platforms." />
105+ </or >
106+ </condition >
107+ <fail unless =" platform.home" >Must set platform.home</fail >
108+ <fail unless =" platform.bootcp" >Must set platform.bootcp</fail >
109+ <fail unless =" platform.java" >Must set platform.java</fail >
110+ <fail unless =" platform.javac" >Must set platform.javac</fail >
111+ <fail if =" platform.invalid" >
112+ The J2SE Platform is not correctly set up.
113+ Your active platform is: ${platform.active}, but the corresponding property "platforms.${platform.active}.home" is not found in the project's properties files.
114+ Either open the project in the IDE and setup the Platform with the same name or add it manually.
115+ For example like this:
116+ ant -Duser.properties.file=< path_to_property_file> jar (where you put the property "platforms.${platform.active}.home" in a .properties file)
117+ or ant -Dplatforms.${platform.active}.home=< path_to_JDK_home> jar (where no properties file is used)
118+ </fail >
83119 <available file =" ${manifest.file}" property =" manifest.available" />
84120 <condition property =" splashscreen.available" >
85121 <and >
@@ -208,15 +244,6 @@ is divided into following sections:
208244 <condition else =" " property =" javac.profile.cmd.line.arg" value =" -profile ${javac.profile}" >
209245 <isset property =" profile.available" />
210246 </condition >
211- <condition else =" false" property =" jdkBug6558476" >
212- <and >
213- <matches pattern =" 1\.[56]" string =" ${java.specification.version}" />
214- <not >
215- <os family =" unix" />
216- </not >
217- </and >
218- </condition >
219- <property name =" javac.fork" value =" ${jdkBug6558476}" />
220247 <property name =" jar.index" value =" false" />
221248 <property name =" jar.index.metainf" value =" ${jar.index}" />
222249 <property name =" copylibs.rebase" value =" true" />
@@ -285,7 +312,7 @@ is divided into following sections:
285312 <property location =" ${build.dir}/empty" name =" empty.dir" />
286313 <mkdir dir =" ${empty.dir}" />
287314 <mkdir dir =" @{apgeneratedsrcdir}" />
288- <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}" >
315+ <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}" >
289316 <src >
290317 <dirset dir =" @{gensrcdir}" erroronmissingdir =" false" >
291318 <include name =" *" />
@@ -325,7 +352,7 @@ is divided into following sections:
325352 <sequential >
326353 <property location =" ${build.dir}/empty" name =" empty.dir" />
327354 <mkdir dir =" ${empty.dir}" />
328- <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}" >
355+ <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}" >
329356 <src >
330357 <dirset dir =" @{gensrcdir}" erroronmissingdir =" false" >
331358 <include name =" *" />
@@ -406,7 +433,7 @@ is divided into following sections:
406433 <element name =" customize" optional =" true" />
407434 <sequential >
408435 <property name =" junit.forkmode" value =" perTest" />
409- <junit dir =" ${work.dir}" errorproperty =" tests.failed" failureproperty =" tests.failed" fork =" true" forkmode =" ${junit.forkmode}" showoutput =" true" tempdir =" ${build.dir}" >
436+ <junit dir =" ${work.dir}" errorproperty =" tests.failed" failureproperty =" tests.failed" fork =" true" forkmode =" ${junit.forkmode}" jvm = " ${platform.java} " showoutput =" true" tempdir =" ${build.dir}" >
410437 <test methods =" @{testmethods}" name =" @{testincludes}" todir =" ${build.test.results.dir}" />
411438 <syspropertyset >
412439 <propertyref prefix =" test-sys-prop." />
@@ -429,7 +456,7 @@ is divided into following sections:
429456 <element name =" customize" optional =" true" />
430457 <sequential >
431458 <property name =" junit.forkmode" value =" perTest" />
432- <junit dir =" ${work.dir}" errorproperty =" tests.failed" failureproperty =" tests.failed" fork =" true" forkmode =" ${junit.forkmode}" showoutput =" true" tempdir =" ${build.dir}" >
459+ <junit dir =" ${work.dir}" errorproperty =" tests.failed" failureproperty =" tests.failed" fork =" true" forkmode =" ${junit.forkmode}" jvm = " ${platform.java} " showoutput =" true" tempdir =" ${build.dir}" >
433460 <batchtest todir =" ${build.test.results.dir}" >
434461 <fileset dir =" ${test.src.dir}" excludes =" @{excludes},${excludes}" includes =" @{includes}" >
435462 <filename name =" @{testincludes}" />
@@ -468,7 +495,7 @@ is divided into following sections:
468495 </fileset >
469496 </union >
470497 <taskdef classname =" org.testng.TestNGAntTask" classpath =" ${run.test.classpath}" name =" testng" />
471- <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 =" Cognitive_Foundry_Common_Core" testname =" TestNG tests" workingDir =" ${work.dir}" >
498+ <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 =" Cognitive_Foundry_Common_Core" testname =" TestNG tests" workingDir =" ${work.dir}" >
472499 <xmlfileset dir =" ${build.test.classes.dir}" includes =" @{testincludes}" />
473500 <propertyset >
474501 <propertyref prefix =" test-sys-prop." />
@@ -548,7 +575,7 @@ is divided into following sections:
548575 <element name =" customize" optional =" true" />
549576 <sequential >
550577 <property name =" junit.forkmode" value =" perTest" />
551- <junit dir =" ${work.dir}" errorproperty =" tests.failed" failureproperty =" tests.failed" fork =" true" forkmode =" ${junit.forkmode}" showoutput =" true" tempdir =" ${build.dir}" >
578+ <junit dir =" ${work.dir}" errorproperty =" tests.failed" failureproperty =" tests.failed" fork =" true" forkmode =" ${junit.forkmode}" jvm = " ${platform.java} " showoutput =" true" tempdir =" ${build.dir}" >
552579 <test methods =" @{testmethods}" name =" @{testincludes}" todir =" ${build.test.results.dir}" />
553580 <syspropertyset >
554581 <propertyref prefix =" test-sys-prop." />
@@ -573,7 +600,7 @@ is divided into following sections:
573600 <element name =" customize" optional =" true" />
574601 <sequential >
575602 <property name =" junit.forkmode" value =" perTest" />
576- <junit dir =" ${work.dir}" errorproperty =" tests.failed" failureproperty =" tests.failed" fork =" true" forkmode =" ${junit.forkmode}" showoutput =" true" tempdir =" ${build.dir}" >
603+ <junit dir =" ${work.dir}" errorproperty =" tests.failed" failureproperty =" tests.failed" fork =" true" forkmode =" ${junit.forkmode}" jvm = " ${platform.java} " showoutput =" true" tempdir =" ${build.dir}" >
577604 <batchtest todir =" ${build.test.results.dir}" >
578605 <fileset dir =" ${test.src.dir}" excludes =" @{excludes},${excludes}" includes =" @{includes}" >
579606 <filename name =" @{testincludes}" />
@@ -753,6 +780,9 @@ is divided into following sections:
753780 <classpath >
754781 <path path =" @{classpath}" />
755782 </classpath >
783+ <bootclasspath >
784+ <path path =" ${platform.bootcp}" />
785+ </bootclasspath >
756786 </nbjpdastart >
757787 </sequential >
758788 </macrodef >
@@ -768,7 +798,9 @@ is divided into following sections:
768798 </macrodef >
769799 </target >
770800 <target name =" -init-debug-args" >
771- <property name =" version-output" value =" java version " ${ant.java.version}" />
801+ <exec executable =" ${platform.java}" outputproperty =" version-output" >
802+ <arg value =" -version" />
803+ </exec >
772804 <condition property =" have-jdk-older-than-1.4" >
773805 <or >
774806 <contains string =" ${version-output}" substring =" java version " 1.0" />
@@ -793,7 +825,7 @@ is divided into following sections:
793825 <attribute default =" ${debug.classpath}" name =" classpath" />
794826 <element name =" customize" optional =" true" />
795827 <sequential >
796- <java classname =" @{classname}" dir =" ${work.dir}" fork =" true" >
828+ <java classname =" @{classname}" dir =" ${work.dir}" fork =" true" jvm = " ${platform.java} " >
797829 <jvmarg line =" ${endorsed.classpath.cmd.line.arg}" />
798830 <jvmarg line =" ${debug-args-line}" />
799831 <jvmarg value =" -Xrunjdwp:transport=${debug-transport},address=${jpda.address}" />
@@ -820,7 +852,7 @@ is divided into following sections:
820852 <attribute default =" jvm" name =" jvm" />
821853 <element name =" customize" optional =" true" />
822854 <sequential >
823- <java classname =" @{classname}" dir =" ${work.dir}" fork =" true" >
855+ <java classname =" @{classname}" dir =" ${work.dir}" fork =" true" jvm = " ${platform.java} " >
824856 <jvmarg line =" ${endorsed.classpath.cmd.line.arg}" />
825857 <jvmarg value =" -Dfile.encoding=${runtime.encoding}" />
826858 <redirector errorencoding =" ${runtime.encoding}" inputencoding =" ${runtime.encoding}" outputencoding =" ${runtime.encoding}" />
@@ -1018,7 +1050,7 @@ is divided into following sections:
10181050 <j2seproject3 : copylibs manifest =" ${tmp.manifest.file}" />
10191051 <echo level =" info" >To run this application from the command line without Ant, try:</echo >
10201052 <property location =" ${dist.jar}" name =" dist.jar.resolved" />
1021- <echo level =" info" >java -jar "${dist.jar.resolved}"</echo >
1053+ <echo level =" info" >${platform. java} -jar "${dist.jar.resolved}"</echo >
10221054 </target >
10231055 <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" >
10241056 <j2seproject1 : jar manifest =" ${tmp.manifest.file}" />
@@ -1227,10 +1259,13 @@ is divided into following sections:
12271259 </not >
12281260 </and >
12291261 </condition >
1262+ <exec executable =" ${platform.java}" failonerror =" false" outputproperty =" platform.version.output" >
1263+ <arg value =" -version" />
1264+ </exec >
12301265 <condition else =" " property =" bug5101868workaround" value =" *.java" >
1231- <matches pattern =" 1\.[56](\..*)?" string =" ${java .version}" />
1266+ <matches multiline = " true " pattern =" 1\.[56](\..*)?" string =" ${platform .version.output }" />
12321267 </condition >
1233- <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}" >
1268+ <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}" >
12341269 <classpath >
12351270 <path path =" ${javac.classpath}" />
12361271 </classpath >
0 commit comments