ssinstaller/engine/nbproject/build-impl.xml
branchrelease82
changeset 18421 99d684ee4e50
parent 13981 540348140bd9
     1.1 --- a/ssinstaller/engine/nbproject/build-impl.xml	Tue Sep 09 23:02:34 2008 +0400
     1.2 +++ b/ssinstaller/engine/nbproject/build-impl.xml	Wed Jun 07 17:36:09 2017 +0300
     1.3 @@ -12,14 +12,21 @@
     1.4    - execution
     1.5    - debugging
     1.6    - javadoc
     1.7 -  - junit compilation
     1.8 -  - junit execution
     1.9 -  - junit debugging
    1.10 +  - test compilation
    1.11 +  - test execution
    1.12 +  - test debugging
    1.13    - applet
    1.14    - cleanup
    1.15  
    1.16          -->
    1.17  <project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="Sun_Studio_Installer_Engine-impl">
    1.18 +    <fail message="Please build using Ant 1.8.0 or higher.">
    1.19 +        <condition>
    1.20 +            <not>
    1.21 +                <antversion atleast="1.8.0"/>
    1.22 +            </not>
    1.23 +        </condition>
    1.24 +    </fail>
    1.25      <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
    1.26      <!-- 
    1.27                  ======================
    1.28 @@ -39,28 +46,78 @@
    1.29          <property file="${user.properties.file}"/>
    1.30          <!-- The two properties below are usually overridden -->
    1.31          <!-- by the active platform. Just a fallback. -->
    1.32 -        <property name="default.javac.source" value="1.4"/>
    1.33 -        <property name="default.javac.target" value="1.4"/>
    1.34 +        <property name="default.javac.source" value="1.6"/>
    1.35 +        <property name="default.javac.target" value="1.6"/>
    1.36      </target>
    1.37      <target depends="-pre-init,-init-private,-init-user" name="-init-project">
    1.38          <property file="nbproject/configs/${config}.properties"/>
    1.39          <property file="nbproject/project.properties"/>
    1.40      </target>
    1.41      <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init">
    1.42 +        <property name="platform.java" value="${java.home}/bin/java"/>
    1.43          <available file="${manifest.file}" property="manifest.available"/>
    1.44 -        <condition property="manifest.available+main.class">
    1.45 +        <condition property="splashscreen.available">
    1.46              <and>
    1.47 -                <isset property="manifest.available"/>
    1.48 +                <not>
    1.49 +                    <equals arg1="${application.splash}" arg2="" trim="true"/>
    1.50 +                </not>
    1.51 +                <available file="${application.splash}"/>
    1.52 +            </and>
    1.53 +        </condition>
    1.54 +        <condition property="main.class.available">
    1.55 +            <and>
    1.56                  <isset property="main.class"/>
    1.57                  <not>
    1.58                      <equals arg1="${main.class}" arg2="" trim="true"/>
    1.59                  </not>
    1.60              </and>
    1.61          </condition>
    1.62 -        <condition property="manifest.available+main.class+mkdist.available">
    1.63 +        <condition property="profile.available">
    1.64              <and>
    1.65 -                <istrue value="${manifest.available+main.class}"/>
    1.66 +                <isset property="javac.profile"/>
    1.67 +                <length length="0" string="${javac.profile}" when="greater"/>
    1.68 +                <matches pattern="((1\.[89])|9)(\..*)?" string="${javac.source}"/>
    1.69 +            </and>
    1.70 +        </condition>
    1.71 +        <condition property="do.archive">
    1.72 +            <or>
    1.73 +                <not>
    1.74 +                    <istrue value="${jar.archive.disabled}"/>
    1.75 +                </not>
    1.76 +                <istrue value="${not.archive.disabled}"/>
    1.77 +            </or>
    1.78 +        </condition>
    1.79 +        <condition property="do.mkdist">
    1.80 +            <and>
    1.81 +                <isset property="do.archive"/>
    1.82                  <isset property="libs.CopyLibs.classpath"/>
    1.83 +                <not>
    1.84 +                    <istrue value="${mkdist.disabled}"/>
    1.85 +                </not>
    1.86 +            </and>
    1.87 +        </condition>
    1.88 +        <condition property="do.archive+manifest.available">
    1.89 +            <and>
    1.90 +                <isset property="manifest.available"/>
    1.91 +                <istrue value="${do.archive}"/>
    1.92 +            </and>
    1.93 +        </condition>
    1.94 +        <condition property="do.archive+main.class.available">
    1.95 +            <and>
    1.96 +                <isset property="main.class.available"/>
    1.97 +                <istrue value="${do.archive}"/>
    1.98 +            </and>
    1.99 +        </condition>
   1.100 +        <condition property="do.archive+splashscreen.available">
   1.101 +            <and>
   1.102 +                <isset property="splashscreen.available"/>
   1.103 +                <istrue value="${do.archive}"/>
   1.104 +            </and>
   1.105 +        </condition>
   1.106 +        <condition property="do.archive+profile.available">
   1.107 +            <and>
   1.108 +                <isset property="profile.available"/>
   1.109 +                <istrue value="${do.archive}"/>
   1.110              </and>
   1.111          </condition>
   1.112          <condition property="have.tests">
   1.113 @@ -87,6 +144,7 @@
   1.114              </and>
   1.115          </condition>
   1.116          <property name="run.jvmargs" value=""/>
   1.117 +        <property name="run.jvmargs.ide" value=""/>
   1.118          <property name="javac.compilerargs" value=""/>
   1.119          <property name="work.dir" value="${basedir}"/>
   1.120          <condition property="no.deps">
   1.121 @@ -98,6 +156,8 @@
   1.122          <property name="javadoc.preview" value="true"/>
   1.123          <property name="application.args" value=""/>
   1.124          <property name="source.encoding" value="${file.encoding}"/>
   1.125 +        <property name="runtime.encoding" value="${source.encoding}"/>
   1.126 +        <property name="manifest.encoding" value="${source.encoding}"/>
   1.127          <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
   1.128              <and>
   1.129                  <isset property="javadoc.encoding"/>
   1.130 @@ -113,12 +173,58 @@
   1.131          <condition property="do.depend.true">
   1.132              <istrue value="${do.depend}"/>
   1.133          </condition>
   1.134 -        <condition else="" property="javac.compilerargs.jaxws" value="-Djava.endorsed.dirs='${jaxws.endorsed.dir}'">
   1.135 +        <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
   1.136 +        <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
   1.137              <and>
   1.138 -                <isset property="jaxws.endorsed.dir"/>
   1.139 -                <available file="nbproject/jaxws-build.xml"/>
   1.140 +                <isset property="endorsed.classpath"/>
   1.141 +                <not>
   1.142 +                    <equals arg1="${endorsed.classpath}" arg2="" trim="true"/>
   1.143 +                </not>
   1.144              </and>
   1.145          </condition>
   1.146 +        <condition else="" property="javac.profile.cmd.line.arg" value="-profile ${javac.profile}">
   1.147 +            <isset property="profile.available"/>
   1.148 +        </condition>
   1.149 +        <condition else="false" property="jdkBug6558476">
   1.150 +            <and>
   1.151 +                <matches pattern="1\.[56]" string="${java.specification.version}"/>
   1.152 +                <not>
   1.153 +                    <os family="unix"/>
   1.154 +                </not>
   1.155 +            </and>
   1.156 +        </condition>
   1.157 +        <condition else="false" property="javac.fork">
   1.158 +            <or>
   1.159 +                <istrue value="${jdkBug6558476}"/>
   1.160 +                <istrue value="${javac.external.vm}"/>
   1.161 +            </or>
   1.162 +        </condition>
   1.163 +        <property name="jar.index" value="false"/>
   1.164 +        <property name="jar.index.metainf" value="${jar.index}"/>
   1.165 +        <property name="copylibs.rebase" value="true"/>
   1.166 +        <available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
   1.167 +        <condition property="junit.available">
   1.168 +            <or>
   1.169 +                <available classname="org.junit.Test" classpath="${run.test.classpath}"/>
   1.170 +                <available classname="junit.framework.Test" classpath="${run.test.classpath}"/>
   1.171 +            </or>
   1.172 +        </condition>
   1.173 +        <condition property="testng.available">
   1.174 +            <available classname="org.testng.annotations.Test" classpath="${run.test.classpath}"/>
   1.175 +        </condition>
   1.176 +        <condition property="junit+testng.available">
   1.177 +            <and>
   1.178 +                <istrue value="${junit.available}"/>
   1.179 +                <istrue value="${testng.available}"/>
   1.180 +            </and>
   1.181 +        </condition>
   1.182 +        <condition else="testng" property="testng.mode" value="mixed">
   1.183 +            <istrue value="${junit+testng.available}"/>
   1.184 +        </condition>
   1.185 +        <condition else="" property="testng.debug.mode" value="-mixed">
   1.186 +            <istrue value="${junit+testng.available}"/>
   1.187 +        </condition>
   1.188 +        <property name="java.failonerror" value="true"/>
   1.189      </target>
   1.190      <target name="-post-init">
   1.191          <!-- Empty placeholder for easier customization. -->
   1.192 @@ -146,26 +252,81 @@
   1.193              </sequential>
   1.194          </macrodef>
   1.195      </target>
   1.196 -    <target name="-init-macrodef-javac">
   1.197 +    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors">
   1.198          <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.199              <attribute default="${src.dir}:${reglib.src.dir}" name="srcdir"/>
   1.200              <attribute default="${build.classes.dir}" name="destdir"/>
   1.201              <attribute default="${javac.classpath}" name="classpath"/>
   1.202 +            <attribute default="${javac.processorpath}" name="processorpath"/>
   1.203 +            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
   1.204              <attribute default="${includes}" name="includes"/>
   1.205              <attribute default="${excludes}" name="excludes"/>
   1.206              <attribute default="${javac.debug}" name="debug"/>
   1.207 -            <attribute default="" name="sourcepath"/>
   1.208 +            <attribute default="${empty.dir}" name="sourcepath"/>
   1.209 +            <attribute default="${empty.dir}" name="gensrcdir"/>
   1.210              <element name="customize" optional="true"/>
   1.211              <sequential>
   1.212 -                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}">
   1.213 +                <property location="${build.dir}/empty" name="empty.dir"/>
   1.214 +                <mkdir dir="${empty.dir}"/>
   1.215 +                <mkdir dir="@{apgeneratedsrcdir}"/>
   1.216 +                <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}">
   1.217 +                    <src>
   1.218 +                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
   1.219 +                            <include name="*"/>
   1.220 +                        </dirset>
   1.221 +                    </src>
   1.222                      <classpath>
   1.223                          <path path="@{classpath}"/>
   1.224                      </classpath>
   1.225 -                    <compilerarg line="${javac.compilerargs} ${javac.compilerargs.jaxws}"/>
   1.226 +                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
   1.227 +                    <compilerarg line="${javac.profile.cmd.line.arg}"/>
   1.228 +                    <compilerarg line="${javac.compilerargs}"/>
   1.229 +                    <compilerarg value="-processorpath"/>
   1.230 +                    <compilerarg path="@{processorpath}:${empty.dir}"/>
   1.231 +                    <compilerarg line="${ap.processors.internal}"/>
   1.232 +                    <compilerarg line="${annotation.processing.processor.options}"/>
   1.233 +                    <compilerarg value="-s"/>
   1.234 +                    <compilerarg path="@{apgeneratedsrcdir}"/>
   1.235 +                    <compilerarg line="${ap.proc.none.internal}"/>
   1.236                      <customize/>
   1.237                  </javac>
   1.238              </sequential>
   1.239          </macrodef>
   1.240 +    </target>
   1.241 +    <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
   1.242 +        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.243 +            <attribute default="${src.dir}:${reglib.src.dir}" name="srcdir"/>
   1.244 +            <attribute default="${build.classes.dir}" name="destdir"/>
   1.245 +            <attribute default="${javac.classpath}" name="classpath"/>
   1.246 +            <attribute default="${javac.processorpath}" name="processorpath"/>
   1.247 +            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
   1.248 +            <attribute default="${includes}" name="includes"/>
   1.249 +            <attribute default="${excludes}" name="excludes"/>
   1.250 +            <attribute default="${javac.debug}" name="debug"/>
   1.251 +            <attribute default="${empty.dir}" name="sourcepath"/>
   1.252 +            <attribute default="${empty.dir}" name="gensrcdir"/>
   1.253 +            <element name="customize" optional="true"/>
   1.254 +            <sequential>
   1.255 +                <property location="${build.dir}/empty" name="empty.dir"/>
   1.256 +                <mkdir dir="${empty.dir}"/>
   1.257 +                <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}">
   1.258 +                    <src>
   1.259 +                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
   1.260 +                            <include name="*"/>
   1.261 +                        </dirset>
   1.262 +                    </src>
   1.263 +                    <classpath>
   1.264 +                        <path path="@{classpath}"/>
   1.265 +                    </classpath>
   1.266 +                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
   1.267 +                    <compilerarg line="${javac.profile.cmd.line.arg}"/>
   1.268 +                    <compilerarg line="${javac.compilerargs}"/>
   1.269 +                    <customize/>
   1.270 +                </javac>
   1.271 +            </sequential>
   1.272 +        </macrodef>
   1.273 +    </target>
   1.274 +    <target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
   1.275          <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.276              <attribute default="${src.dir}:${reglib.src.dir}" name="srcdir"/>
   1.277              <attribute default="${build.classes.dir}" name="destdir"/>
   1.278 @@ -182,44 +343,390 @@
   1.279              <attribute default="${build.classes.dir}" name="destdir"/>
   1.280              <sequential>
   1.281                  <fail unless="javac.includes">Must set javac.includes</fail>
   1.282 -                <pathconvert pathsep="," property="javac.includes.binary">
   1.283 +                <pathconvert pathsep="${line.separator}" property="javac.includes.binary">
   1.284                      <path>
   1.285                          <filelist dir="@{destdir}" files="${javac.includes}"/>
   1.286                      </path>
   1.287                      <globmapper from="*.java" to="*.class"/>
   1.288                  </pathconvert>
   1.289 +                <tempfile deleteonexit="true" property="javac.includesfile.binary"/>
   1.290 +                <echo file="${javac.includesfile.binary}" message="${javac.includes.binary}"/>
   1.291                  <delete>
   1.292 -                    <files includes="${javac.includes.binary}"/>
   1.293 +                    <files includesfile="${javac.includesfile.binary}"/>
   1.294 +                </delete>
   1.295 +                <delete>
   1.296 +                    <fileset file="${javac.includesfile.binary}"/>
   1.297                  </delete>
   1.298              </sequential>
   1.299          </macrodef>
   1.300      </target>
   1.301 -    <target name="-init-macrodef-junit">
   1.302 +    <target if="${junit.available}" name="-init-macrodef-junit-init">
   1.303 +        <condition else="false" property="nb.junit.batch" value="true">
   1.304 +            <and>
   1.305 +                <istrue value="${junit.available}"/>
   1.306 +                <not>
   1.307 +                    <isset property="test.method"/>
   1.308 +                </not>
   1.309 +            </and>
   1.310 +        </condition>
   1.311 +        <condition else="false" property="nb.junit.single" value="true">
   1.312 +            <and>
   1.313 +                <istrue value="${junit.available}"/>
   1.314 +                <isset property="test.method"/>
   1.315 +            </and>
   1.316 +        </condition>
   1.317 +    </target>
   1.318 +    <target name="-init-test-properties">
   1.319 +        <property name="test.binaryincludes" value="&lt;nothing&gt;"/>
   1.320 +        <property name="test.binarytestincludes" value=""/>
   1.321 +        <property name="test.binaryexcludes" value=""/>
   1.322 +    </target>
   1.323 +    <target if="${nb.junit.single}" name="-init-macrodef-junit-single" unless="${nb.junit.batch}">
   1.324          <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.325              <attribute default="${includes}" name="includes"/>
   1.326              <attribute default="${excludes}" name="excludes"/>
   1.327              <attribute default="**" name="testincludes"/>
   1.328 +            <attribute default="" name="testmethods"/>
   1.329 +            <element name="customize" optional="true"/>
   1.330              <sequential>
   1.331 -                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true">
   1.332 -                    <batchtest todir="${build.test.results.dir}">
   1.333 -                        <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
   1.334 -                            <filename name="@{testincludes}"/>
   1.335 -                        </fileset>
   1.336 -                    </batchtest>
   1.337 -                    <classpath>
   1.338 -                        <path path="${run.test.classpath}"/>
   1.339 -                    </classpath>
   1.340 +                <property name="junit.forkmode" value="perTest"/>
   1.341 +                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
   1.342 +                    <test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/>
   1.343                      <syspropertyset>
   1.344                          <propertyref prefix="test-sys-prop."/>
   1.345                          <mapper from="test-sys-prop.*" to="*" type="glob"/>
   1.346                      </syspropertyset>
   1.347                      <formatter type="brief" usefile="false"/>
   1.348                      <formatter type="xml"/>
   1.349 -                    <jvmarg line="${run.jvmargs}"/>
   1.350 +                    <jvmarg value="-ea"/>
   1.351 +                    <customize/>
   1.352                  </junit>
   1.353              </sequential>
   1.354          </macrodef>
   1.355      </target>
   1.356 +    <target depends="-init-test-properties" if="${nb.junit.batch}" name="-init-macrodef-junit-batch" unless="${nb.junit.single}">
   1.357 +        <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.358 +            <attribute default="${includes}" name="includes"/>
   1.359 +            <attribute default="${excludes}" name="excludes"/>
   1.360 +            <attribute default="**" name="testincludes"/>
   1.361 +            <attribute default="" name="testmethods"/>
   1.362 +            <element name="customize" optional="true"/>
   1.363 +            <sequential>
   1.364 +                <property name="junit.forkmode" value="perTest"/>
   1.365 +                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
   1.366 +                    <batchtest todir="${build.test.results.dir}">
   1.367 +                        <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
   1.368 +                            <filename name="@{testincludes}"/>
   1.369 +                        </fileset>
   1.370 +                        <fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}">
   1.371 +                            <filename name="${test.binarytestincludes}"/>
   1.372 +                        </fileset>
   1.373 +                    </batchtest>
   1.374 +                    <syspropertyset>
   1.375 +                        <propertyref prefix="test-sys-prop."/>
   1.376 +                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
   1.377 +                    </syspropertyset>
   1.378 +                    <formatter type="brief" usefile="false"/>
   1.379 +                    <formatter type="xml"/>
   1.380 +                    <jvmarg value="-ea"/>
   1.381 +                    <customize/>
   1.382 +                </junit>
   1.383 +            </sequential>
   1.384 +        </macrodef>
   1.385 +    </target>
   1.386 +    <target depends="-init-macrodef-junit-init,-init-macrodef-junit-single, -init-macrodef-junit-batch" if="${junit.available}" name="-init-macrodef-junit"/>
   1.387 +    <target if="${testng.available}" name="-init-macrodef-testng">
   1.388 +        <macrodef name="testng" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.389 +            <attribute default="${includes}" name="includes"/>
   1.390 +            <attribute default="${excludes}" name="excludes"/>
   1.391 +            <attribute default="**" name="testincludes"/>
   1.392 +            <attribute default="" name="testmethods"/>
   1.393 +            <element name="customize" optional="true"/>
   1.394 +            <sequential>
   1.395 +                <condition else="" property="testng.methods.arg" value="@{testincludes}.@{testmethods}">
   1.396 +                    <isset property="test.method"/>
   1.397 +                </condition>
   1.398 +                <union id="test.set">
   1.399 +                    <fileset dir="${test.src.dir}" excludes="@{excludes},**/*.xml,${excludes}" includes="@{includes}">
   1.400 +                        <filename name="@{testincludes}"/>
   1.401 +                    </fileset>
   1.402 +                </union>
   1.403 +                <taskdef classname="org.testng.TestNGAntTask" classpath="${run.test.classpath}" name="testng"/>
   1.404 +                <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="Sun_Studio_Installer_Engine" testname="TestNG tests" workingDir="${work.dir}">
   1.405 +                    <xmlfileset dir="${build.test.classes.dir}" includes="@{testincludes}"/>
   1.406 +                    <propertyset>
   1.407 +                        <propertyref prefix="test-sys-prop."/>
   1.408 +                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
   1.409 +                    </propertyset>
   1.410 +                    <customize/>
   1.411 +                </testng>
   1.412 +            </sequential>
   1.413 +        </macrodef>
   1.414 +    </target>
   1.415 +    <target name="-init-macrodef-test-impl">
   1.416 +        <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.417 +            <attribute default="${includes}" name="includes"/>
   1.418 +            <attribute default="${excludes}" name="excludes"/>
   1.419 +            <attribute default="**" name="testincludes"/>
   1.420 +            <attribute default="" name="testmethods"/>
   1.421 +            <element implicit="true" name="customize" optional="true"/>
   1.422 +            <sequential>
   1.423 +                <echo>No tests executed.</echo>
   1.424 +            </sequential>
   1.425 +        </macrodef>
   1.426 +    </target>
   1.427 +    <target depends="-init-macrodef-junit" if="${junit.available}" name="-init-macrodef-junit-impl">
   1.428 +        <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.429 +            <attribute default="${includes}" name="includes"/>
   1.430 +            <attribute default="${excludes}" name="excludes"/>
   1.431 +            <attribute default="**" name="testincludes"/>
   1.432 +            <attribute default="" name="testmethods"/>
   1.433 +            <element implicit="true" name="customize" optional="true"/>
   1.434 +            <sequential>
   1.435 +                <j2seproject3:junit excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
   1.436 +                    <customize/>
   1.437 +                </j2seproject3:junit>
   1.438 +            </sequential>
   1.439 +        </macrodef>
   1.440 +    </target>
   1.441 +    <target depends="-init-macrodef-testng" if="${testng.available}" name="-init-macrodef-testng-impl">
   1.442 +        <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.443 +            <attribute default="${includes}" name="includes"/>
   1.444 +            <attribute default="${excludes}" name="excludes"/>
   1.445 +            <attribute default="**" name="testincludes"/>
   1.446 +            <attribute default="" name="testmethods"/>
   1.447 +            <element implicit="true" name="customize" optional="true"/>
   1.448 +            <sequential>
   1.449 +                <j2seproject3:testng excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
   1.450 +                    <customize/>
   1.451 +                </j2seproject3:testng>
   1.452 +            </sequential>
   1.453 +        </macrodef>
   1.454 +    </target>
   1.455 +    <target depends="-init-macrodef-test-impl,-init-macrodef-junit-impl,-init-macrodef-testng-impl" name="-init-macrodef-test">
   1.456 +        <macrodef name="test" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.457 +            <attribute default="${includes}" name="includes"/>
   1.458 +            <attribute default="${excludes}" name="excludes"/>
   1.459 +            <attribute default="**" name="testincludes"/>
   1.460 +            <attribute default="" name="testmethods"/>
   1.461 +            <sequential>
   1.462 +                <j2seproject3:test-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
   1.463 +                    <customize>
   1.464 +                        <classpath>
   1.465 +                            <path path="${run.test.classpath}"/>
   1.466 +                        </classpath>
   1.467 +                        <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   1.468 +                        <jvmarg line="${run.jvmargs}"/>
   1.469 +                        <jvmarg line="${run.jvmargs.ide}"/>
   1.470 +                    </customize>
   1.471 +                </j2seproject3:test-impl>
   1.472 +            </sequential>
   1.473 +        </macrodef>
   1.474 +    </target>
   1.475 +    <target if="${junit.available}" name="-init-macrodef-junit-debug" unless="${nb.junit.batch}">
   1.476 +        <macrodef name="junit-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.477 +            <attribute default="${includes}" name="includes"/>
   1.478 +            <attribute default="${excludes}" name="excludes"/>
   1.479 +            <attribute default="**" name="testincludes"/>
   1.480 +            <attribute default="" name="testmethods"/>
   1.481 +            <element name="customize" optional="true"/>
   1.482 +            <sequential>
   1.483 +                <property name="junit.forkmode" value="perTest"/>
   1.484 +                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
   1.485 +                    <test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/>
   1.486 +                    <syspropertyset>
   1.487 +                        <propertyref prefix="test-sys-prop."/>
   1.488 +                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
   1.489 +                    </syspropertyset>
   1.490 +                    <formatter type="brief" usefile="false"/>
   1.491 +                    <formatter type="xml"/>
   1.492 +                    <jvmarg value="-ea"/>
   1.493 +                    <jvmarg line="${debug-args-line}"/>
   1.494 +                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
   1.495 +                    <customize/>
   1.496 +                </junit>
   1.497 +            </sequential>
   1.498 +        </macrodef>
   1.499 +    </target>
   1.500 +    <target depends="-init-test-properties" if="${nb.junit.batch}" name="-init-macrodef-junit-debug-batch">
   1.501 +        <macrodef name="junit-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.502 +            <attribute default="${includes}" name="includes"/>
   1.503 +            <attribute default="${excludes}" name="excludes"/>
   1.504 +            <attribute default="**" name="testincludes"/>
   1.505 +            <attribute default="" name="testmethods"/>
   1.506 +            <element name="customize" optional="true"/>
   1.507 +            <sequential>
   1.508 +                <property name="junit.forkmode" value="perTest"/>
   1.509 +                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
   1.510 +                    <batchtest todir="${build.test.results.dir}">
   1.511 +                        <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
   1.512 +                            <filename name="@{testincludes}"/>
   1.513 +                        </fileset>
   1.514 +                        <fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}">
   1.515 +                            <filename name="${test.binarytestincludes}"/>
   1.516 +                        </fileset>
   1.517 +                    </batchtest>
   1.518 +                    <syspropertyset>
   1.519 +                        <propertyref prefix="test-sys-prop."/>
   1.520 +                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
   1.521 +                    </syspropertyset>
   1.522 +                    <formatter type="brief" usefile="false"/>
   1.523 +                    <formatter type="xml"/>
   1.524 +                    <jvmarg value="-ea"/>
   1.525 +                    <jvmarg line="${debug-args-line}"/>
   1.526 +                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
   1.527 +                    <customize/>
   1.528 +                </junit>
   1.529 +            </sequential>
   1.530 +        </macrodef>
   1.531 +    </target>
   1.532 +    <target depends="-init-macrodef-junit-debug,-init-macrodef-junit-debug-batch" if="${junit.available}" name="-init-macrodef-junit-debug-impl">
   1.533 +        <macrodef name="test-debug-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.534 +            <attribute default="${includes}" name="includes"/>
   1.535 +            <attribute default="${excludes}" name="excludes"/>
   1.536 +            <attribute default="**" name="testincludes"/>
   1.537 +            <attribute default="" name="testmethods"/>
   1.538 +            <element implicit="true" name="customize" optional="true"/>
   1.539 +            <sequential>
   1.540 +                <j2seproject3:junit-debug excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
   1.541 +                    <customize/>
   1.542 +                </j2seproject3:junit-debug>
   1.543 +            </sequential>
   1.544 +        </macrodef>
   1.545 +    </target>
   1.546 +    <target if="${testng.available}" name="-init-macrodef-testng-debug">
   1.547 +        <macrodef name="testng-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.548 +            <attribute default="${main.class}" name="testClass"/>
   1.549 +            <attribute default="" name="testMethod"/>
   1.550 +            <element name="customize2" optional="true"/>
   1.551 +            <sequential>
   1.552 +                <condition else="-testclass @{testClass}" property="test.class.or.method" value="-methods @{testClass}.@{testMethod}">
   1.553 +                    <isset property="test.method"/>
   1.554 +                </condition>
   1.555 +                <condition else="-suitename Sun_Studio_Installer_Engine -testname @{testClass} ${test.class.or.method}" property="testng.cmd.args" value="@{testClass}">
   1.556 +                    <matches pattern=".*\.xml" string="@{testClass}"/>
   1.557 +                </condition>
   1.558 +                <delete dir="${build.test.results.dir}" quiet="true"/>
   1.559 +                <mkdir dir="${build.test.results.dir}"/>
   1.560 +                <j2seproject3:debug classname="org.testng.TestNG" classpath="${debug.test.classpath}">
   1.561 +                    <customize>
   1.562 +                        <customize2/>
   1.563 +                        <jvmarg value="-ea"/>
   1.564 +                        <arg line="${testng.debug.mode}"/>
   1.565 +                        <arg line="-d ${build.test.results.dir}"/>
   1.566 +                        <arg line="-listener org.testng.reporters.VerboseReporter"/>
   1.567 +                        <arg line="${testng.cmd.args}"/>
   1.568 +                    </customize>
   1.569 +                </j2seproject3:debug>
   1.570 +            </sequential>
   1.571 +        </macrodef>
   1.572 +    </target>
   1.573 +    <target depends="-init-macrodef-testng-debug" if="${testng.available}" name="-init-macrodef-testng-debug-impl">
   1.574 +        <macrodef name="testng-debug-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.575 +            <attribute default="${main.class}" name="testClass"/>
   1.576 +            <attribute default="" name="testMethod"/>
   1.577 +            <element implicit="true" name="customize2" optional="true"/>
   1.578 +            <sequential>
   1.579 +                <j2seproject3:testng-debug testClass="@{testClass}" testMethod="@{testMethod}">
   1.580 +                    <customize2/>
   1.581 +                </j2seproject3:testng-debug>
   1.582 +            </sequential>
   1.583 +        </macrodef>
   1.584 +    </target>
   1.585 +    <target depends="-init-macrodef-junit-debug-impl" if="${junit.available}" name="-init-macrodef-test-debug-junit">
   1.586 +        <macrodef name="test-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.587 +            <attribute default="${includes}" name="includes"/>
   1.588 +            <attribute default="${excludes}" name="excludes"/>
   1.589 +            <attribute default="**" name="testincludes"/>
   1.590 +            <attribute default="" name="testmethods"/>
   1.591 +            <attribute default="${main.class}" name="testClass"/>
   1.592 +            <attribute default="" name="testMethod"/>
   1.593 +            <sequential>
   1.594 +                <j2seproject3:test-debug-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
   1.595 +                    <customize>
   1.596 +                        <classpath>
   1.597 +                            <path path="${run.test.classpath}"/>
   1.598 +                        </classpath>
   1.599 +                        <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   1.600 +                        <jvmarg line="${run.jvmargs}"/>
   1.601 +                        <jvmarg line="${run.jvmargs.ide}"/>
   1.602 +                    </customize>
   1.603 +                </j2seproject3:test-debug-impl>
   1.604 +            </sequential>
   1.605 +        </macrodef>
   1.606 +    </target>
   1.607 +    <target depends="-init-macrodef-testng-debug-impl" if="${testng.available}" name="-init-macrodef-test-debug-testng">
   1.608 +        <macrodef name="test-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.609 +            <attribute default="${includes}" name="includes"/>
   1.610 +            <attribute default="${excludes}" name="excludes"/>
   1.611 +            <attribute default="**" name="testincludes"/>
   1.612 +            <attribute default="" name="testmethods"/>
   1.613 +            <attribute default="${main.class}" name="testClass"/>
   1.614 +            <attribute default="" name="testMethod"/>
   1.615 +            <sequential>
   1.616 +                <j2seproject3:testng-debug-impl testClass="@{testClass}" testMethod="@{testMethod}">
   1.617 +                    <customize2>
   1.618 +                        <syspropertyset>
   1.619 +                            <propertyref prefix="test-sys-prop."/>
   1.620 +                            <mapper from="test-sys-prop.*" to="*" type="glob"/>
   1.621 +                        </syspropertyset>
   1.622 +                    </customize2>
   1.623 +                </j2seproject3:testng-debug-impl>
   1.624 +            </sequential>
   1.625 +        </macrodef>
   1.626 +    </target>
   1.627 +    <target depends="-init-macrodef-test-debug-junit,-init-macrodef-test-debug-testng" name="-init-macrodef-test-debug"/>
   1.628 +    <!--
   1.629 +                pre NB7.2 profiling section; consider it deprecated
   1.630 +            -->
   1.631 +    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check" if="profiler.info.jvmargs.agent" name="profile-init"/>
   1.632 +    <target if="profiler.info.jvmargs.agent" name="-profile-pre-init">
   1.633 +        <!-- Empty placeholder for easier customization. -->
   1.634 +        <!-- You can override this target in the ../build.xml file. -->
   1.635 +    </target>
   1.636 +    <target if="profiler.info.jvmargs.agent" name="-profile-post-init">
   1.637 +        <!-- Empty placeholder for easier customization. -->
   1.638 +        <!-- You can override this target in the ../build.xml file. -->
   1.639 +    </target>
   1.640 +    <target if="profiler.info.jvmargs.agent" name="-profile-init-macrodef-profile">
   1.641 +        <macrodef name="resolve">
   1.642 +            <attribute name="name"/>
   1.643 +            <attribute name="value"/>
   1.644 +            <sequential>
   1.645 +                <property name="@{name}" value="${env.@{value}}"/>
   1.646 +            </sequential>
   1.647 +        </macrodef>
   1.648 +        <macrodef name="profile">
   1.649 +            <attribute default="${main.class}" name="classname"/>
   1.650 +            <element name="customize" optional="true"/>
   1.651 +            <sequential>
   1.652 +                <property environment="env"/>
   1.653 +                <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
   1.654 +                <java classname="@{classname}" dir="${profiler.info.dir}" failonerror="${java.failonerror}" fork="true" jvm="${profiler.info.jvm}">
   1.655 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   1.656 +                    <jvmarg value="${profiler.info.jvmargs.agent}"/>
   1.657 +                    <jvmarg line="${profiler.info.jvmargs}"/>
   1.658 +                    <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
   1.659 +                    <arg line="${application.args}"/>
   1.660 +                    <classpath>
   1.661 +                        <path path="${run.classpath}"/>
   1.662 +                    </classpath>
   1.663 +                    <syspropertyset>
   1.664 +                        <propertyref prefix="run-sys-prop."/>
   1.665 +                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
   1.666 +                    </syspropertyset>
   1.667 +                    <customize/>
   1.668 +                </java>
   1.669 +            </sequential>
   1.670 +        </macrodef>
   1.671 +    </target>
   1.672 +    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile" if="profiler.info.jvmargs.agent" name="-profile-init-check">
   1.673 +        <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail>
   1.674 +        <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
   1.675 +    </target>
   1.676 +    <!--
   1.677 +                end of pre NB7.2 profiling section
   1.678 +            -->
   1.679      <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
   1.680          <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
   1.681              <attribute default="${main.class}" name="name"/>
   1.682 @@ -270,10 +777,14 @@
   1.683              <attribute default="${debug.classpath}" name="classpath"/>
   1.684              <element name="customize" optional="true"/>
   1.685              <sequential>
   1.686 -                <java classname="@{classname}" dir="${work.dir}" fork="true">
   1.687 +                <java classname="@{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true">
   1.688 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   1.689                      <jvmarg line="${debug-args-line}"/>
   1.690                      <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
   1.691 +                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
   1.692 +                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
   1.693                      <jvmarg line="${run.jvmargs}"/>
   1.694 +                    <jvmarg line="${run.jvmargs.ide}"/>
   1.695                      <classpath>
   1.696                          <path path="@{classpath}"/>
   1.697                      </classpath>
   1.698 @@ -289,12 +800,18 @@
   1.699      <target name="-init-macrodef-java">
   1.700          <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
   1.701              <attribute default="${main.class}" name="classname"/>
   1.702 +            <attribute default="${run.classpath}" name="classpath"/>
   1.703 +            <attribute default="jvm" name="jvm"/>
   1.704              <element name="customize" optional="true"/>
   1.705              <sequential>
   1.706 -                <java classname="@{classname}" dir="${work.dir}" fork="true">
   1.707 +                <java classname="@{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true">
   1.708 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   1.709 +                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
   1.710 +                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
   1.711                      <jvmarg line="${run.jvmargs}"/>
   1.712 +                    <jvmarg line="${run.jvmargs.ide}"/>
   1.713                      <classpath>
   1.714 -                        <path path="${run.classpath}"/>
   1.715 +                        <path path="@{classpath}"/>
   1.716                      </classpath>
   1.717                      <syspropertyset>
   1.718                          <propertyref prefix="run-sys-prop."/>
   1.719 @@ -305,22 +822,105 @@
   1.720              </sequential>
   1.721          </macrodef>
   1.722      </target>
   1.723 +    <target name="-init-macrodef-copylibs">
   1.724 +        <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.725 +            <attribute default="${manifest.file}" name="manifest"/>
   1.726 +            <element name="customize" optional="true"/>
   1.727 +            <sequential>
   1.728 +                <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
   1.729 +                <pathconvert property="run.classpath.without.build.classes.dir">
   1.730 +                    <path path="${run.classpath}"/>
   1.731 +                    <map from="${build.classes.dir.resolved}" to=""/>
   1.732 +                </pathconvert>
   1.733 +                <pathconvert pathsep=" " property="jar.classpath">
   1.734 +                    <path path="${run.classpath.without.build.classes.dir}"/>
   1.735 +                    <chainedmapper>
   1.736 +                        <flattenmapper/>
   1.737 +                        <filtermapper>
   1.738 +                            <replacestring from=" " to="%20"/>
   1.739 +                        </filtermapper>
   1.740 +                        <globmapper from="*" to="lib/*"/>
   1.741 +                    </chainedmapper>
   1.742 +                </pathconvert>
   1.743 +                <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
   1.744 +                <copylibs compress="${jar.compress}" excludeFromCopy="${copylibs.excludes}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" manifestencoding="UTF-8" rebase="${copylibs.rebase}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
   1.745 +                    <fileset dir="${build.classes.dir}" excludes="${dist.archive.excludes}"/>
   1.746 +                    <manifest>
   1.747 +                        <attribute name="Class-Path" value="${jar.classpath}"/>
   1.748 +                        <customize/>
   1.749 +                    </manifest>
   1.750 +                </copylibs>
   1.751 +            </sequential>
   1.752 +        </macrodef>
   1.753 +    </target>
   1.754      <target name="-init-presetdef-jar">
   1.755          <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
   1.756 -            <jar compress="${jar.compress}" jarfile="${dist.jar}">
   1.757 -                <j2seproject1:fileset dir="${build.classes.dir}"/>
   1.758 +            <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}" manifestencoding="UTF-8">
   1.759 +                <j2seproject1:fileset dir="${build.classes.dir}" excludes="${dist.archive.excludes}"/>
   1.760              </jar>
   1.761          </presetdef>
   1.762      </target>
   1.763 -    <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-junit,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar" name="init"/>
   1.764 +    <target name="-init-ap-cmdline-properties">
   1.765 +        <property name="annotation.processing.enabled" value="true"/>
   1.766 +        <property name="annotation.processing.processors.list" value=""/>
   1.767 +        <property name="annotation.processing.processor.options" value=""/>
   1.768 +        <property name="annotation.processing.run.all.processors" value="true"/>
   1.769 +        <property name="javac.processorpath" value="${javac.classpath}"/>
   1.770 +        <property name="javac.test.processorpath" value="${javac.test.classpath}"/>
   1.771 +        <condition property="ap.supported.internal" value="true">
   1.772 +            <not>
   1.773 +                <matches pattern="1\.[0-5](\..*)?" string="${javac.source}"/>
   1.774 +            </not>
   1.775 +        </condition>
   1.776 +    </target>
   1.777 +    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-ap-cmdline-supported">
   1.778 +        <condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}">
   1.779 +            <isfalse value="${annotation.processing.run.all.processors}"/>
   1.780 +        </condition>
   1.781 +        <condition else="" property="ap.proc.none.internal" value="-proc:none">
   1.782 +            <isfalse value="${annotation.processing.enabled}"/>
   1.783 +        </condition>
   1.784 +    </target>
   1.785 +    <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline">
   1.786 +        <property name="ap.cmd.line.internal" value=""/>
   1.787 +    </target>
   1.788 +    <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-test,-init-macrodef-test-debug,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar,-init-ap-cmdline" name="init"/>
   1.789      <!--
   1.790                  ===================
   1.791                  COMPILATION SECTION
   1.792                  ===================
   1.793              -->
   1.794 -    <target depends="init" name="deps-jar" unless="no.deps">
   1.795 -        <ant antfile="${project.NBI_Engine}/build.xml" inheritall="false" target="jar"/>
   1.796 -        <ant antfile="${project.org_netbeans_modules_reglib}/build.xml" inheritall="false" target="netbeans"/>
   1.797 +    <target name="-deps-jar-init" unless="built-jar.properties">
   1.798 +        <property location="${build.dir}/built-jar.properties" name="built-jar.properties"/>
   1.799 +        <delete file="${built-jar.properties}" quiet="true"/>
   1.800 +    </target>
   1.801 +    <target if="already.built.jar.${basedir}" name="-warn-already-built-jar">
   1.802 +        <echo level="warn" message="Cycle detected: Sun Studio Installer Engine was already built"/>
   1.803 +    </target>
   1.804 +    <target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps">
   1.805 +        <mkdir dir="${build.dir}"/>
   1.806 +        <touch file="${built-jar.properties}" verbose="false"/>
   1.807 +        <property file="${built-jar.properties}" prefix="already.built.jar."/>
   1.808 +        <antcall target="-warn-already-built-jar"/>
   1.809 +        <propertyfile file="${built-jar.properties}">
   1.810 +            <entry key="${basedir}" value=""/>
   1.811 +        </propertyfile>
   1.812 +        <antcall target="-maybe-call-dep">
   1.813 +            <param name="call.built.properties" value="${built-jar.properties}"/>
   1.814 +            <param location="${project.NBI_Engine}" name="call.subproject"/>
   1.815 +            <param location="${project.NBI_Engine}/build.xml" name="call.script"/>
   1.816 +            <param name="call.target" value="jar"/>
   1.817 +            <param name="transfer.built-jar.properties" value="${built-jar.properties}"/>
   1.818 +            <param name="transfer.not.archive.disabled" value="true"/>
   1.819 +        </antcall>
   1.820 +        <antcall target="-maybe-call-dep">
   1.821 +            <param name="call.built.properties" value="${built-jar.properties}"/>
   1.822 +            <param location="${project.org_netbeans_modules_reglib}" name="call.subproject"/>
   1.823 +            <param location="${project.org_netbeans_modules_reglib}/build.xml" name="call.script"/>
   1.824 +            <param name="call.target" value="netbeans"/>
   1.825 +            <param name="transfer.built-jar.properties" value="${built-jar.properties}"/>
   1.826 +            <param name="transfer.not.archive.disabled" value="true"/>
   1.827 +        </antcall>
   1.828      </target>
   1.829      <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
   1.830      <target depends="init" name="-check-automatic-build">
   1.831 @@ -337,15 +937,26 @@
   1.832          <!-- You can override this target in the ../build.xml file. -->
   1.833      </target>
   1.834      <target if="do.depend.true" name="-compile-depend">
   1.835 -        <j2seproject3:depend/>
   1.836 +        <pathconvert property="build.generated.subdirs">
   1.837 +            <dirset dir="${build.generated.sources.dir}" erroronmissingdir="false">
   1.838 +                <include name="*"/>
   1.839 +            </dirset>
   1.840 +        </pathconvert>
   1.841 +        <j2seproject3:depend srcdir="${src.dir}:${reglib.src.dir}:${build.generated.subdirs}"/>
   1.842      </target>
   1.843 -    <target depends="init,deps-jar,-pre-pre-compile,-pre-compile,-compile-depend" if="have.sources" name="-do-compile">
   1.844 -        <j2seproject3:javac/>
   1.845 +    <target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile">
   1.846 +        <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
   1.847          <copy todir="${build.classes.dir}">
   1.848              <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
   1.849              <fileset dir="${reglib.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
   1.850          </copy>
   1.851      </target>
   1.852 +    <target if="has.persistence.xml" name="-copy-persistence-xml">
   1.853 +        <mkdir dir="${build.classes.dir}/META-INF"/>
   1.854 +        <copy todir="${build.classes.dir}/META-INF">
   1.855 +            <fileset dir="${meta.inf.dir}" includes="persistence.xml orm.xml"/>
   1.856 +        </copy>
   1.857 +    </target>
   1.858      <target name="-post-compile">
   1.859          <!-- Empty placeholder for easier customization. -->
   1.860          <!-- You can override this target in the ../build.xml file. -->
   1.861 @@ -358,13 +969,13 @@
   1.862      <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
   1.863          <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
   1.864          <j2seproject3:force-recompile/>
   1.865 -        <j2seproject3:javac excludes="" includes="${javac.includes}" sourcepath="${src.dir}:${reglib.src.dir}"/>
   1.866 +        <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.dir}:${reglib.src.dir}"/>
   1.867      </target>
   1.868      <target name="-post-compile-single">
   1.869          <!-- Empty placeholder for easier customization. -->
   1.870          <!-- You can override this target in the ../build.xml file. -->
   1.871      </target>
   1.872 -    <target depends="init,deps-jar,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
   1.873 +    <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
   1.874      <!--
   1.875                  ====================
   1.876                  JAR BUILDING SECTION
   1.877 @@ -378,57 +989,67 @@
   1.878          <!-- Empty placeholder for easier customization. -->
   1.879          <!-- You can override this target in the ../build.xml file. -->
   1.880      </target>
   1.881 -    <target depends="init,compile,-pre-pre-jar,-pre-jar" name="-do-jar-without-manifest" unless="manifest.available">
   1.882 -        <j2seproject1:jar/>
   1.883 +    <target depends="init" if="do.archive" name="-do-jar-create-manifest" unless="manifest.available">
   1.884 +        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
   1.885 +        <touch file="${tmp.manifest.file}" verbose="false"/>
   1.886      </target>
   1.887 -    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class">
   1.888 -        <j2seproject1:jar manifest="${manifest.file}"/>
   1.889 +    <target depends="init" if="do.archive+manifest.available" name="-do-jar-copy-manifest">
   1.890 +        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
   1.891 +        <copy encoding="${manifest.encoding}" file="${manifest.file}" outputencoding="UTF-8" tofile="${tmp.manifest.file}"/>
   1.892      </target>
   1.893 -    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class" name="-do-jar-with-mainclass" unless="manifest.available+main.class+mkdist.available">
   1.894 -        <j2seproject1:jar manifest="${manifest.file}">
   1.895 -            <j2seproject1:manifest>
   1.896 -                <j2seproject1:attribute name="Main-Class" value="${main.class}"/>
   1.897 -            </j2seproject1:manifest>
   1.898 -        </j2seproject1:jar>
   1.899 -        <echo>To run this application from the command line without Ant, try:</echo>
   1.900 +    <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+main.class.available" name="-do-jar-set-mainclass">
   1.901 +        <manifest encoding="UTF-8" file="${tmp.manifest.file}" mode="update">
   1.902 +            <attribute name="Main-Class" value="${main.class}"/>
   1.903 +        </manifest>
   1.904 +    </target>
   1.905 +    <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+profile.available" name="-do-jar-set-profile">
   1.906 +        <manifest encoding="UTF-8" file="${tmp.manifest.file}" mode="update">
   1.907 +            <attribute name="Profile" value="${javac.profile}"/>
   1.908 +        </manifest>
   1.909 +    </target>
   1.910 +    <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+splashscreen.available" name="-do-jar-set-splashscreen">
   1.911 +        <basename file="${application.splash}" property="splashscreen.basename"/>
   1.912 +        <mkdir dir="${build.classes.dir}/META-INF"/>
   1.913 +        <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
   1.914 +        <manifest encoding="UTF-8" file="${tmp.manifest.file}" mode="update">
   1.915 +            <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
   1.916 +        </manifest>
   1.917 +    </target>
   1.918 +    <target depends="init,-init-macrodef-copylibs,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.mkdist" name="-do-jar-copylibs">
   1.919 +        <j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
   1.920 +        <echo level="info">To run this application from the command line without Ant, try:</echo>
   1.921 +        <property location="${dist.jar}" name="dist.jar.resolved"/>
   1.922 +        <echo level="info">java -jar "${dist.jar.resolved}"</echo>
   1.923 +    </target>
   1.924 +    <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">
   1.925 +        <j2seproject1:jar manifest="${tmp.manifest.file}"/>
   1.926          <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
   1.927          <property location="${dist.jar}" name="dist.jar.resolved"/>
   1.928          <pathconvert property="run.classpath.with.dist.jar">
   1.929              <path path="${run.classpath}"/>
   1.930              <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
   1.931          </pathconvert>
   1.932 -        <echo>java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
   1.933 +        <condition else="" property="jar.usage.message" value="To run this application from the command line without Ant, try:${line.separator}${platform.java} -cp ${run.classpath.with.dist.jar} ${main.class}">
   1.934 +            <isset property="main.class.available"/>
   1.935 +        </condition>
   1.936 +        <condition else="debug" property="jar.usage.level" value="info">
   1.937 +            <isset property="main.class.available"/>
   1.938 +        </condition>
   1.939 +        <echo level="${jar.usage.level}" message="${jar.usage.message}"/>
   1.940      </target>
   1.941 -    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class+mkdist.available" name="-do-jar-with-libraries">
   1.942 -        <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
   1.943 -        <pathconvert property="run.classpath.without.build.classes.dir">
   1.944 -            <path path="${run.classpath}"/>
   1.945 -            <map from="${build.classes.dir.resolved}" to=""/>
   1.946 -        </pathconvert>
   1.947 -        <pathconvert pathsep=" " property="jar.classpath">
   1.948 -            <path path="${run.classpath.without.build.classes.dir}"/>
   1.949 -            <chainedmapper>
   1.950 -                <flattenmapper/>
   1.951 -                <globmapper from="*" to="lib/*"/>
   1.952 -            </chainedmapper>
   1.953 -        </pathconvert>
   1.954 -        <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
   1.955 -        <copylibs compress="${jar.compress}" jarfile="${dist.jar}" manifest="${manifest.file}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
   1.956 -            <fileset dir="${build.classes.dir}"/>
   1.957 -            <manifest>
   1.958 -                <attribute name="Main-Class" value="${main.class}"/>
   1.959 -                <attribute name="Class-Path" value="${jar.classpath}"/>
   1.960 -            </manifest>
   1.961 -        </copylibs>
   1.962 -        <echo>To run this application from the command line without Ant, try:</echo>
   1.963 -        <property location="${dist.jar}" name="dist.jar.resolved"/>
   1.964 -        <echo>java -jar "${dist.jar.resolved}"</echo>
   1.965 +    <target depends="-do-jar-copylibs" if="do.archive" name="-do-jar-delete-manifest">
   1.966 +        <delete>
   1.967 +            <fileset file="${tmp.manifest.file}"/>
   1.968 +        </delete>
   1.969      </target>
   1.970 +    <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,-do-jar-jar,-do-jar-delete-manifest" name="-do-jar-without-libraries"/>
   1.971 +    <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,-do-jar-copylibs,-do-jar-delete-manifest" name="-do-jar-with-libraries"/>
   1.972      <target name="-post-jar">
   1.973          <!-- Empty placeholder for easier customization. -->
   1.974          <!-- You can override this target in the ../build.xml file. -->
   1.975      </target>
   1.976 -    <target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-post-jar" description="Build JAR." name="jar"/>
   1.977 +    <target depends="init,compile,-pre-jar,-do-jar-without-libraries,-do-jar-with-libraries,-post-jar" name="-do-jar"/>
   1.978 +    <target depends="init,compile,-pre-jar,-do-jar,-post-jar" description="Build JAR." name="jar"/>
   1.979      <!--
   1.980                  =================
   1.981                  EXECUTION SECTION
   1.982 @@ -444,10 +1065,14 @@
   1.983      <target name="-do-not-recompile">
   1.984          <property name="javac.includes.binary" value=""/>
   1.985      </target>
   1.986 -    <target depends="init,-do-not-recompile,compile-single" name="run-single">
   1.987 +    <target depends="init,compile-single" name="run-single">
   1.988          <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
   1.989          <j2seproject1:java classname="${run.class}"/>
   1.990      </target>
   1.991 +    <target depends="init,compile-test-single" name="run-test-with-main">
   1.992 +        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
   1.993 +        <j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
   1.994 +    </target>
   1.995      <!--
   1.996                  =================
   1.997                  DEBUGGING SECTION
   1.998 @@ -456,6 +1081,9 @@
   1.999      <target depends="init" if="netbeans.home" name="-debug-start-debugger">
  1.1000          <j2seproject1:nbjpdastart name="${debug.class}"/>
  1.1001      </target>
  1.1002 +    <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">
  1.1003 +        <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/>
  1.1004 +    </target>
  1.1005      <target depends="init,compile" name="-debug-start-debuggee">
  1.1006          <j2seproject3:debug>
  1.1007              <customize>
  1.1008 @@ -472,7 +1100,12 @@
  1.1009          <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
  1.1010          <j2seproject3:debug classname="${debug.class}"/>
  1.1011      </target>
  1.1012 -    <target depends="init,-do-not-recompile,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
  1.1013 +    <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
  1.1014 +    <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
  1.1015 +        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
  1.1016 +        <j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
  1.1017 +    </target>
  1.1018 +    <target depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/>
  1.1019      <target depends="init" name="-pre-debug-fix">
  1.1020          <fail unless="fix.includes">Must set fix.includes</fail>
  1.1021          <property name="javac.includes" value="${fix.includes}.java"/>
  1.1022 @@ -482,23 +1115,149 @@
  1.1023      </target>
  1.1024      <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
  1.1025      <!--
  1.1026 +                =================
  1.1027 +                PROFILING SECTION
  1.1028 +                =================
  1.1029 +            -->
  1.1030 +    <!--
  1.1031 +                pre NB7.2 profiler integration
  1.1032 +            -->
  1.1033 +    <target depends="profile-init,compile" description="Profile a project in the IDE." if="profiler.info.jvmargs.agent" name="-profile-pre72">
  1.1034 +        <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
  1.1035 +        <nbprofiledirect>
  1.1036 +            <classpath>
  1.1037 +                <path path="${run.classpath}"/>
  1.1038 +            </classpath>
  1.1039 +        </nbprofiledirect>
  1.1040 +        <profile/>
  1.1041 +    </target>
  1.1042 +    <target depends="profile-init,compile-single" description="Profile a selected class in the IDE." if="profiler.info.jvmargs.agent" name="-profile-single-pre72">
  1.1043 +        <fail unless="profile.class">Must select one file in the IDE or set profile.class</fail>
  1.1044 +        <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
  1.1045 +        <nbprofiledirect>
  1.1046 +            <classpath>
  1.1047 +                <path path="${run.classpath}"/>
  1.1048 +            </classpath>
  1.1049 +        </nbprofiledirect>
  1.1050 +        <profile classname="${profile.class}"/>
  1.1051 +    </target>
  1.1052 +    <target depends="profile-init,compile-single" if="profiler.info.jvmargs.agent" name="-profile-applet-pre72">
  1.1053 +        <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
  1.1054 +        <nbprofiledirect>
  1.1055 +            <classpath>
  1.1056 +                <path path="${run.classpath}"/>
  1.1057 +            </classpath>
  1.1058 +        </nbprofiledirect>
  1.1059 +        <profile classname="sun.applet.AppletViewer">
  1.1060 +            <customize>
  1.1061 +                <arg value="${applet.url}"/>
  1.1062 +            </customize>
  1.1063 +        </profile>
  1.1064 +    </target>
  1.1065 +    <target depends="profile-init,compile-test-single" if="profiler.info.jvmargs.agent" name="-profile-test-single-pre72">
  1.1066 +        <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
  1.1067 +        <nbprofiledirect>
  1.1068 +            <classpath>
  1.1069 +                <path path="${run.test.classpath}"/>
  1.1070 +            </classpath>
  1.1071 +        </nbprofiledirect>
  1.1072 +        <junit dir="${profiler.info.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" jvm="${profiler.info.jvm}" showoutput="true">
  1.1073 +            <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
  1.1074 +            <jvmarg value="${profiler.info.jvmargs.agent}"/>
  1.1075 +            <jvmarg line="${profiler.info.jvmargs}"/>
  1.1076 +            <test name="${profile.class}"/>
  1.1077 +            <classpath>
  1.1078 +                <path path="${run.test.classpath}"/>
  1.1079 +            </classpath>
  1.1080 +            <syspropertyset>
  1.1081 +                <propertyref prefix="test-sys-prop."/>
  1.1082 +                <mapper from="test-sys-prop.*" to="*" type="glob"/>
  1.1083 +            </syspropertyset>
  1.1084 +            <formatter type="brief" usefile="false"/>
  1.1085 +            <formatter type="xml"/>
  1.1086 +        </junit>
  1.1087 +    </target>
  1.1088 +    <!--
  1.1089 +                end of pre NB72 profiling section
  1.1090 +            -->
  1.1091 +    <target if="netbeans.home" name="-profile-check">
  1.1092 +        <condition property="profiler.configured">
  1.1093 +            <or>
  1.1094 +                <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-agentpath:"/>
  1.1095 +                <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-javaagent:"/>
  1.1096 +            </or>
  1.1097 +        </condition>
  1.1098 +    </target>
  1.1099 +    <target depends="-profile-check,-profile-pre72" description="Profile a project in the IDE." if="profiler.configured" name="profile" unless="profiler.info.jvmargs.agent">
  1.1100 +        <startprofiler/>
  1.1101 +        <antcall target="run"/>
  1.1102 +    </target>
  1.1103 +    <target depends="-profile-check,-profile-single-pre72" description="Profile a selected class in the IDE." if="profiler.configured" name="profile-single" unless="profiler.info.jvmargs.agent">
  1.1104 +        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
  1.1105 +        <startprofiler/>
  1.1106 +        <antcall target="run-single"/>
  1.1107 +    </target>
  1.1108 +    <target depends="-profile-test-single-pre72" description="Profile a selected test in the IDE." name="profile-test-single"/>
  1.1109 +    <target depends="-profile-check" description="Profile a selected test in the IDE." if="profiler.configured" name="profile-test" unless="profiler.info.jvmargs">
  1.1110 +        <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
  1.1111 +        <startprofiler/>
  1.1112 +        <antcall target="test-single"/>
  1.1113 +    </target>
  1.1114 +    <target depends="-profile-check" description="Profile a selected class in the IDE." if="profiler.configured" name="profile-test-with-main">
  1.1115 +        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
  1.1116 +        <startprofiler/>
  1.1117 +        <antcall target="run-test-with-main"/>
  1.1118 +    </target>
  1.1119 +    <target depends="-profile-check,-profile-applet-pre72" if="profiler.configured" name="profile-applet" unless="profiler.info.jvmargs.agent">
  1.1120 +        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
  1.1121 +        <startprofiler/>
  1.1122 +        <antcall target="run-applet"/>
  1.1123 +    </target>
  1.1124 +    <!--
  1.1125                  ===============
  1.1126                  JAVADOC SECTION
  1.1127                  ===============
  1.1128              -->
  1.1129 -    <target depends="init" name="-javadoc-build">
  1.1130 +    <target depends="init" if="have.sources" name="-javadoc-build">
  1.1131          <mkdir dir="${dist.javadoc.dir}"/>
  1.1132 -        <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}">
  1.1133 +        <condition else="" property="javadoc.endorsed.classpath.cmd.line.arg" value="-J${endorsed.classpath.cmd.line.arg}">
  1.1134 +            <and>
  1.1135 +                <isset property="endorsed.classpath.cmd.line.arg"/>
  1.1136 +                <not>
  1.1137 +                    <equals arg1="${endorsed.classpath.cmd.line.arg}" arg2=""/>
  1.1138 +                </not>
  1.1139 +            </and>
  1.1140 +        </condition>
  1.1141 +        <condition else="" property="bug5101868workaround" value="*.java">
  1.1142 +            <matches pattern="1\.[56](\..*)?" string="${java.version}"/>
  1.1143 +        </condition>
  1.1144 +        <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}">
  1.1145              <classpath>
  1.1146                  <path path="${javac.classpath}"/>
  1.1147              </classpath>
  1.1148 -            <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
  1.1149 +            <fileset dir="${src.dir}" excludes="${bug5101868workaround},${excludes}" includes="${includes}">
  1.1150                  <filename name="**/*.java"/>
  1.1151              </fileset>
  1.1152 -            <fileset dir="${reglib.src.dir}" excludes="${excludes}" includes="${includes}">
  1.1153 +            <fileset dir="${reglib.src.dir}" excludes="${bug5101868workaround},${excludes}" includes="${includes}">
  1.1154                  <filename name="**/*.java"/>
  1.1155              </fileset>
  1.1156 +            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
  1.1157 +                <include name="**/*.java"/>
  1.1158 +                <exclude name="*.java"/>
  1.1159 +            </fileset>
  1.1160 +            <arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/>
  1.1161          </javadoc>
  1.1162 +        <copy todir="${dist.javadoc.dir}">
  1.1163 +            <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
  1.1164 +                <filename name="**/doc-files/**"/>
  1.1165 +            </fileset>
  1.1166 +            <fileset dir="${reglib.src.dir}" excludes="${excludes}" includes="${includes}">
  1.1167 +                <filename name="**/doc-files/**"/>
  1.1168 +            </fileset>
  1.1169 +            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
  1.1170 +                <include name="**/doc-files/**"/>
  1.1171 +            </fileset>
  1.1172 +        </copy>
  1.1173      </target>
  1.1174      <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
  1.1175          <nbbrowse file="${dist.javadoc.dir}/index.html"/>
  1.1176 @@ -506,7 +1265,7 @@
  1.1177      <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
  1.1178      <!--
  1.1179                  =========================
  1.1180 -                JUNIT COMPILATION SECTION
  1.1181 +                TEST COMPILATION SECTION
  1.1182                  =========================
  1.1183              -->
  1.1184      <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
  1.1185 @@ -519,8 +1278,8 @@
  1.1186      <target if="do.depend.true" name="-compile-test-depend">
  1.1187          <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
  1.1188      </target>
  1.1189 -    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
  1.1190 -        <j2seproject3:javac classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
  1.1191 +    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
  1.1192 +        <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" processorpath="${javac.test.processorpath}" srcdir="${test.src.dir}"/>
  1.1193          <copy todir="${build.test.classes.dir}">
  1.1194              <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
  1.1195          </copy>
  1.1196 @@ -534,10 +1293,10 @@
  1.1197          <!-- Empty placeholder for easier customization. -->
  1.1198          <!-- You can override this target in the ../build.xml file. -->
  1.1199      </target>
  1.1200 -    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
  1.1201 +    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
  1.1202          <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
  1.1203          <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
  1.1204 -        <j2seproject3:javac classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" sourcepath="${test.src.dir}" srcdir="${test.src.dir}"/>
  1.1205 +        <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" processorpath="${javac.test.processorpath}" sourcepath="${test.src.dir}" srcdir="${test.src.dir}"/>
  1.1206          <copy todir="${build.test.classes.dir}">
  1.1207              <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
  1.1208          </copy>
  1.1209 @@ -549,17 +1308,17 @@
  1.1210      <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
  1.1211      <!--
  1.1212                  =======================
  1.1213 -                JUNIT EXECUTION SECTION
  1.1214 +                TEST EXECUTION SECTION
  1.1215                  =======================
  1.1216              -->
  1.1217      <target depends="init" if="have.tests" name="-pre-test-run">
  1.1218          <mkdir dir="${build.test.results.dir}"/>
  1.1219      </target>
  1.1220      <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
  1.1221 -        <j2seproject3:junit testincludes="**/*Test.java"/>
  1.1222 +        <j2seproject3:test includes="${includes}" testincludes="**/*Test.java"/>
  1.1223      </target>
  1.1224      <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
  1.1225 -        <fail if="tests.failed">Some tests failed; see details above.</fail>
  1.1226 +        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
  1.1227      </target>
  1.1228      <target depends="init" if="have.tests" name="test-report"/>
  1.1229      <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
  1.1230 @@ -569,39 +1328,40 @@
  1.1231      </target>
  1.1232      <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
  1.1233          <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
  1.1234 -        <j2seproject3:junit excludes="" includes="${test.includes}"/>
  1.1235 +        <j2seproject3:test excludes="" includes="${test.includes}" testincludes="${test.includes}"/>
  1.1236      </target>
  1.1237      <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
  1.1238 -        <fail if="tests.failed">Some tests failed; see details above.</fail>
  1.1239 +        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
  1.1240      </target>
  1.1241 -    <target depends="init,-do-not-recompile,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/>
  1.1242 +    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/>
  1.1243 +    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single-method">
  1.1244 +        <fail unless="test.class">Must select some files in the IDE or set test.class</fail>
  1.1245 +        <fail unless="test.method">Must select some method in the IDE or set test.method</fail>
  1.1246 +        <j2seproject3:test excludes="" includes="${javac.includes}" testincludes="${test.class}" testmethods="${test.method}"/>
  1.1247 +    </target>
  1.1248 +    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single-method" if="have.tests" name="-post-test-run-single-method">
  1.1249 +        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
  1.1250 +    </target>
  1.1251 +    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single-method,-post-test-run-single-method" description="Run single unit test." name="test-single-method"/>
  1.1252      <!--
  1.1253                  =======================
  1.1254 -                JUNIT DEBUGGING SECTION
  1.1255 +                TEST DEBUGGING SECTION
  1.1256                  =======================
  1.1257              -->
  1.1258 -    <target depends="init,compile-test" if="have.tests" name="-debug-start-debuggee-test">
  1.1259 +    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test">
  1.1260          <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
  1.1261 -        <property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/>
  1.1262 -        <delete file="${test.report.file}"/>
  1.1263 -        <mkdir dir="${build.test.results.dir}"/>
  1.1264 -        <j2seproject3:debug classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner" classpath="${ant.home}/lib/ant.jar:${ant.home}/lib/ant-junit.jar:${debug.test.classpath}">
  1.1265 -            <customize>
  1.1266 -                <syspropertyset>
  1.1267 -                    <propertyref prefix="test-sys-prop."/>
  1.1268 -                    <mapper from="test-sys-prop.*" to="*" type="glob"/>
  1.1269 -                </syspropertyset>
  1.1270 -                <arg value="${test.class}"/>
  1.1271 -                <arg value="showoutput=true"/>
  1.1272 -                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/>
  1.1273 -                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/>
  1.1274 -            </customize>
  1.1275 -        </j2seproject3:debug>
  1.1276 +        <j2seproject3:test-debug excludes="" includes="${javac.includes}" testClass="${test.class}" testincludes="${javac.includes}"/>
  1.1277 +    </target>
  1.1278 +    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test-method">
  1.1279 +        <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
  1.1280 +        <fail unless="test.method">Must select some method in the IDE or set test.method</fail>
  1.1281 +        <j2seproject3:test-debug excludes="" includes="${javac.includes}" testClass="${test.class}" testMethod="${test.method}" testincludes="${test.class}" testmethods="${test.method}"/>
  1.1282      </target>
  1.1283      <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
  1.1284          <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
  1.1285      </target>
  1.1286 -    <target depends="init,-do-not-recompile,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
  1.1287 +    <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
  1.1288 +    <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test-method" name="debug-test-method"/>
  1.1289      <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
  1.1290          <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
  1.1291      </target>
  1.1292 @@ -638,17 +1398,64 @@
  1.1293                  CLEANUP SECTION
  1.1294                  ===============
  1.1295              -->
  1.1296 -    <target depends="init" name="deps-clean" unless="no.deps">
  1.1297 -        <ant antfile="${project.NBI_Engine}/build.xml" inheritall="false" target="clean"/>
  1.1298 -        <ant antfile="${project.org_netbeans_modules_reglib}/build.xml" inheritall="false" target="clean"/>
  1.1299 +    <target name="-deps-clean-init" unless="built-clean.properties">
  1.1300 +        <property location="${build.dir}/built-clean.properties" name="built-clean.properties"/>
  1.1301 +        <delete file="${built-clean.properties}" quiet="true"/>
  1.1302 +    </target>
  1.1303 +    <target if="already.built.clean.${basedir}" name="-warn-already-built-clean">
  1.1304 +        <echo level="warn" message="Cycle detected: Sun Studio Installer Engine was already built"/>
  1.1305 +    </target>
  1.1306 +    <target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps">
  1.1307 +        <mkdir dir="${build.dir}"/>
  1.1308 +        <touch file="${built-clean.properties}" verbose="false"/>
  1.1309 +        <property file="${built-clean.properties}" prefix="already.built.clean."/>
  1.1310 +        <antcall target="-warn-already-built-clean"/>
  1.1311 +        <propertyfile file="${built-clean.properties}">
  1.1312 +            <entry key="${basedir}" value=""/>
  1.1313 +        </propertyfile>
  1.1314 +        <antcall target="-maybe-call-dep">
  1.1315 +            <param name="call.built.properties" value="${built-clean.properties}"/>
  1.1316 +            <param location="${project.NBI_Engine}" name="call.subproject"/>
  1.1317 +            <param location="${project.NBI_Engine}/build.xml" name="call.script"/>
  1.1318 +            <param name="call.target" value="clean"/>
  1.1319 +            <param name="transfer.built-clean.properties" value="${built-clean.properties}"/>
  1.1320 +            <param name="transfer.not.archive.disabled" value="true"/>
  1.1321 +        </antcall>
  1.1322 +        <antcall target="-maybe-call-dep">
  1.1323 +            <param name="call.built.properties" value="${built-clean.properties}"/>
  1.1324 +            <param location="${project.org_netbeans_modules_reglib}" name="call.subproject"/>
  1.1325 +            <param location="${project.org_netbeans_modules_reglib}/build.xml" name="call.script"/>
  1.1326 +            <param name="call.target" value="clean"/>
  1.1327 +            <param name="transfer.built-clean.properties" value="${built-clean.properties}"/>
  1.1328 +            <param name="transfer.not.archive.disabled" value="true"/>
  1.1329 +        </antcall>
  1.1330      </target>
  1.1331      <target depends="init" name="-do-clean">
  1.1332          <delete dir="${build.dir}"/>
  1.1333 -        <delete dir="${dist.dir}"/>
  1.1334 +        <delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/>
  1.1335      </target>
  1.1336      <target name="-post-clean">
  1.1337          <!-- Empty placeholder for easier customization. -->
  1.1338          <!-- You can override this target in the ../build.xml file. -->
  1.1339      </target>
  1.1340      <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
  1.1341 +    <target name="-check-call-dep">
  1.1342 +        <property file="${call.built.properties}" prefix="already.built."/>
  1.1343 +        <condition property="should.call.dep">
  1.1344 +            <and>
  1.1345 +                <not>
  1.1346 +                    <isset property="already.built.${call.subproject}"/>
  1.1347 +                </not>
  1.1348 +                <available file="${call.script}"/>
  1.1349 +            </and>
  1.1350 +        </condition>
  1.1351 +    </target>
  1.1352 +    <target depends="-check-call-dep" if="should.call.dep" name="-maybe-call-dep">
  1.1353 +        <ant antfile="${call.script}" inheritall="false" target="${call.target}">
  1.1354 +            <propertyset>
  1.1355 +                <propertyref prefix="transfer."/>
  1.1356 +                <mapper from="transfer.*" to="*" type="glob"/>
  1.1357 +            </propertyset>
  1.1358 +        </ant>
  1.1359 +    </target>
  1.1360  </project>