Updating to projects from NetBeans 11.2
authorJaroslav Tulach <jaroslav.tulach@apidesign.org>
Mon, 11 Nov 2019 13:17:34 +0100
changeset 413f11943a373a7
parent 412 4034db7484a3
child 414 0e707eef1e4a
Updating to projects from NetBeans 11.2
samples/aserverinfo/nbproject/build-impl.xml
samples/aserverinfo/nbproject/genfiles.properties
samples/aserverinfo/nbproject/project.properties
samples/cloneproblem/build.xml
samples/cloneproblem/nbproject/build-impl.xml
samples/cloneproblem/nbproject/genfiles.properties
samples/cloneproblem/nbproject/project.properties
samples/codeinjection/build.xml
samples/codeinjection/nbproject/build-impl.xml
samples/codeinjection/nbproject/genfiles.properties
samples/codeinjection/nbproject/project.properties
samples/conditionaluseofapi/nbproject/build-impl.xml
samples/conditionaluseofapi/nbproject/genfiles.properties
samples/conditionaluseofapi/nbproject/project.properties
samples/deadlock/build.xml
samples/deadlock/nbproject/build-impl.xml
samples/deadlock/nbproject/genfiles.properties
samples/deadlock/nbproject/project.properties
samples/delegatingwriter/build.xml
samples/delegatingwriter/nbproject/build-impl.xml
samples/delegatingwriter/nbproject/genfiles.properties
samples/delegatingwriter/nbproject/project.properties
samples/extensibleicon/build.xml
samples/extensibleicon/nbproject/build-impl.xml
samples/extensibleicon/nbproject/genfiles.properties
samples/extensibleicon/nbproject/project.properties
samples/friendpackage/build.xml
samples/friendpackage/nbproject/build-impl.xml
samples/friendpackage/nbproject/genfiles.properties
samples/friendpackage/nbproject/project.properties
samples/gc/build.xml
samples/gc/nbproject/build-impl.xml
samples/gc/nbproject/genfiles.properties
samples/gc/nbproject/project.properties
samples/hellowithsubclassing/build.xml
samples/hellowithsubclassing/nbproject/build-impl.xml
samples/hellowithsubclassing/nbproject/genfiles.properties
samples/hellowithsubclassing/nbproject/project.properties
samples/individualsamples/build.xml
samples/individualsamples/nbproject/build-impl.xml
samples/individualsamples/nbproject/genfiles.properties
samples/individualsamples/nbproject/project.properties
samples/instanceof/build.xml
samples/instanceof/nbproject/build-impl.xml
samples/instanceof/nbproject/genfiles.properties
samples/instanceof/nbproject/project.properties
samples/javabeans/build.xml
samples/javabeans/nbproject/build-impl.xml
samples/javabeans/nbproject/genfiles.properties
samples/javabeans/nbproject/project.properties
samples/livedb/nbproject/build-impl.xml
samples/livedb/nbproject/genfiles.properties
samples/livedb/nbproject/project.properties
samples/misuse/build.xml
samples/misuse/nbproject/build-impl.xml
samples/misuse/nbproject/genfiles.properties
samples/misuse/nbproject/project.properties
samples/openfixed/build.xml
samples/openfixed/nbproject/build-impl.xml
samples/openfixed/nbproject/genfiles.properties
samples/openfixed/nbproject/project.properties
samples/privilegedcreator/nbproject/build-impl.xml
samples/privilegedcreator/nbproject/genfiles.properties
samples/privilegedcreator/nbproject/project.properties
samples/reentrant/build.xml
samples/reentrant/nbproject/build-impl.xml
samples/reentrant/nbproject/genfiles.properties
samples/reentrant/nbproject/project.properties
samples/sidemeanings/build.xml
samples/sidemeanings/nbproject/build-impl.xml
samples/sidemeanings/nbproject/genfiles.properties
samples/sidemeanings/nbproject/project.properties
samples/singletons/build.xml
samples/singletons/nbproject/build-impl.xml
samples/singletons/nbproject/genfiles.properties
samples/singletons/nbproject/project.properties
samples/stateful/build.xml
samples/stateful/nbproject/build-impl.xml
samples/stateful/nbproject/genfiles.properties
samples/stateful/nbproject/project.properties
samples/trycatchredo/build.xml
samples/trycatchredo/nbproject/build-impl.xml
samples/trycatchredo/nbproject/genfiles.properties
samples/trycatchredo/nbproject/project.properties
samples/unionfs/nbproject/build-impl.xml
samples/unionfs/nbproject/genfiles.properties
samples/unionfs/nbproject/project.properties
     1.1 --- a/samples/aserverinfo/nbproject/build-impl.xml	Mon Nov 11 05:47:32 2019 +0100
     1.2 +++ b/samples/aserverinfo/nbproject/build-impl.xml	Mon Nov 11 13:17:34 2019 +0100
     1.3 @@ -19,7 +19,7 @@
     1.4    - cleanup
     1.5  
     1.6          -->
     1.7 -<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="aserverinfo-impl">
     1.8 +<project xmlns:if="ant:if" 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" xmlns:unless="ant:unless" basedir=".." default="default" name="aserverinfo-impl">
     1.9      <fail message="Please build using Ant 1.8.0 or higher.">
    1.10          <condition>
    1.11              <not>
    1.12 @@ -46,14 +46,79 @@
    1.13          <property file="${user.properties.file}"/>
    1.14          <!-- The two properties below are usually overridden -->
    1.15          <!-- by the active platform. Just a fallback. -->
    1.16 -        <property name="default.javac.source" value="1.4"/>
    1.17 -        <property name="default.javac.target" value="1.4"/>
    1.18 +        <property name="default.javac.source" value="1.6"/>
    1.19 +        <property name="default.javac.target" value="1.6"/>
    1.20      </target>
    1.21      <target depends="-pre-init,-init-private,-init-user" name="-init-project">
    1.22          <property file="nbproject/configs/${config}.properties"/>
    1.23          <property file="nbproject/project.properties"/>
    1.24      </target>
    1.25 -    <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init">
    1.26 +    <target name="-init-modules-supported">
    1.27 +        <condition property="modules.supported.internal" value="true">
    1.28 +            <not>
    1.29 +                <matches pattern="1\.[0-8](\..*)?" string="${javac.source}"/>
    1.30 +            </not>
    1.31 +        </condition>
    1.32 +    </target>
    1.33 +    <target depends="-init-modules-supported" if="modules.supported.internal" name="-init-macrodef-modulename">
    1.34 +        <macrodef name="modulename" uri="http://www.netbeans.org/ns/j2se-project/3">
    1.35 +            <attribute name="property"/>
    1.36 +            <attribute name="sourcepath"/>
    1.37 +            <sequential>
    1.38 +                <loadresource property="@{property}" quiet="true">
    1.39 +                    <javaresource classpath="@{sourcepath}" name="module-info.java" parentFirst="false"/>
    1.40 +                    <filterchain>
    1.41 +                        <stripjavacomments/>
    1.42 +                        <linecontainsregexp>
    1.43 +                            <regexp pattern="module .* \{"/>
    1.44 +                        </linecontainsregexp>
    1.45 +                        <tokenfilter>
    1.46 +                            <linetokenizer/>
    1.47 +                            <replaceregex flags="s" pattern="(\s*module\s+)(\S*)(\s*\{.*)" replace="\2"/>
    1.48 +                        </tokenfilter>
    1.49 +                        <striplinebreaks/>
    1.50 +                    </filterchain>
    1.51 +                </loadresource>
    1.52 +            </sequential>
    1.53 +        </macrodef>
    1.54 +    </target>
    1.55 +    <target depends="-init-modules-supported,-init-macrodef-modulename" if="modules.supported.internal" name="-init-source-module-properties">
    1.56 +        <fail message="Java 9 support requires Ant 1.10.0 or higher.">
    1.57 +            <condition>
    1.58 +                <not>
    1.59 +                    <antversion atleast="1.10.0"/>
    1.60 +                </not>
    1.61 +            </condition>
    1.62 +        </fail>
    1.63 +        <j2seproject3:modulename property="module.name" sourcepath="${src.dir}"/>
    1.64 +        <condition property="named.module.internal">
    1.65 +            <and>
    1.66 +                <isset property="module.name"/>
    1.67 +                <length length="0" string="${module.name}" when="greater"/>
    1.68 +            </and>
    1.69 +        </condition>
    1.70 +        <condition property="unnamed.module.internal">
    1.71 +            <not>
    1.72 +                <isset property="named.module.internal"/>
    1.73 +            </not>
    1.74 +        </condition>
    1.75 +        <property name="javac.modulepath" value=""/>
    1.76 +        <property name="run.modulepath" value="${javac.modulepath}"/>
    1.77 +        <property name="module.build.classes.dir" value="${build.classes.dir}"/>
    1.78 +        <property name="debug.modulepath" value="${run.modulepath}"/>
    1.79 +        <property name="javac.upgrademodulepath" value=""/>
    1.80 +        <property name="run.upgrademodulepath" value="${javac.upgrademodulepath}"/>
    1.81 +        <condition else="" property="javac.systemmodulepath.cmd.line.arg" value="--system '${javac.systemmodulepath}'">
    1.82 +            <and>
    1.83 +                <isset property="javac.systemmodulepath"/>
    1.84 +                <length length="0" string="${javac.systemmodulepath}" when="greater"/>
    1.85 +            </and>
    1.86 +        </condition>
    1.87 +        <property name="dist.jlink.dir" value="${dist.dir}/jlink"/>
    1.88 +        <property name="dist.jlink.output" value="${dist.jlink.dir}/${application.title}"/>
    1.89 +        <property name="module.name" value=""/>
    1.90 +    </target>
    1.91 +    <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property,-init-modules-supported" name="-do-init">
    1.92          <property name="platform.java" value="${java.home}/bin/java"/>
    1.93          <available file="${manifest.file}" property="manifest.available"/>
    1.94          <condition property="splashscreen.available">
    1.95 @@ -76,7 +141,9 @@
    1.96              <and>
    1.97                  <isset property="javac.profile"/>
    1.98                  <length length="0" string="${javac.profile}" when="greater"/>
    1.99 -                <matches pattern="1\.[89](\..*)?" string="${javac.source}"/>
   1.100 +                <not>
   1.101 +                    <matches pattern="1\.[0-7](\..*)?" string="${javac.source}"/>
   1.102 +                </not>
   1.103              </and>
   1.104          </condition>
   1.105          <condition property="do.archive">
   1.106 @@ -87,15 +154,6 @@
   1.107                  <istrue value="${not.archive.disabled}"/>
   1.108              </or>
   1.109          </condition>
   1.110 -        <condition property="do.mkdist">
   1.111 -            <and>
   1.112 -                <isset property="do.archive"/>
   1.113 -                <isset property="libs.CopyLibs.classpath"/>
   1.114 -                <not>
   1.115 -                    <istrue value="${mkdist.disabled}"/>
   1.116 -                </not>
   1.117 -            </and>
   1.118 -        </condition>
   1.119          <condition property="do.archive+manifest.available">
   1.120              <and>
   1.121                  <isset property="manifest.available"/>
   1.122 @@ -156,6 +214,7 @@
   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 @@ -191,7 +250,12 @@
   1.131                  </not>
   1.132              </and>
   1.133          </condition>
   1.134 -        <property name="javac.fork" value="${jdkBug6558476}"/>
   1.135 +        <condition else="false" property="javac.fork">
   1.136 +            <or>
   1.137 +                <istrue value="${jdkBug6558476}"/>
   1.138 +                <istrue value="${javac.external.vm}"/>
   1.139 +            </or>
   1.140 +        </condition>
   1.141          <property name="jar.index" value="false"/>
   1.142          <property name="jar.index.metainf" value="${jar.index}"/>
   1.143          <property name="copylibs.rebase" value="true"/>
   1.144 @@ -217,6 +281,7 @@
   1.145          <condition else="" property="testng.debug.mode" value="-mixed">
   1.146              <istrue value="${junit+testng.available}"/>
   1.147          </condition>
   1.148 +        <property name="java.failonerror" value="true"/>
   1.149      </target>
   1.150      <target name="-post-init">
   1.151          <!-- Empty placeholder for easier customization. -->
   1.152 @@ -243,11 +308,80 @@
   1.153              </sequential>
   1.154          </macrodef>
   1.155      </target>
   1.156 -    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors">
   1.157 +    <target depends="-init-ap-cmdline-properties,-init-source-module-properties" if="modules.supported.internal" name="-init-macrodef-javac-with-module">
   1.158          <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.159              <attribute default="${src.dir}" name="srcdir"/>
   1.160              <attribute default="${build.classes.dir}" name="destdir"/>
   1.161              <attribute default="${javac.classpath}" name="classpath"/>
   1.162 +            <attribute default="${javac.modulepath}" name="modulepath"/>
   1.163 +            <attribute default="${javac.upgrademodulepath}" name="upgrademodulepath"/>
   1.164 +            <attribute default="${javac.processorpath}" name="processorpath"/>
   1.165 +            <attribute default="${javac.processormodulepath}" name="processormodulepath"/>
   1.166 +            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
   1.167 +            <attribute default="${includes}" name="includes"/>
   1.168 +            <attribute default="${excludes}" name="excludes"/>
   1.169 +            <attribute default="${javac.debug}" name="debug"/>
   1.170 +            <attribute default="${empty.dir}" name="sourcepath" unless:set="named.module.internal"/>
   1.171 +            <attribute default="${src.dir}" if:set="named.module.internal" name="sourcepath"/>
   1.172 +            <attribute default="${empty.dir}" name="gensrcdir"/>
   1.173 +            <element name="customize" optional="true"/>
   1.174 +            <sequential>
   1.175 +                <condition property="warn.excludes.internal">
   1.176 +                    <and>
   1.177 +                        <isset property="named.module.internal"/>
   1.178 +                        <length length="0" string="@{excludes}" trim="true" when="greater"/>
   1.179 +                    </and>
   1.180 +                </condition>
   1.181 +                <echo if:set="warn.excludes.internal" level="warning" message="The javac excludes are not supported in the JDK 9 Named Module."/>
   1.182 +                <property location="${build.dir}/empty" name="empty.dir"/>
   1.183 +                <mkdir dir="${empty.dir}"/>
   1.184 +                <mkdir dir="@{apgeneratedsrcdir}"/>
   1.185 +                <condition property="processormodulepath.set">
   1.186 +                    <resourcecount count="0" when="greater">
   1.187 +                        <path>
   1.188 +                            <pathelement path="@{processormodulepath}"/>
   1.189 +                        </path>
   1.190 +                    </resourcecount>
   1.191 +                </condition>
   1.192 +                <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.193 +                    <src>
   1.194 +                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
   1.195 +                            <include name="*"/>
   1.196 +                        </dirset>
   1.197 +                    </src>
   1.198 +                    <classpath>
   1.199 +                        <path path="@{classpath}"/>
   1.200 +                    </classpath>
   1.201 +                    <modulepath>
   1.202 +                        <path path="@{modulepath}"/>
   1.203 +                    </modulepath>
   1.204 +                    <upgrademodulepath>
   1.205 +                        <path path="@{upgrademodulepath}"/>
   1.206 +                    </upgrademodulepath>
   1.207 +                    <compilerarg line="${javac.systemmodulepath.cmd.line.arg}"/>
   1.208 +                    <compilerarg line="${javac.profile.cmd.line.arg}"/>
   1.209 +                    <compilerarg line="${javac.compilerargs}"/>
   1.210 +                    <compilerarg if:set="processormodulepath.set" value="--processor-module-path"/>
   1.211 +                    <compilerarg if:set="processormodulepath.set" path="@{processormodulepath}"/>
   1.212 +                    <compilerarg unless:set="processormodulepath.set" value="-processorpath"/>
   1.213 +                    <compilerarg path="@{processorpath}:${empty.dir}" unless:set="processormodulepath.set"/>
   1.214 +                    <compilerarg line="${ap.processors.internal}"/>
   1.215 +                    <compilerarg line="${annotation.processing.processor.options}"/>
   1.216 +                    <compilerarg value="-s"/>
   1.217 +                    <compilerarg path="@{apgeneratedsrcdir}"/>
   1.218 +                    <compilerarg line="${ap.proc.none.internal}"/>
   1.219 +                    <customize/>
   1.220 +                </javac>
   1.221 +            </sequential>
   1.222 +        </macrodef>
   1.223 +    </target>
   1.224 +    <target depends="-init-ap-cmdline-properties,-init-source-module-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors" unless="modules.supported.internal">
   1.225 +        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.226 +            <attribute default="${src.dir}" name="srcdir"/>
   1.227 +            <attribute default="${build.classes.dir}" name="destdir"/>
   1.228 +            <attribute default="${javac.classpath}" name="classpath"/>
   1.229 +            <attribute default="${javac.modulepath}" name="modulepath"/>
   1.230 +            <attribute default="${javac.upgrademodulepath}" name="upgrademodulepath"/>
   1.231              <attribute default="${javac.processorpath}" name="processorpath"/>
   1.232              <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
   1.233              <attribute default="${includes}" name="includes"/>
   1.234 @@ -284,11 +418,13 @@
   1.235              </sequential>
   1.236          </macrodef>
   1.237      </target>
   1.238 -    <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
   1.239 +    <target depends="-init-ap-cmdline-properties,-init-source-module-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
   1.240          <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.241              <attribute default="${src.dir}" name="srcdir"/>
   1.242              <attribute default="${build.classes.dir}" name="destdir"/>
   1.243              <attribute default="${javac.classpath}" name="classpath"/>
   1.244 +            <attribute default="${javac.modulepath}" name="modulepath"/>
   1.245 +            <attribute default="${javac.upgrademodulepath}" name="upgrademodulepath"/>
   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 @@ -317,7 +453,7 @@
   1.250              </sequential>
   1.251          </macrodef>
   1.252      </target>
   1.253 -    <target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
   1.254 +    <target depends="-init-macrodef-javac-with-module,-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
   1.255          <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.256              <attribute default="${src.dir}" name="srcdir"/>
   1.257              <attribute default="${build.classes.dir}" name="destdir"/>
   1.258 @@ -372,7 +508,59 @@
   1.259          <property name="test.binarytestincludes" value=""/>
   1.260          <property name="test.binaryexcludes" value=""/>
   1.261      </target>
   1.262 -    <target if="${nb.junit.single}" name="-init-macrodef-junit-single" unless="${nb.junit.batch}">
   1.263 +    <target depends="-init-modules-supported" if="modules.supported.internal" name="-init-macrodef-junit-prototype-with-module">
   1.264 +        <macrodef name="junit-prototype" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.265 +            <attribute default="${includes}" name="includes"/>
   1.266 +            <attribute default="${excludes}" name="excludes"/>
   1.267 +            <element name="customizePrototype" optional="true"/>
   1.268 +            <sequential>
   1.269 +                <property name="junit.forkmode" value="perTest"/>
   1.270 +                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
   1.271 +                    <syspropertyset>
   1.272 +                        <propertyref prefix="test-sys-prop."/>
   1.273 +                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
   1.274 +                    </syspropertyset>
   1.275 +                    <classpath>
   1.276 +                        <path path="${run.test.classpath}"/>
   1.277 +                    </classpath>
   1.278 +                    <modulepath>
   1.279 +                        <path path="${run.test.modulepath}"/>
   1.280 +                    </modulepath>
   1.281 +                    <formatter type="brief" usefile="false"/>
   1.282 +                    <formatter type="xml"/>
   1.283 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   1.284 +                    <jvmarg value="-ea"/>
   1.285 +                    <jvmarg line="${run.test.jvmargs}"/>
   1.286 +                    <customizePrototype/>
   1.287 +                </junit>
   1.288 +            </sequential>
   1.289 +        </macrodef>
   1.290 +    </target>
   1.291 +    <target depends="-init-modules-supported" name="-init-macrodef-junit-prototype-without-module" unless="modules.supported.internal">
   1.292 +        <macrodef name="junit-prototype" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.293 +            <attribute default="${includes}" name="includes"/>
   1.294 +            <attribute default="${excludes}" name="excludes"/>
   1.295 +            <element name="customizePrototype" optional="true"/>
   1.296 +            <sequential>
   1.297 +                <property name="junit.forkmode" value="perTest"/>
   1.298 +                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
   1.299 +                    <syspropertyset>
   1.300 +                        <propertyref prefix="test-sys-prop."/>
   1.301 +                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
   1.302 +                    </syspropertyset>
   1.303 +                    <classpath>
   1.304 +                        <path path="${run.test.classpath}"/>
   1.305 +                    </classpath>
   1.306 +                    <formatter type="brief" usefile="false"/>
   1.307 +                    <formatter type="xml"/>
   1.308 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   1.309 +                    <jvmarg value="-ea"/>
   1.310 +                    <customizePrototype/>
   1.311 +                </junit>
   1.312 +            </sequential>
   1.313 +        </macrodef>
   1.314 +    </target>
   1.315 +    <target depends="-init-test-properties,-init-macrodef-junit-prototype-with-module,-init-macrodef-junit-prototype-without-module" if="${nb.junit.single}" name="-init-macrodef-junit-single" unless="${nb.junit.batch}">
   1.316          <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.317              <attribute default="${includes}" name="includes"/>
   1.318              <attribute default="${excludes}" name="excludes"/>
   1.319 @@ -380,22 +568,16 @@
   1.320              <attribute default="" name="testmethods"/>
   1.321              <element name="customize" optional="true"/>
   1.322              <sequential>
   1.323 -                <property name="junit.forkmode" value="perTest"/>
   1.324 -                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
   1.325 -                    <test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/>
   1.326 -                    <syspropertyset>
   1.327 -                        <propertyref prefix="test-sys-prop."/>
   1.328 -                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
   1.329 -                    </syspropertyset>
   1.330 -                    <formatter type="brief" usefile="false"/>
   1.331 -                    <formatter type="xml"/>
   1.332 -                    <jvmarg value="-ea"/>
   1.333 -                    <customize/>
   1.334 -                </junit>
   1.335 +                <j2seproject3:junit-prototype>
   1.336 +                    <customizePrototype>
   1.337 +                        <test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/>
   1.338 +                        <customize/>
   1.339 +                    </customizePrototype>
   1.340 +                </j2seproject3:junit-prototype>
   1.341              </sequential>
   1.342          </macrodef>
   1.343      </target>
   1.344 -    <target depends="-init-test-properties" if="${nb.junit.batch}" name="-init-macrodef-junit-batch" unless="${nb.junit.single}">
   1.345 +    <target depends="-init-test-properties,-init-macrodef-junit-prototype-with-module,-init-macrodef-junit-prototype-without-module" if="${nb.junit.batch}" name="-init-macrodef-junit-batch" unless="${nb.junit.single}">
   1.346          <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.347              <attribute default="${includes}" name="includes"/>
   1.348              <attribute default="${excludes}" name="excludes"/>
   1.349 @@ -403,25 +585,19 @@
   1.350              <attribute default="" name="testmethods"/>
   1.351              <element name="customize" optional="true"/>
   1.352              <sequential>
   1.353 -                <property name="junit.forkmode" value="perTest"/>
   1.354 -                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
   1.355 -                    <batchtest todir="${build.test.results.dir}">
   1.356 -                        <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
   1.357 -                            <filename name="@{testincludes}"/>
   1.358 -                        </fileset>
   1.359 -                        <fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}">
   1.360 -                            <filename name="${test.binarytestincludes}"/>
   1.361 -                        </fileset>
   1.362 -                    </batchtest>
   1.363 -                    <syspropertyset>
   1.364 -                        <propertyref prefix="test-sys-prop."/>
   1.365 -                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
   1.366 -                    </syspropertyset>
   1.367 -                    <formatter type="brief" usefile="false"/>
   1.368 -                    <formatter type="xml"/>
   1.369 -                    <jvmarg value="-ea"/>
   1.370 -                    <customize/>
   1.371 -                </junit>
   1.372 +                <j2seproject3:junit-prototype>
   1.373 +                    <customizePrototype>
   1.374 +                        <batchtest todir="${build.test.results.dir}">
   1.375 +                            <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
   1.376 +                                <filename name="@{testincludes}"/>
   1.377 +                            </fileset>
   1.378 +                            <fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}">
   1.379 +                                <filename name="${test.binarytestincludes}"/>
   1.380 +                            </fileset>
   1.381 +                        </batchtest>
   1.382 +                        <customize/>
   1.383 +                    </customizePrototype>
   1.384 +                </j2seproject3:junit-prototype>
   1.385              </sequential>
   1.386          </macrodef>
   1.387      </target>
   1.388 @@ -449,6 +625,10 @@
   1.389                          <propertyref prefix="test-sys-prop."/>
   1.390                          <mapper from="test-sys-prop.*" to="*" type="glob"/>
   1.391                      </propertyset>
   1.392 +                    <classpath>
   1.393 +                        <path path="${run.test.classpath}"/>
   1.394 +                    </classpath>
   1.395 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   1.396                      <customize/>
   1.397                  </testng>
   1.398              </sequential>
   1.399 @@ -503,10 +683,6 @@
   1.400              <sequential>
   1.401                  <j2seproject3:test-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
   1.402                      <customize>
   1.403 -                        <classpath>
   1.404 -                            <path path="${run.test.classpath}"/>
   1.405 -                        </classpath>
   1.406 -                        <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   1.407                          <jvmarg line="${run.jvmargs}"/>
   1.408                          <jvmarg line="${run.jvmargs.ide}"/>
   1.409                      </customize>
   1.410 @@ -514,74 +690,20 @@
   1.411              </sequential>
   1.412          </macrodef>
   1.413      </target>
   1.414 -    <target if="${junit.available}" name="-init-macrodef-junit-debug" unless="${nb.junit.batch}">
   1.415 -        <macrodef name="junit-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.416 -            <attribute default="${includes}" name="includes"/>
   1.417 -            <attribute default="${excludes}" name="excludes"/>
   1.418 -            <attribute default="**" name="testincludes"/>
   1.419 -            <attribute default="" name="testmethods"/>
   1.420 -            <element name="customize" optional="true"/>
   1.421 -            <sequential>
   1.422 -                <property name="junit.forkmode" value="perTest"/>
   1.423 -                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
   1.424 -                    <test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/>
   1.425 -                    <syspropertyset>
   1.426 -                        <propertyref prefix="test-sys-prop."/>
   1.427 -                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
   1.428 -                    </syspropertyset>
   1.429 -                    <formatter type="brief" usefile="false"/>
   1.430 -                    <formatter type="xml"/>
   1.431 -                    <jvmarg value="-ea"/>
   1.432 -                    <jvmarg line="${debug-args-line}"/>
   1.433 -                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
   1.434 -                    <customize/>
   1.435 -                </junit>
   1.436 -            </sequential>
   1.437 -        </macrodef>
   1.438 -    </target>
   1.439 -    <target depends="-init-test-properties" if="${nb.junit.batch}" name="-init-macrodef-junit-debug-batch">
   1.440 -        <macrodef name="junit-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.441 -            <attribute default="${includes}" name="includes"/>
   1.442 -            <attribute default="${excludes}" name="excludes"/>
   1.443 -            <attribute default="**" name="testincludes"/>
   1.444 -            <attribute default="" name="testmethods"/>
   1.445 -            <element name="customize" optional="true"/>
   1.446 -            <sequential>
   1.447 -                <property name="junit.forkmode" value="perTest"/>
   1.448 -                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
   1.449 -                    <batchtest todir="${build.test.results.dir}">
   1.450 -                        <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
   1.451 -                            <filename name="@{testincludes}"/>
   1.452 -                        </fileset>
   1.453 -                        <fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}">
   1.454 -                            <filename name="${test.binarytestincludes}"/>
   1.455 -                        </fileset>
   1.456 -                    </batchtest>
   1.457 -                    <syspropertyset>
   1.458 -                        <propertyref prefix="test-sys-prop."/>
   1.459 -                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
   1.460 -                    </syspropertyset>
   1.461 -                    <formatter type="brief" usefile="false"/>
   1.462 -                    <formatter type="xml"/>
   1.463 -                    <jvmarg value="-ea"/>
   1.464 -                    <jvmarg line="${debug-args-line}"/>
   1.465 -                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
   1.466 -                    <customize/>
   1.467 -                </junit>
   1.468 -            </sequential>
   1.469 -        </macrodef>
   1.470 -    </target>
   1.471 -    <target depends="-init-macrodef-junit-debug,-init-macrodef-junit-debug-batch" if="${junit.available}" name="-init-macrodef-junit-debug-impl">
   1.472 +    <target depends="-init-macrodef-junit" if="${junit.available}" name="-init-macrodef-junit-debug-impl">
   1.473          <macrodef name="test-debug-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.474              <attribute default="${includes}" name="includes"/>
   1.475              <attribute default="${excludes}" name="excludes"/>
   1.476              <attribute default="**" name="testincludes"/>
   1.477              <attribute default="" name="testmethods"/>
   1.478 -            <element implicit="true" name="customize" optional="true"/>
   1.479 +            <element name="customizeDebuggee" optional="true"/>
   1.480              <sequential>
   1.481 -                <j2seproject3:junit-debug excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
   1.482 -                    <customize/>
   1.483 -                </j2seproject3:junit-debug>
   1.484 +                <j2seproject3:junit excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
   1.485 +                    <customize>
   1.486 +                        <jvmarg value="-agentlib:jdwp=transport=${debug-transport},address=${jpda.address}"/>
   1.487 +                        <customizeDebuggee/>
   1.488 +                    </customize>
   1.489 +                </j2seproject3:junit>
   1.490              </sequential>
   1.491          </macrodef>
   1.492      </target>
   1.493 @@ -600,14 +722,14 @@
   1.494                  <delete dir="${build.test.results.dir}" quiet="true"/>
   1.495                  <mkdir dir="${build.test.results.dir}"/>
   1.496                  <j2seproject3:debug classname="org.testng.TestNG" classpath="${debug.test.classpath}">
   1.497 -                    <customize>
   1.498 +                    <customizeDebuggee>
   1.499                          <customize2/>
   1.500                          <jvmarg value="-ea"/>
   1.501                          <arg line="${testng.debug.mode}"/>
   1.502                          <arg line="-d ${build.test.results.dir}"/>
   1.503                          <arg line="-listener org.testng.reporters.VerboseReporter"/>
   1.504                          <arg line="${testng.cmd.args}"/>
   1.505 -                    </customize>
   1.506 +                    </customizeDebuggee>
   1.507                  </j2seproject3:debug>
   1.508              </sequential>
   1.509          </macrodef>
   1.510 @@ -634,14 +756,10 @@
   1.511              <attribute default="" name="testMethod"/>
   1.512              <sequential>
   1.513                  <j2seproject3:test-debug-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
   1.514 -                    <customize>
   1.515 -                        <classpath>
   1.516 -                            <path path="${run.test.classpath}"/>
   1.517 -                        </classpath>
   1.518 -                        <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   1.519 +                    <customizeDebuggee>
   1.520                          <jvmarg line="${run.jvmargs}"/>
   1.521                          <jvmarg line="${run.jvmargs.ide}"/>
   1.522 -                    </customize>
   1.523 +                    </customizeDebuggee>
   1.524                  </j2seproject3:test-debug-impl>
   1.525              </sequential>
   1.526          </macrodef>
   1.527 @@ -693,7 +811,7 @@
   1.528              <sequential>
   1.529                  <property environment="env"/>
   1.530                  <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
   1.531 -                <java classname="@{classname}" dir="${profiler.info.dir}" fork="true" jvm="${profiler.info.jvm}">
   1.532 +                <java classname="@{classname}" dir="${profiler.info.dir}" failonerror="${java.failonerror}" fork="true" jvm="${profiler.info.jvm}">
   1.533                      <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   1.534                      <jvmarg value="${profiler.info.jvmargs.agent}"/>
   1.535                      <jvmarg line="${profiler.info.jvmargs}"/>
   1.536 @@ -721,10 +839,14 @@
   1.537      <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
   1.538          <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
   1.539              <attribute default="${main.class}" name="name"/>
   1.540 +            <attribute default="${debug.modulepath}" name="modulepath"/>
   1.541              <attribute default="${debug.classpath}" name="classpath"/>
   1.542              <attribute default="" name="stopclassname"/>
   1.543              <sequential>
   1.544                  <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport}">
   1.545 +                    <modulepath>
   1.546 +                        <path path="@{modulepath}"/>
   1.547 +                    </modulepath>
   1.548                      <classpath>
   1.549                          <path path="@{classpath}"/>
   1.550                      </classpath>
   1.551 @@ -743,18 +865,6 @@
   1.552          </macrodef>
   1.553      </target>
   1.554      <target name="-init-debug-args">
   1.555 -        <property name="version-output" value="java version &quot;${ant.java.version}"/>
   1.556 -        <condition property="have-jdk-older-than-1.4">
   1.557 -            <or>
   1.558 -                <contains string="${version-output}" substring="java version &quot;1.0"/>
   1.559 -                <contains string="${version-output}" substring="java version &quot;1.1"/>
   1.560 -                <contains string="${version-output}" substring="java version &quot;1.2"/>
   1.561 -                <contains string="${version-output}" substring="java version &quot;1.3"/>
   1.562 -            </or>
   1.563 -        </condition>
   1.564 -        <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
   1.565 -            <istrue value="${have-jdk-older-than-1.4}"/>
   1.566 -        </condition>
   1.567          <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
   1.568              <os family="windows"/>
   1.569          </condition>
   1.570 @@ -764,21 +874,46 @@
   1.571      </target>
   1.572      <target depends="-init-debug-args" name="-init-macrodef-debug">
   1.573          <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.574 +            <attribute default="${module.name}" name="modulename"/>
   1.575              <attribute default="${main.class}" name="classname"/>
   1.576 +            <attribute default="${debug.modulepath}" name="modulepath"/>
   1.577              <attribute default="${debug.classpath}" name="classpath"/>
   1.578 +            <element name="customizeDebuggee" optional="true"/>
   1.579 +            <sequential>
   1.580 +                <j2seproject1:java classname="@{classname}" classpath="@{classpath}" modulename="@{modulename}" modulepath="@{modulepath}">
   1.581 +                    <customize>
   1.582 +                        <jvmarg value="-agentlib:jdwp=transport=${debug-transport},address=${jpda.address}"/>
   1.583 +                        <customizeDebuggee/>
   1.584 +                    </customize>
   1.585 +                </j2seproject1:java>
   1.586 +            </sequential>
   1.587 +        </macrodef>
   1.588 +    </target>
   1.589 +    <target depends="-init-source-module-properties" if="named.module.internal" name="-init-macrodef-java-with-module">
   1.590 +        <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
   1.591 +            <attribute default="${module.name}" name="modulename"/>
   1.592 +            <attribute default="${main.class}" name="classname"/>
   1.593 +            <attribute default="${run.modulepath}" name="modulepath"/>
   1.594 +            <attribute default="${run.upgrademodulepath}" name="upgrademodulepath"/>
   1.595 +            <attribute default="${run.classpath}" name="classpath"/>
   1.596 +            <attribute default="jvm" name="jvm"/>
   1.597              <element name="customize" optional="true"/>
   1.598              <sequential>
   1.599 -                <java classname="@{classname}" dir="${work.dir}" fork="true">
   1.600 -                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   1.601 -                    <jvmarg line="${debug-args-line}"/>
   1.602 -                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
   1.603 +                <java classname="@{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true" module="@{modulename}">
   1.604 +                    <classpath>
   1.605 +                        <path path="@{classpath}"/>
   1.606 +                    </classpath>
   1.607 +                    <modulepath>
   1.608 +                        <pathelement path="@{modulepath}"/>
   1.609 +                        <pathelement location="${module.build.classes.dir}"/>
   1.610 +                    </modulepath>
   1.611 +                    <upgrademodulepath>
   1.612 +                        <path path="@{upgrademodulepath}"/>
   1.613 +                    </upgrademodulepath>
   1.614                      <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
   1.615                      <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
   1.616                      <jvmarg line="${run.jvmargs}"/>
   1.617                      <jvmarg line="${run.jvmargs.ide}"/>
   1.618 -                    <classpath>
   1.619 -                        <path path="@{classpath}"/>
   1.620 -                    </classpath>
   1.621                      <syspropertyset>
   1.622                          <propertyref prefix="run-sys-prop."/>
   1.623                          <mapper from="run-sys-prop.*" to="*" type="glob"/>
   1.624 @@ -788,14 +923,49 @@
   1.625              </sequential>
   1.626          </macrodef>
   1.627      </target>
   1.628 -    <target name="-init-macrodef-java">
   1.629 +    <target depends="-init-source-module-properties" if="unnamed.module.internal" name="-init-macrodef-java-with-unnamed-module">
   1.630          <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
   1.631 +            <attribute default="" name="modulename"/>
   1.632              <attribute default="${main.class}" name="classname"/>
   1.633 +            <attribute default="${run.modulepath}" name="modulepath"/>
   1.634 +            <attribute default="${run.upgrademodulepath}" name="upgrademodulepath"/>
   1.635              <attribute default="${run.classpath}" name="classpath"/>
   1.636              <attribute default="jvm" name="jvm"/>
   1.637              <element name="customize" optional="true"/>
   1.638              <sequential>
   1.639 -                <java classname="@{classname}" dir="${work.dir}" fork="true">
   1.640 +                <java classname="@{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true">
   1.641 +                    <classpath>
   1.642 +                        <path path="@{classpath}"/>
   1.643 +                    </classpath>
   1.644 +                    <modulepath>
   1.645 +                        <path path="@{modulepath}"/>
   1.646 +                    </modulepath>
   1.647 +                    <upgrademodulepath>
   1.648 +                        <path path="@{upgrademodulepath}"/>
   1.649 +                    </upgrademodulepath>
   1.650 +                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
   1.651 +                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
   1.652 +                    <jvmarg line="${run.jvmargs}"/>
   1.653 +                    <jvmarg line="${run.jvmargs.ide}"/>
   1.654 +                    <syspropertyset>
   1.655 +                        <propertyref prefix="run-sys-prop."/>
   1.656 +                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
   1.657 +                    </syspropertyset>
   1.658 +                    <customize/>
   1.659 +                </java>
   1.660 +            </sequential>
   1.661 +        </macrodef>
   1.662 +    </target>
   1.663 +    <target depends="-init-source-module-properties" name="-init-macrodef-java-without-module" unless="modules.supported.internal">
   1.664 +        <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
   1.665 +            <attribute default="" name="modulename"/>
   1.666 +            <attribute default="${main.class}" name="classname"/>
   1.667 +            <attribute default="" name="modulepath"/>
   1.668 +            <attribute default="${run.classpath}" name="classpath"/>
   1.669 +            <attribute default="jvm" name="jvm"/>
   1.670 +            <element name="customize" optional="true"/>
   1.671 +            <sequential>
   1.672 +                <java classname="@{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true">
   1.673                      <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   1.674                      <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
   1.675                      <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
   1.676 @@ -813,6 +983,7 @@
   1.677              </sequential>
   1.678          </macrodef>
   1.679      </target>
   1.680 +    <target depends="-init-macrodef-java-with-module, -init-macrodef-java-with-unnamed-module, -init-macrodef-java-without-module" name="-init-macrodef-java"/>
   1.681      <target name="-init-macrodef-copylibs">
   1.682          <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.683              <attribute default="${manifest.file}" name="manifest"/>
   1.684 @@ -834,7 +1005,7 @@
   1.685                      </chainedmapper>
   1.686                  </pathconvert>
   1.687                  <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
   1.688 -                <copylibs compress="${jar.compress}" excludeFromCopy="${copylibs.excludes}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" rebase="${copylibs.rebase}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
   1.689 +                <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.690                      <fileset dir="${build.classes.dir}" excludes="${dist.archive.excludes}"/>
   1.691                      <manifest>
   1.692                          <attribute name="Class-Path" value="${jar.classpath}"/>
   1.693 @@ -846,7 +1017,7 @@
   1.694      </target>
   1.695      <target name="-init-presetdef-jar">
   1.696          <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
   1.697 -            <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}">
   1.698 +            <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}" manifestencoding="UTF-8">
   1.699                  <j2seproject1:fileset dir="${build.classes.dir}" excludes="${dist.archive.excludes}"/>
   1.700              </jar>
   1.701          </presetdef>
   1.702 @@ -902,7 +1073,9 @@
   1.703          <available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/>
   1.704      </target>
   1.705      <target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build">
   1.706 -        <antcall target="clean"/>
   1.707 +        <antcall target="clean">
   1.708 +            <param name="no.dependencies" value="true"/>
   1.709 +        </antcall>
   1.710      </target>
   1.711      <target depends="init,deps-jar" name="-pre-pre-compile">
   1.712          <mkdir dir="${build.classes.dir}"/>
   1.713 @@ -943,7 +1116,7 @@
   1.714      <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
   1.715          <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
   1.716          <j2seproject3:force-recompile/>
   1.717 -        <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.dir}"/>
   1.718 +        <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}, module-info.java" sourcepath="${src.dir}"/>
   1.719      </target>
   1.720      <target name="-post-compile-single">
   1.721          <!-- Empty placeholder for easier customization. -->
   1.722 @@ -963,21 +1136,40 @@
   1.723          <!-- Empty placeholder for easier customization. -->
   1.724          <!-- You can override this target in the ../build.xml file. -->
   1.725      </target>
   1.726 +    <target depends="init,compile" name="-check-module-main-class">
   1.727 +        <pathconvert property="main.class.file">
   1.728 +            <string value="${main.class}"/>
   1.729 +            <unpackagemapper from="*" to="*.class"/>
   1.730 +        </pathconvert>
   1.731 +        <condition property="do.module.main.class">
   1.732 +            <and>
   1.733 +                <isset property="main.class.available"/>
   1.734 +                <available file="${build.classes.dir}/module-info.class"/>
   1.735 +                <available file="${build.classes.dir}/${main.class.file}"/>
   1.736 +                <isset property="libs.CopyLibs.classpath"/>
   1.737 +                <available classname="org.netbeans.modules.java.j2seproject.moduletask.ModuleMainClass" classpath="${libs.CopyLibs.classpath}"/>
   1.738 +            </and>
   1.739 +        </condition>
   1.740 +    </target>
   1.741 +    <target depends="-check-module-main-class" if="do.module.main.class" name="-set-module-main-class">
   1.742 +        <taskdef classname="org.netbeans.modules.java.j2seproject.moduletask.ModuleMainClass" classpath="${libs.CopyLibs.classpath}" name="modulemainclass"/>
   1.743 +        <modulemainclass failonerror="false" mainclass="${main.class}" moduleinfo="${build.classes.dir}/module-info.class"/>
   1.744 +    </target>
   1.745      <target depends="init" if="do.archive" name="-do-jar-create-manifest" unless="manifest.available">
   1.746          <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
   1.747          <touch file="${tmp.manifest.file}" verbose="false"/>
   1.748      </target>
   1.749      <target depends="init" if="do.archive+manifest.available" name="-do-jar-copy-manifest">
   1.750          <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
   1.751 -        <copy file="${manifest.file}" tofile="${tmp.manifest.file}"/>
   1.752 +        <copy encoding="${manifest.encoding}" file="${manifest.file}" outputencoding="UTF-8" tofile="${tmp.manifest.file}"/>
   1.753      </target>
   1.754      <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+main.class.available" name="-do-jar-set-mainclass">
   1.755 -        <manifest file="${tmp.manifest.file}" mode="update">
   1.756 +        <manifest encoding="UTF-8" file="${tmp.manifest.file}" mode="update">
   1.757              <attribute name="Main-Class" value="${main.class}"/>
   1.758          </manifest>
   1.759      </target>
   1.760      <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+profile.available" name="-do-jar-set-profile">
   1.761 -        <manifest file="${tmp.manifest.file}" mode="update">
   1.762 +        <manifest encoding="UTF-8" file="${tmp.manifest.file}" mode="update">
   1.763              <attribute name="Profile" value="${javac.profile}"/>
   1.764          </manifest>
   1.765      </target>
   1.766 @@ -985,25 +1177,65 @@
   1.767          <basename file="${application.splash}" property="splashscreen.basename"/>
   1.768          <mkdir dir="${build.classes.dir}/META-INF"/>
   1.769          <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
   1.770 -        <manifest file="${tmp.manifest.file}" mode="update">
   1.771 +        <manifest encoding="UTF-8" file="${tmp.manifest.file}" mode="update">
   1.772              <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
   1.773          </manifest>
   1.774      </target>
   1.775 -    <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.776 +    <target depends="init,compile" name="-check-do-mkdist">
   1.777 +        <condition property="do.mkdist">
   1.778 +            <and>
   1.779 +                <isset property="do.archive"/>
   1.780 +                <isset property="libs.CopyLibs.classpath"/>
   1.781 +                <not>
   1.782 +                    <istrue value="${mkdist.disabled}"/>
   1.783 +                </not>
   1.784 +                <not>
   1.785 +                    <available file="${build.classes.dir}/module-info.class"/>
   1.786 +                </not>
   1.787 +            </and>
   1.788 +        </condition>
   1.789 +    </target>
   1.790 +    <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,-check-do-mkdist" if="do.mkdist" name="-do-jar-copylibs">
   1.791          <j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
   1.792          <echo level="info">To run this application from the command line without Ant, try:</echo>
   1.793          <property location="${dist.jar}" name="dist.jar.resolved"/>
   1.794          <echo level="info">java -jar "${dist.jar.resolved}"</echo>
   1.795      </target>
   1.796 -    <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.797 +    <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,-check-do-mkdist" if="do.archive" name="-do-jar-jar" unless="do.mkdist">
   1.798          <j2seproject1:jar manifest="${tmp.manifest.file}"/>
   1.799          <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
   1.800          <property location="${dist.jar}" name="dist.jar.resolved"/>
   1.801 +        <condition else="${dist.jar.resolved}" property="jar.usage.message.class.path.replacement" value="">
   1.802 +            <isset property="named.module.internal"/>
   1.803 +        </condition>
   1.804          <pathconvert property="run.classpath.with.dist.jar">
   1.805              <path path="${run.classpath}"/>
   1.806 +            <map from="${build.classes.dir.resolved}" to="${jar.usage.message.class.path.replacement}"/>
   1.807 +        </pathconvert>
   1.808 +        <pathconvert property="run.modulepath.with.dist.jar">
   1.809 +            <path location="${dist.jar.resolved}"/>
   1.810 +            <path path="${run.modulepath}"/>
   1.811              <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
   1.812          </pathconvert>
   1.813 -        <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.814 +        <condition else="${run.modulepath}" property="jar.usage.message.run.modulepath.with.dist.jar" value="${run.modulepath.with.dist.jar}">
   1.815 +            <isset property="named.module.internal"/>
   1.816 +        </condition>
   1.817 +        <condition else="" property="jar.usage.message.module.path" value=" -p ${jar.usage.message.run.modulepath.with.dist.jar}">
   1.818 +            <and>
   1.819 +                <isset property="modules.supported.internal"/>
   1.820 +                <length length="0" string="${jar.usage.message.run.modulepath.with.dist.jar}" when="greater"/>
   1.821 +            </and>
   1.822 +        </condition>
   1.823 +        <condition else="" property="jar.usage.message.class.path" value=" -cp ${run.classpath.with.dist.jar}">
   1.824 +            <length length="0" string="${run.classpath.with.dist.jar}" when="greater"/>
   1.825 +        </condition>
   1.826 +        <condition else="/${main.class}" property="jar.usage.message.main.class.class.selector" value="">
   1.827 +            <isset property="do.module.main.class"/>
   1.828 +        </condition>
   1.829 +        <condition else=" ${main.class}" property="jar.usage.message.main.class" value=" -m ${module.name}${jar.usage.message.main.class.class.selector}">
   1.830 +            <isset property="named.module.internal"/>
   1.831 +        </condition>
   1.832 +        <condition else="" property="jar.usage.message" value="To run this application from the command line without Ant, try:${line.separator}${platform.java}${jar.usage.message.module.path}${jar.usage.message.class.path}${jar.usage.message.main.class}">
   1.833              <isset property="main.class.available"/>
   1.834          </condition>
   1.835          <condition else="debug" property="jar.usage.level" value="info">
   1.836 @@ -1022,8 +1254,73 @@
   1.837          <!-- Empty placeholder for easier customization. -->
   1.838          <!-- You can override this target in the ../build.xml file. -->
   1.839      </target>
   1.840 -    <target depends="init,compile,-pre-jar,-do-jar-without-libraries,-do-jar-with-libraries,-post-jar" name="-do-jar"/>
   1.841 -    <target depends="init,compile,-pre-jar,-do-jar,-post-jar" description="Build JAR." name="jar"/>
   1.842 +    <target depends="init,compile,-pre-jar,-set-module-main-class,-do-jar-without-libraries,-do-jar-with-libraries,-post-jar" name="-do-jar"/>
   1.843 +    <target depends="init,compile,-pre-jar,-do-jar,-post-jar,deploy" description="Build JAR." name="jar"/>
   1.844 +    <!--
   1.845 +                =================
   1.846 +                DEPLOY SECTION
   1.847 +                =================
   1.848 +            -->
   1.849 +    <target name="-pre-deploy">
   1.850 +        <!-- Empty placeholder for easier customization. -->
   1.851 +        <!-- You can override this target in the ../build.xml file. -->
   1.852 +    </target>
   1.853 +    <target depends="init" name="-check-jlink">
   1.854 +        <condition property="do.jlink.internal">
   1.855 +            <and>
   1.856 +                <istrue value="${do.jlink}"/>
   1.857 +                <isset property="do.archive"/>
   1.858 +                <isset property="named.module.internal"/>
   1.859 +            </and>
   1.860 +        </condition>
   1.861 +    </target>
   1.862 +    <target depends="init,-do-jar,-post-jar,-pre-deploy,-check-jlink" if="do.jlink.internal" name="-do-deploy">
   1.863 +        <delete dir="${dist.jlink.dir}" failonerror="false" quiet="true"/>
   1.864 +        <property name="jlink.launcher.name" value="${application.title}"/>
   1.865 +        <condition else="${module.name}" property="jlink.add.modules" value="${module.name},${jlink.additionalmodules}">
   1.866 +            <and>
   1.867 +                <isset property="jlink.additionalmodules"/>
   1.868 +                <length length="0" string="${jlink.additionalmodules}" when="greater"/>
   1.869 +            </and>
   1.870 +        </condition>
   1.871 +        <condition property="jlink.do.strip.internal">
   1.872 +            <and>
   1.873 +                <isset property="jlink.strip"/>
   1.874 +                <istrue value="${jlink.strip}"/>
   1.875 +            </and>
   1.876 +        </condition>
   1.877 +        <condition property="jlink.do.additionalparam.internal">
   1.878 +            <and>
   1.879 +                <isset property="jlink.additionalparam"/>
   1.880 +                <length length="0" string="${jlink.additionalparam}" when="greater"/>
   1.881 +            </and>
   1.882 +        </condition>
   1.883 +        <condition property="jlink.do.launcher.internal">
   1.884 +            <and>
   1.885 +                <istrue value="${jlink.launcher}"/>
   1.886 +                <isset property="main.class.available"/>
   1.887 +            </and>
   1.888 +        </condition>
   1.889 +        <property name="platform.jlink" value="${jdk.home}/bin/jlink"/>
   1.890 +        <property name="jlink.systemmodules.internal" value="${jdk.home}/jmods"/>
   1.891 +        <exec executable="${platform.jlink}">
   1.892 +            <arg value="--module-path"/>
   1.893 +            <arg path="${jlink.systemmodules.internal}:${run.modulepath}:${dist.jar}"/>
   1.894 +            <arg value="--add-modules"/>
   1.895 +            <arg value="${jlink.add.modules}"/>
   1.896 +            <arg if:set="jlink.do.strip.internal" value="--strip-debug"/>
   1.897 +            <arg if:set="jlink.do.launcher.internal" value="--launcher"/>
   1.898 +            <arg if:set="jlink.do.launcher.internal" value="${jlink.launcher.name}=${module.name}/${main.class}"/>
   1.899 +            <arg if:set="jlink.do.additionalparam.internal" line="${jlink.additionalparam}"/>
   1.900 +            <arg value="--output"/>
   1.901 +            <arg value="${dist.jlink.output}"/>
   1.902 +        </exec>
   1.903 +    </target>
   1.904 +    <target name="-post-deploy">
   1.905 +        <!-- Empty placeholder for easier customization. -->
   1.906 +        <!-- You can override this target in the ../build.xml file. -->
   1.907 +    </target>
   1.908 +    <target depends="-do-jar,-post-jar,-pre-deploy,-do-deploy,-post-deploy" name="deploy"/>
   1.909      <!--
   1.910                  =================
   1.911                  EXECUTION SECTION
   1.912 @@ -1060,9 +1357,9 @@
   1.913      </target>
   1.914      <target depends="init,compile" name="-debug-start-debuggee">
   1.915          <j2seproject3:debug>
   1.916 -            <customize>
   1.917 +            <customizeDebuggee>
   1.918                  <arg line="${application.args}"/>
   1.919 -            </customize>
   1.920 +            </customizeDebuggee>
   1.921          </j2seproject3:debug>
   1.922      </target>
   1.923      <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/>
   1.924 @@ -1128,28 +1425,24 @@
   1.925              </customize>
   1.926          </profile>
   1.927      </target>
   1.928 -    <target depends="profile-init,compile-test-single" if="profiler.info.jvmargs.agent" name="-profile-test-single-pre72">
   1.929 +    <target depends="-init-macrodef-junit,profile-init,compile-test-single" if="profiler.info.jvmargs.agent" name="-profile-test-single-pre72">
   1.930          <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
   1.931          <nbprofiledirect>
   1.932              <classpath>
   1.933                  <path path="${run.test.classpath}"/>
   1.934              </classpath>
   1.935          </nbprofiledirect>
   1.936 -        <junit dir="${profiler.info.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" jvm="${profiler.info.jvm}" showoutput="true">
   1.937 -            <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
   1.938 -            <jvmarg value="${profiler.info.jvmargs.agent}"/>
   1.939 -            <jvmarg line="${profiler.info.jvmargs}"/>
   1.940 -            <test name="${profile.class}"/>
   1.941 -            <classpath>
   1.942 -                <path path="${run.test.classpath}"/>
   1.943 -            </classpath>
   1.944 -            <syspropertyset>
   1.945 -                <propertyref prefix="test-sys-prop."/>
   1.946 -                <mapper from="test-sys-prop.*" to="*" type="glob"/>
   1.947 -            </syspropertyset>
   1.948 -            <formatter type="brief" usefile="false"/>
   1.949 -            <formatter type="xml"/>
   1.950 -        </junit>
   1.951 +        <j2seproject3:junit excludes="${excludes}" includes="${includes}" testincludes="${profile.class}" testmethods="">
   1.952 +            <customize>
   1.953 +                <jvmarg value="-agentlib:jdwp=transport=${debug-transport},address=${jpda.address}"/>
   1.954 +                <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
   1.955 +                <jvmarg value="${profiler.info.jvmargs.agent}"/>
   1.956 +                <jvmarg line="${profiler.info.jvmargs}"/>
   1.957 +                <classpath>
   1.958 +                    <path path="${run.test.classpath}"/>
   1.959 +                </classpath>
   1.960 +            </customize>
   1.961 +        </j2seproject3:junit>
   1.962      </target>
   1.963      <!--
   1.964                  end of pre NB72 profiling section
   1.965 @@ -1180,7 +1473,7 @@
   1.966      <target depends="-profile-check" description="Profile a selected class in the IDE." if="profiler.configured" name="profile-test-with-main">
   1.967          <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
   1.968          <startprofiler/>
   1.969 -        <antcal target="run-test-with-main"/>
   1.970 +        <antcall target="run-test-with-main"/>
   1.971      </target>
   1.972      <target depends="-profile-check,-profile-applet-pre72" if="profiler.configured" name="profile-applet" unless="profiler.info.jvmargs.agent">
   1.973          <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
   1.974 @@ -1205,6 +1498,12 @@
   1.975          <condition else="" property="bug5101868workaround" value="*.java">
   1.976              <matches pattern="1\.[56](\..*)?" string="${java.version}"/>
   1.977          </condition>
   1.978 +        <condition else="" property="javadoc.html5.cmd.line.arg" value="-html5">
   1.979 +            <and>
   1.980 +                <isset property="javadoc.html5"/>
   1.981 +                <available file="${jdk.home}${file.separator}lib${file.separator}jrt-fs.jar"/>
   1.982 +            </and>
   1.983 +        </condition>
   1.984          <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.985              <classpath>
   1.986                  <path path="${javac.classpath}"/>
   1.987 @@ -1217,6 +1516,7 @@
   1.988                  <exclude name="*.java"/>
   1.989              </fileset>
   1.990              <arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/>
   1.991 +            <arg line="${javadoc.html5.cmd.line.arg}"/>
   1.992          </javadoc>
   1.993          <copy todir="${dist.javadoc.dir}">
   1.994              <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
   1.995 @@ -1243,11 +1543,63 @@
   1.996          <!-- Empty placeholder for easier customization. -->
   1.997          <!-- You can override this target in the ../build.xml file. -->
   1.998      </target>
   1.999 +    <target depends="-init-source-module-properties" if="named.module.internal" name="-init-test-javac-module-properties-with-module">
  1.1000 +        <j2seproject3:modulename property="test.module.name" sourcepath="${test.src.dir}"/>
  1.1001 +        <condition else="${empty.dir}" property="javac.test.sourcepath" value="${test.src.dir}">
  1.1002 +            <and>
  1.1003 +                <isset property="test.module.name"/>
  1.1004 +                <length length="0" string="${test.module.name}" when="greater"/>
  1.1005 +            </and>
  1.1006 +        </condition>
  1.1007 +        <condition else="--patch-module ${module.name}=${test.src.dir} --add-reads ${module.name}=ALL-UNNAMED" property="javac.test.compilerargs" value="--add-reads ${test.module.name}=ALL-UNNAMED">
  1.1008 +            <and>
  1.1009 +                <isset property="test.module.name"/>
  1.1010 +                <length length="0" string="${test.module.name}" when="greater"/>
  1.1011 +            </and>
  1.1012 +        </condition>
  1.1013 +    </target>
  1.1014 +    <target depends="-init-source-module-properties" if="named.module.internal" name="-init-test-run-module-properties">
  1.1015 +        <condition else="${module.name}" property="run.test.addexport.source.module.internal" value="${test.module.name}">
  1.1016 +            <and>
  1.1017 +                <isset property="test.module.name"/>
  1.1018 +                <length length="0" string="${test.module.name}" when="greater"/>
  1.1019 +            </and>
  1.1020 +        </condition>
  1.1021 +        <fileset dir="${build.test.classes.dir}" id="run.test.packages.internal" includes="**/*.class"/>
  1.1022 +        <property location="${build.test.classes.dir}" name="build.test.classes.dir.abs.internal"/>
  1.1023 +        <pathconvert pathsep=" " property="run.test.addexports.internal" refid="run.test.packages.internal">
  1.1024 +            <chainedmapper>
  1.1025 +                <regexpmapper from="^(.*)\Q${file.separator}\E.*\.class$$" to="\1"/>
  1.1026 +                <filtermapper>
  1.1027 +                    <uniqfilter/>
  1.1028 +                    <replacestring from="${build.test.classes.dir.abs.internal}" to=""/>
  1.1029 +                </filtermapper>
  1.1030 +                <cutdirsmapper dirs="1"/>
  1.1031 +                <packagemapper from="*" to="--add-exports ${run.test.addexport.source.module.internal}/*=ALL-UNNAMED"/>
  1.1032 +            </chainedmapper>
  1.1033 +        </pathconvert>
  1.1034 +        <condition else="--patch-module ${module.name}=${build.test.classes.dir} --add-modules ${module.name} --add-reads ${module.name}=ALL-UNNAMED ${run.test.addexports.internal}" property="run.test.jvmargs" value="--add-modules ${test.module.name} --add-reads ${test.module.name}=ALL-UNNAMED ${run.test.addexports.internal}">
  1.1035 +            <and>
  1.1036 +                <isset property="test.module.name"/>
  1.1037 +                <length length="0" string="${test.module.name}" when="greater"/>
  1.1038 +            </and>
  1.1039 +        </condition>
  1.1040 +    </target>
  1.1041 +    <target depends="-init-source-module-properties" name="-init-test-module-properties-without-module" unless="named.module.internal">
  1.1042 +        <property name="javac.test.sourcepath" value="${empty.dir}"/>
  1.1043 +        <property name="javac.test.compilerargs" value=""/>
  1.1044 +        <property name="run.test.jvmargs" value=""/>
  1.1045 +    </target>
  1.1046 +    <target depends="-init-test-javac-module-properties-with-module,-init-test-module-properties-without-module" name="-init-test-module-properties"/>
  1.1047      <target if="do.depend.true" name="-compile-test-depend">
  1.1048          <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
  1.1049      </target>
  1.1050 -    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
  1.1051 -        <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.1052 +    <target depends="init,deps-jar,compile,-init-test-module-properties,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
  1.1053 +        <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" modulepath="${javac.test.modulepath}" processorpath="${javac.test.processorpath}" sourcepath="${javac.test.sourcepath}" srcdir="${test.src.dir}">
  1.1054 +            <customize>
  1.1055 +                <compilerarg line="${javac.test.compilerargs}"/>
  1.1056 +            </customize>
  1.1057 +        </j2seproject3:javac>
  1.1058          <copy todir="${build.test.classes.dir}">
  1.1059              <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
  1.1060          </copy>
  1.1061 @@ -1261,10 +1613,14 @@
  1.1062          <!-- Empty placeholder for easier customization. -->
  1.1063          <!-- You can override this target in the ../build.xml file. -->
  1.1064      </target>
  1.1065 -    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
  1.1066 +    <target depends="init,deps-jar,compile,-init-test-module-properties,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
  1.1067          <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
  1.1068          <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
  1.1069 -        <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.1070 +        <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}, module-info.java" modulepath="${javac.test.modulepath}" processorpath="${javac.test.processorpath}" sourcepath="${test.src.dir}" srcdir="${test.src.dir}">
  1.1071 +            <customize>
  1.1072 +                <compilerarg line="${javac.test.compilerargs}"/>
  1.1073 +            </customize>
  1.1074 +        </j2seproject3:javac>
  1.1075          <copy todir="${build.test.classes.dir}">
  1.1076              <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
  1.1077          </copy>
  1.1078 @@ -1282,7 +1638,7 @@
  1.1079      <target depends="init" if="have.tests" name="-pre-test-run">
  1.1080          <mkdir dir="${build.test.results.dir}"/>
  1.1081      </target>
  1.1082 -    <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
  1.1083 +    <target depends="init,compile-test,-init-test-run-module-properties,-pre-test-run" if="have.tests" name="-do-test-run">
  1.1084          <j2seproject3:test includes="${includes}" testincludes="**/*Test.java"/>
  1.1085      </target>
  1.1086      <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
  1.1087 @@ -1294,14 +1650,14 @@
  1.1088      <target depends="init" if="have.tests" name="-pre-test-run-single">
  1.1089          <mkdir dir="${build.test.results.dir}"/>
  1.1090      </target>
  1.1091 -    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
  1.1092 +    <target depends="init,compile-test-single,-init-test-run-module-properties,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
  1.1093          <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
  1.1094          <j2seproject3:test excludes="" includes="${test.includes}" testincludes="${test.includes}"/>
  1.1095      </target>
  1.1096      <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
  1.1097          <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
  1.1098      </target>
  1.1099 -    <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.1100 +    <target depends="init,compile-test-single,-init-test-run-module-properties,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/>
  1.1101      <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single-method">
  1.1102          <fail unless="test.class">Must select some files in the IDE or set test.class</fail>
  1.1103          <fail unless="test.method">Must select some method in the IDE or set test.method</fail>
  1.1104 @@ -1310,7 +1666,7 @@
  1.1105      <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.1106          <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
  1.1107      </target>
  1.1108 -    <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.1109 +    <target depends="init,compile-test-single,-init-test-run-module-properties,-pre-test-run-single,-do-test-run-single-method,-post-test-run-single-method" description="Run single unit test." name="test-single-method"/>
  1.1110      <!--
  1.1111                  =======================
  1.1112                  TEST DEBUGGING SECTION
  1.1113 @@ -1328,8 +1684,8 @@
  1.1114      <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
  1.1115          <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
  1.1116      </target>
  1.1117 -    <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
  1.1118 -    <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test-method" name="debug-test-method"/>
  1.1119 +    <target depends="init,compile-test-single,-init-test-run-module-properties,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
  1.1120 +    <target depends="init,compile-test-single,-init-test-run-module-properties,-debug-start-debugger-test,-debug-start-debuggee-test-method" name="debug-test-method"/>
  1.1121      <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
  1.1122          <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
  1.1123      </target>
  1.1124 @@ -1355,9 +1711,9 @@
  1.1125      <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet">
  1.1126          <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
  1.1127          <j2seproject3:debug classname="sun.applet.AppletViewer">
  1.1128 -            <customize>
  1.1129 +            <customizeDebuggee>
  1.1130                  <arg value="${applet.url}"/>
  1.1131 -            </customize>
  1.1132 +            </customizeDebuggee>
  1.1133          </j2seproject3:debug>
  1.1134      </target>
  1.1135      <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/>
  1.1136 @@ -1384,6 +1740,7 @@
  1.1137      </target>
  1.1138      <target depends="init" name="-do-clean">
  1.1139          <delete dir="${build.dir}"/>
  1.1140 +        <delete dir="${dist.jlink.output}"/>
  1.1141          <delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/>
  1.1142      </target>
  1.1143      <target name="-post-clean">
     2.1 --- a/samples/aserverinfo/nbproject/genfiles.properties	Mon Nov 11 05:47:32 2019 +0100
     2.2 +++ b/samples/aserverinfo/nbproject/genfiles.properties	Mon Nov 11 13:17:34 2019 +0100
     2.3 @@ -1,8 +1,8 @@
     2.4  build.xml.data.CRC32=c82747ea
     2.5  build.xml.script.CRC32=6c4c58c4
     2.6 -build.xml.stylesheet.CRC32=8064a381@1.75.2.48
     2.7 +build.xml.stylesheet.CRC32=f85dc8f2@1.93.0.48
     2.8  # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
     2.9  # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
    2.10  nbproject/build-impl.xml.data.CRC32=c82747ea
    2.11 -nbproject/build-impl.xml.script.CRC32=ec37325a
    2.12 -nbproject/build-impl.xml.stylesheet.CRC32=876e7a8f@1.75.2.48
    2.13 +nbproject/build-impl.xml.script.CRC32=8f5f6e5f
    2.14 +nbproject/build-impl.xml.stylesheet.CRC32=f89f7d21@1.93.0.48
     3.1 --- a/samples/aserverinfo/nbproject/project.properties	Mon Nov 11 05:47:32 2019 +0100
     3.2 +++ b/samples/aserverinfo/nbproject/project.properties	Mon Nov 11 13:17:34 2019 +0100
     3.3 @@ -1,66 +1,61 @@
     3.4 +#Mon Nov 11 13:03:28 CET 2019
     3.5 +excludes=
     3.6 +javac.deprecation=false
     3.7 +file.reference.org-netbeans-modules-nbjunit.jar=../libs/dist/org-netbeans-modules-nbjunit.jar
     3.8 +build.test.results.dir=${build.dir}/test/results
     3.9 +run.classpath=${javac.classpath}\:${build.classes.dir}
    3.10 +javadoc.nonavbar=false
    3.11 +javac.test.modulepath=${javac.modulepath}
    3.12 +run.test.classpath=${javac.test.classpath}\:${build.test.classes.dir}
    3.13 +javac.target=1.6
    3.14 +javadoc.noindex=false
    3.15 +javac.processormodulepath=
    3.16 +javadoc.additionalparam=
    3.17 +includes=**
    3.18  build.classes.dir=${build.dir}/classes
    3.19 +source.encoding=UTF-8
    3.20 +javadoc.author=false
    3.21 +test.src.dir=test
    3.22 +build.dir=build
    3.23 +build.test.classes.dir=${build.dir}/test/classes
    3.24 +run.modulepath=${javac.modulepath}
    3.25 +platform.active=default_platform
    3.26 +javac.compilerargs=
    3.27 +dist.jar=${dist.dir}/aserverinfo.jar
    3.28 +javadoc.use=true
    3.29 +build.sysclasspath=ignore
    3.30 +debug.test.classpath=${run.test.classpath}
    3.31 +dist.dir=dist
    3.32  build.classes.excludes=**/*.java,**/*.form
    3.33 -# This directory is removed when the project is cleaned:
    3.34 -build.dir=build
    3.35 +javadoc.splitindex=true
    3.36 +javadoc.encoding=${source.encoding}
    3.37 +javac.source=1.6
    3.38 +javac.modulepath=
    3.39 +junit.selected.version=3
    3.40 +file.reference.junit-4.4.jar=../libs/dist/junit-4.4.jar
    3.41 +debug.classpath=${run.classpath}
    3.42 +run.jvmargs=
    3.43 +run.test.modulepath=${javac.test.modulepath}
    3.44  build.generated.dir=${build.dir}/generated
    3.45 -build.generated.sources.dir=${build.dir}/generated-sources
    3.46 -# Only compile against the classpath explicitly listed here:
    3.47 -build.sysclasspath=ignore
    3.48 -build.test.classes.dir=${build.dir}/test/classes
    3.49 -build.test.results.dir=${build.dir}/test/results
    3.50 -debug.classpath=\
    3.51 -    ${run.classpath}
    3.52 -debug.test.classpath=\
    3.53 -    ${run.test.classpath}
    3.54 -# This directory is removed when the project is cleaned:
    3.55 -dist.dir=dist
    3.56 -dist.jar=${dist.dir}/aserverinfo.jar
    3.57 -dist.javadoc.dir=${dist.dir}/javadoc
    3.58 -excludes=
    3.59 -file.reference.junit-4.4.jar=../libs/dist/junit-4.4.jar
    3.60 -file.reference.org-netbeans-insane.jar=../libs/dist/org-netbeans-insane.jar
    3.61 -file.reference.org-netbeans-modules-nbjunit.jar=../libs/dist/org-netbeans-modules-nbjunit.jar
    3.62 -file.reference.org-openide-util-lookup.jar=../libs/dist/org-openide-util-lookup.jar
    3.63 -includes=**
    3.64  jar.compress=false
    3.65 -javac.classpath=\
    3.66 -    ${file.reference.org-openide-util-lookup.jar}
    3.67 -# Space-separated list of extra javac options
    3.68 -javac.compilerargs=
    3.69 -javac.deprecation=false
    3.70 -javac.source=1.5
    3.71 -javac.target=1.5
    3.72  javac.test.classpath=\
    3.73      ${javac.classpath}:\
    3.74      ${build.classes.dir}:\
    3.75 -    ${libs.junit.classpath}:\
    3.76      ${libs.junit_4.classpath}:\
    3.77      ${file.reference.org-netbeans-modules-nbjunit.jar}:\
    3.78      ${file.reference.org-netbeans-insane.jar}:\
    3.79 -    ${file.reference.junit-4.4.jar}
    3.80 -javadoc.additionalparam=
    3.81 -javadoc.author=false
    3.82 -javadoc.encoding=${source.encoding}
    3.83 -javadoc.noindex=false
    3.84 -javadoc.nonavbar=false
    3.85 -javadoc.notree=false
    3.86 +    ${file.reference.junit-4.4.jar}:\
    3.87 +    ${libs.hamcrest.classpath}
    3.88  javadoc.private=false
    3.89 -javadoc.splitindex=true
    3.90 -javadoc.use=true
    3.91 +file.reference.org-openide-util-lookup.jar=../libs/dist/org-openide-util-lookup.jar
    3.92 +debug.test.modulepath=${run.test.modulepath}
    3.93 +meta.inf.dir=${src.dir}/META-INF
    3.94 +dist.javadoc.dir=${dist.dir}/javadoc
    3.95 +src.dir=src
    3.96 +debug.modulepath=${run.modulepath}
    3.97 +javac.classpath=${file.reference.org-openide-util-lookup.jar}
    3.98 +build.generated.sources.dir=${build.dir}/generated-sources
    3.99  javadoc.version=false
   3.100  javadoc.windowtitle=
   3.101 -meta.inf.dir=${src.dir}/META-INF
   3.102 -platform.active=default_platform
   3.103 -run.classpath=\
   3.104 -    ${javac.classpath}:\
   3.105 -    ${build.classes.dir}
   3.106 -# Space-separated list of JVM arguments used when running the project
   3.107 -# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
   3.108 -# or test-sys-prop.name=value to set system properties for unit tests):
   3.109 -run.jvmargs=
   3.110 -run.test.classpath=\
   3.111 -    ${javac.test.classpath}:\
   3.112 -    ${build.test.classes.dir}
   3.113 -source.encoding=UTF-8
   3.114 -src.dir=src
   3.115 -test.src.dir=test
   3.116 +javadoc.notree=false
   3.117 +file.reference.org-netbeans-insane.jar=../libs/dist/org-netbeans-insane.jar
     4.1 --- a/samples/cloneproblem/build.xml	Mon Nov 11 05:47:32 2019 +0100
     4.2 +++ b/samples/cloneproblem/build.xml	Mon Nov 11 13:17:34 2019 +0100
     4.3 @@ -51,8 +51,7 @@
     4.4        -init-macrodef-junit:     defines macro for junit execution
     4.5        -init-macrodef-debug:     defines macro for class debugging
     4.6        -init-macrodef-java:      defines macro for class execution
     4.7 -      -do-jar-with-manifest:    JAR building (if you are using a manifest)
     4.8 -      -do-jar-without-manifest: JAR building (if you are not using a manifest)
     4.9 +      -do-jar:                  JAR building
    4.10        run:                      execution of project 
    4.11        -javadoc-build:           Javadoc generation
    4.12        test-report:              JUnit report generation
     5.1 --- a/samples/cloneproblem/nbproject/build-impl.xml	Mon Nov 11 05:47:32 2019 +0100
     5.2 +++ b/samples/cloneproblem/nbproject/build-impl.xml	Mon Nov 11 13:17:34 2019 +0100
     5.3 @@ -12,18 +12,18 @@
     5.4    - execution
     5.5    - debugging
     5.6    - javadoc
     5.7 -  - junit compilation
     5.8 -  - junit execution
     5.9 -  - junit debugging
    5.10 +  - test compilation
    5.11 +  - test execution
    5.12 +  - test debugging
    5.13    - applet
    5.14    - cleanup
    5.15  
    5.16          -->
    5.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="cloneproblem-impl">
    5.18 -    <fail message="Please build using Ant 1.7.1 or higher.">
    5.19 +<project xmlns:if="ant:if" 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" xmlns:unless="ant:unless" basedir=".." default="default" name="cloneproblem-impl">
    5.20 +    <fail message="Please build using Ant 1.8.0 or higher.">
    5.21          <condition>
    5.22              <not>
    5.23 -                <antversion atleast="1.7.1"/>
    5.24 +                <antversion atleast="1.8.0"/>
    5.25              </not>
    5.26          </condition>
    5.27      </fail>
    5.28 @@ -46,14 +46,80 @@
    5.29          <property file="${user.properties.file}"/>
    5.30          <!-- The two properties below are usually overridden -->
    5.31          <!-- by the active platform. Just a fallback. -->
    5.32 -        <property name="default.javac.source" value="1.4"/>
    5.33 -        <property name="default.javac.target" value="1.4"/>
    5.34 +        <property name="default.javac.source" value="1.6"/>
    5.35 +        <property name="default.javac.target" value="1.6"/>
    5.36      </target>
    5.37      <target depends="-pre-init,-init-private,-init-user" name="-init-project">
    5.38          <property file="nbproject/configs/${config}.properties"/>
    5.39          <property file="nbproject/project.properties"/>
    5.40      </target>
    5.41 -    <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init">
    5.42 +    <target name="-init-modules-supported">
    5.43 +        <condition property="modules.supported.internal" value="true">
    5.44 +            <not>
    5.45 +                <matches pattern="1\.[0-8](\..*)?" string="${javac.source}"/>
    5.46 +            </not>
    5.47 +        </condition>
    5.48 +    </target>
    5.49 +    <target depends="-init-modules-supported" if="modules.supported.internal" name="-init-macrodef-modulename">
    5.50 +        <macrodef name="modulename" uri="http://www.netbeans.org/ns/j2se-project/3">
    5.51 +            <attribute name="property"/>
    5.52 +            <attribute name="sourcepath"/>
    5.53 +            <sequential>
    5.54 +                <loadresource property="@{property}" quiet="true">
    5.55 +                    <javaresource classpath="@{sourcepath}" name="module-info.java" parentFirst="false"/>
    5.56 +                    <filterchain>
    5.57 +                        <stripjavacomments/>
    5.58 +                        <linecontainsregexp>
    5.59 +                            <regexp pattern="module .* \{"/>
    5.60 +                        </linecontainsregexp>
    5.61 +                        <tokenfilter>
    5.62 +                            <linetokenizer/>
    5.63 +                            <replaceregex flags="s" pattern="(\s*module\s+)(\S*)(\s*\{.*)" replace="\2"/>
    5.64 +                        </tokenfilter>
    5.65 +                        <striplinebreaks/>
    5.66 +                    </filterchain>
    5.67 +                </loadresource>
    5.68 +            </sequential>
    5.69 +        </macrodef>
    5.70 +    </target>
    5.71 +    <target depends="-init-modules-supported,-init-macrodef-modulename" if="modules.supported.internal" name="-init-source-module-properties">
    5.72 +        <fail message="Java 9 support requires Ant 1.10.0 or higher.">
    5.73 +            <condition>
    5.74 +                <not>
    5.75 +                    <antversion atleast="1.10.0"/>
    5.76 +                </not>
    5.77 +            </condition>
    5.78 +        </fail>
    5.79 +        <j2seproject3:modulename property="module.name" sourcepath="${src.dir}"/>
    5.80 +        <condition property="named.module.internal">
    5.81 +            <and>
    5.82 +                <isset property="module.name"/>
    5.83 +                <length length="0" string="${module.name}" when="greater"/>
    5.84 +            </and>
    5.85 +        </condition>
    5.86 +        <condition property="unnamed.module.internal">
    5.87 +            <not>
    5.88 +                <isset property="named.module.internal"/>
    5.89 +            </not>
    5.90 +        </condition>
    5.91 +        <property name="javac.modulepath" value=""/>
    5.92 +        <property name="run.modulepath" value="${javac.modulepath}"/>
    5.93 +        <property name="module.build.classes.dir" value="${build.classes.dir}"/>
    5.94 +        <property name="debug.modulepath" value="${run.modulepath}"/>
    5.95 +        <property name="javac.upgrademodulepath" value=""/>
    5.96 +        <property name="run.upgrademodulepath" value="${javac.upgrademodulepath}"/>
    5.97 +        <condition else="" property="javac.systemmodulepath.cmd.line.arg" value="--system '${javac.systemmodulepath}'">
    5.98 +            <and>
    5.99 +                <isset property="javac.systemmodulepath"/>
   5.100 +                <length length="0" string="${javac.systemmodulepath}" when="greater"/>
   5.101 +            </and>
   5.102 +        </condition>
   5.103 +        <property name="dist.jlink.dir" value="${dist.dir}/jlink"/>
   5.104 +        <property name="dist.jlink.output" value="${dist.jlink.dir}/${application.title}"/>
   5.105 +        <property name="module.name" value=""/>
   5.106 +    </target>
   5.107 +    <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property,-init-modules-supported" name="-do-init">
   5.108 +        <property name="platform.java" value="${java.home}/bin/java"/>
   5.109          <available file="${manifest.file}" property="manifest.available"/>
   5.110          <condition property="splashscreen.available">
   5.111              <and>
   5.112 @@ -71,31 +137,22 @@
   5.113                  </not>
   5.114              </and>
   5.115          </condition>
   5.116 -        <condition property="manifest.available+main.class">
   5.117 +        <condition property="profile.available">
   5.118              <and>
   5.119 -                <isset property="manifest.available"/>
   5.120 -                <isset property="main.class.available"/>
   5.121 +                <isset property="javac.profile"/>
   5.122 +                <length length="0" string="${javac.profile}" when="greater"/>
   5.123 +                <not>
   5.124 +                    <matches pattern="1\.[0-7](\..*)?" string="${javac.source}"/>
   5.125 +                </not>
   5.126              </and>
   5.127          </condition>
   5.128          <condition property="do.archive">
   5.129 -            <not>
   5.130 -                <istrue value="${jar.archive.disabled}"/>
   5.131 -            </not>
   5.132 -        </condition>
   5.133 -        <condition property="do.mkdist">
   5.134 -            <and>
   5.135 -                <isset property="do.archive"/>
   5.136 -                <isset property="libs.CopyLibs.classpath"/>
   5.137 +            <or>
   5.138                  <not>
   5.139 -                    <istrue value="${mkdist.disabled}"/>
   5.140 +                    <istrue value="${jar.archive.disabled}"/>
   5.141                  </not>
   5.142 -            </and>
   5.143 -        </condition>
   5.144 -        <condition property="manifest.available+main.class+mkdist.available">
   5.145 -            <and>
   5.146 -                <istrue value="${manifest.available+main.class}"/>
   5.147 -                <isset property="do.mkdist"/>
   5.148 -            </and>
   5.149 +                <istrue value="${not.archive.disabled}"/>
   5.150 +            </or>
   5.151          </condition>
   5.152          <condition property="do.archive+manifest.available">
   5.153              <and>
   5.154 @@ -115,24 +172,12 @@
   5.155                  <istrue value="${do.archive}"/>
   5.156              </and>
   5.157          </condition>
   5.158 -        <condition property="do.archive+manifest.available+main.class">
   5.159 +        <condition property="do.archive+profile.available">
   5.160              <and>
   5.161 -                <istrue value="${manifest.available+main.class}"/>
   5.162 +                <isset property="profile.available"/>
   5.163                  <istrue value="${do.archive}"/>
   5.164              </and>
   5.165          </condition>
   5.166 -        <condition property="manifest.available-mkdist.available">
   5.167 -            <or>
   5.168 -                <istrue value="${manifest.available}"/>
   5.169 -                <isset property="do.mkdist"/>
   5.170 -            </or>
   5.171 -        </condition>
   5.172 -        <condition property="manifest.available+main.class-mkdist.available">
   5.173 -            <or>
   5.174 -                <istrue value="${manifest.available+main.class}"/>
   5.175 -                <isset property="do.mkdist"/>
   5.176 -            </or>
   5.177 -        </condition>
   5.178          <condition property="have.tests">
   5.179              <or>
   5.180                  <available file="${test.src.dir}"/>
   5.181 @@ -156,6 +201,7 @@
   5.182              </and>
   5.183          </condition>
   5.184          <property name="run.jvmargs" value=""/>
   5.185 +        <property name="run.jvmargs.ide" value=""/>
   5.186          <property name="javac.compilerargs" value=""/>
   5.187          <property name="work.dir" value="${basedir}"/>
   5.188          <condition property="no.deps">
   5.189 @@ -168,6 +214,7 @@
   5.190          <property name="application.args" value=""/>
   5.191          <property name="source.encoding" value="${file.encoding}"/>
   5.192          <property name="runtime.encoding" value="${source.encoding}"/>
   5.193 +        <property name="manifest.encoding" value="${source.encoding}"/>
   5.194          <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
   5.195              <and>
   5.196                  <isset property="javadoc.encoding"/>
   5.197 @@ -185,12 +232,56 @@
   5.198          </condition>
   5.199          <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
   5.200          <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
   5.201 -            <length length="0" string="${endorsed.classpath}" when="greater"/>
   5.202 +            <and>
   5.203 +                <isset property="endorsed.classpath"/>
   5.204 +                <not>
   5.205 +                    <equals arg1="${endorsed.classpath}" arg2="" trim="true"/>
   5.206 +                </not>
   5.207 +            </and>
   5.208          </condition>
   5.209 -        <property name="javac.fork" value="true"/>
   5.210 +        <condition else="" property="javac.profile.cmd.line.arg" value="-profile ${javac.profile}">
   5.211 +            <isset property="profile.available"/>
   5.212 +        </condition>
   5.213 +        <condition else="false" property="jdkBug6558476">
   5.214 +            <and>
   5.215 +                <matches pattern="1\.[56]" string="${java.specification.version}"/>
   5.216 +                <not>
   5.217 +                    <os family="unix"/>
   5.218 +                </not>
   5.219 +            </and>
   5.220 +        </condition>
   5.221 +        <condition else="false" property="javac.fork">
   5.222 +            <or>
   5.223 +                <istrue value="${jdkBug6558476}"/>
   5.224 +                <istrue value="${javac.external.vm}"/>
   5.225 +            </or>
   5.226 +        </condition>
   5.227          <property name="jar.index" value="false"/>
   5.228          <property name="jar.index.metainf" value="${jar.index}"/>
   5.229 +        <property name="copylibs.rebase" value="true"/>
   5.230          <available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
   5.231 +        <condition property="junit.available">
   5.232 +            <or>
   5.233 +                <available classname="org.junit.Test" classpath="${run.test.classpath}"/>
   5.234 +                <available classname="junit.framework.Test" classpath="${run.test.classpath}"/>
   5.235 +            </or>
   5.236 +        </condition>
   5.237 +        <condition property="testng.available">
   5.238 +            <available classname="org.testng.annotations.Test" classpath="${run.test.classpath}"/>
   5.239 +        </condition>
   5.240 +        <condition property="junit+testng.available">
   5.241 +            <and>
   5.242 +                <istrue value="${junit.available}"/>
   5.243 +                <istrue value="${testng.available}"/>
   5.244 +            </and>
   5.245 +        </condition>
   5.246 +        <condition else="testng" property="testng.mode" value="mixed">
   5.247 +            <istrue value="${junit+testng.available}"/>
   5.248 +        </condition>
   5.249 +        <condition else="" property="testng.debug.mode" value="-mixed">
   5.250 +            <istrue value="${junit+testng.available}"/>
   5.251 +        </condition>
   5.252 +        <property name="java.failonerror" value="true"/>
   5.253      </target>
   5.254      <target name="-post-init">
   5.255          <!-- Empty placeholder for easier customization. -->
   5.256 @@ -217,11 +308,80 @@
   5.257              </sequential>
   5.258          </macrodef>
   5.259      </target>
   5.260 -    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors">
   5.261 +    <target depends="-init-ap-cmdline-properties,-init-source-module-properties" if="modules.supported.internal" name="-init-macrodef-javac-with-module">
   5.262          <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
   5.263              <attribute default="${src.dir}" name="srcdir"/>
   5.264              <attribute default="${build.classes.dir}" name="destdir"/>
   5.265              <attribute default="${javac.classpath}" name="classpath"/>
   5.266 +            <attribute default="${javac.modulepath}" name="modulepath"/>
   5.267 +            <attribute default="${javac.upgrademodulepath}" name="upgrademodulepath"/>
   5.268 +            <attribute default="${javac.processorpath}" name="processorpath"/>
   5.269 +            <attribute default="${javac.processormodulepath}" name="processormodulepath"/>
   5.270 +            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
   5.271 +            <attribute default="${includes}" name="includes"/>
   5.272 +            <attribute default="${excludes}" name="excludes"/>
   5.273 +            <attribute default="${javac.debug}" name="debug"/>
   5.274 +            <attribute default="${empty.dir}" name="sourcepath" unless:set="named.module.internal"/>
   5.275 +            <attribute default="${src.dir}" if:set="named.module.internal" name="sourcepath"/>
   5.276 +            <attribute default="${empty.dir}" name="gensrcdir"/>
   5.277 +            <element name="customize" optional="true"/>
   5.278 +            <sequential>
   5.279 +                <condition property="warn.excludes.internal">
   5.280 +                    <and>
   5.281 +                        <isset property="named.module.internal"/>
   5.282 +                        <length length="0" string="@{excludes}" trim="true" when="greater"/>
   5.283 +                    </and>
   5.284 +                </condition>
   5.285 +                <echo if:set="warn.excludes.internal" level="warning" message="The javac excludes are not supported in the JDK 9 Named Module."/>
   5.286 +                <property location="${build.dir}/empty" name="empty.dir"/>
   5.287 +                <mkdir dir="${empty.dir}"/>
   5.288 +                <mkdir dir="@{apgeneratedsrcdir}"/>
   5.289 +                <condition property="processormodulepath.set">
   5.290 +                    <resourcecount count="0" when="greater">
   5.291 +                        <path>
   5.292 +                            <pathelement path="@{processormodulepath}"/>
   5.293 +                        </path>
   5.294 +                    </resourcecount>
   5.295 +                </condition>
   5.296 +                <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}">
   5.297 +                    <src>
   5.298 +                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
   5.299 +                            <include name="*"/>
   5.300 +                        </dirset>
   5.301 +                    </src>
   5.302 +                    <classpath>
   5.303 +                        <path path="@{classpath}"/>
   5.304 +                    </classpath>
   5.305 +                    <modulepath>
   5.306 +                        <path path="@{modulepath}"/>
   5.307 +                    </modulepath>
   5.308 +                    <upgrademodulepath>
   5.309 +                        <path path="@{upgrademodulepath}"/>
   5.310 +                    </upgrademodulepath>
   5.311 +                    <compilerarg line="${javac.systemmodulepath.cmd.line.arg}"/>
   5.312 +                    <compilerarg line="${javac.profile.cmd.line.arg}"/>
   5.313 +                    <compilerarg line="${javac.compilerargs}"/>
   5.314 +                    <compilerarg if:set="processormodulepath.set" value="--processor-module-path"/>
   5.315 +                    <compilerarg if:set="processormodulepath.set" path="@{processormodulepath}"/>
   5.316 +                    <compilerarg unless:set="processormodulepath.set" value="-processorpath"/>
   5.317 +                    <compilerarg path="@{processorpath}:${empty.dir}" unless:set="processormodulepath.set"/>
   5.318 +                    <compilerarg line="${ap.processors.internal}"/>
   5.319 +                    <compilerarg line="${annotation.processing.processor.options}"/>
   5.320 +                    <compilerarg value="-s"/>
   5.321 +                    <compilerarg path="@{apgeneratedsrcdir}"/>
   5.322 +                    <compilerarg line="${ap.proc.none.internal}"/>
   5.323 +                    <customize/>
   5.324 +                </javac>
   5.325 +            </sequential>
   5.326 +        </macrodef>
   5.327 +    </target>
   5.328 +    <target depends="-init-ap-cmdline-properties,-init-source-module-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors" unless="modules.supported.internal">
   5.329 +        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
   5.330 +            <attribute default="${src.dir}" name="srcdir"/>
   5.331 +            <attribute default="${build.classes.dir}" name="destdir"/>
   5.332 +            <attribute default="${javac.classpath}" name="classpath"/>
   5.333 +            <attribute default="${javac.modulepath}" name="modulepath"/>
   5.334 +            <attribute default="${javac.upgrademodulepath}" name="upgrademodulepath"/>
   5.335              <attribute default="${javac.processorpath}" name="processorpath"/>
   5.336              <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
   5.337              <attribute default="${includes}" name="includes"/>
   5.338 @@ -244,6 +404,7 @@
   5.339                          <path path="@{classpath}"/>
   5.340                      </classpath>
   5.341                      <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
   5.342 +                    <compilerarg line="${javac.profile.cmd.line.arg}"/>
   5.343                      <compilerarg line="${javac.compilerargs}"/>
   5.344                      <compilerarg value="-processorpath"/>
   5.345                      <compilerarg path="@{processorpath}:${empty.dir}"/>
   5.346 @@ -257,11 +418,13 @@
   5.347              </sequential>
   5.348          </macrodef>
   5.349      </target>
   5.350 -    <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
   5.351 +    <target depends="-init-ap-cmdline-properties,-init-source-module-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
   5.352          <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
   5.353              <attribute default="${src.dir}" name="srcdir"/>
   5.354              <attribute default="${build.classes.dir}" name="destdir"/>
   5.355              <attribute default="${javac.classpath}" name="classpath"/>
   5.356 +            <attribute default="${javac.modulepath}" name="modulepath"/>
   5.357 +            <attribute default="${javac.upgrademodulepath}" name="upgrademodulepath"/>
   5.358              <attribute default="${javac.processorpath}" name="processorpath"/>
   5.359              <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
   5.360              <attribute default="${includes}" name="includes"/>
   5.361 @@ -283,13 +446,14 @@
   5.362                          <path path="@{classpath}"/>
   5.363                      </classpath>
   5.364                      <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
   5.365 +                    <compilerarg line="${javac.profile.cmd.line.arg}"/>
   5.366                      <compilerarg line="${javac.compilerargs}"/>
   5.367                      <customize/>
   5.368                  </javac>
   5.369              </sequential>
   5.370          </macrodef>
   5.371      </target>
   5.372 -    <target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
   5.373 +    <target depends="-init-macrodef-javac-with-module,-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
   5.374          <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
   5.375              <attribute default="${src.dir}" name="srcdir"/>
   5.376              <attribute default="${build.classes.dir}" name="destdir"/>
   5.377 @@ -323,45 +487,317 @@
   5.378              </sequential>
   5.379          </macrodef>
   5.380      </target>
   5.381 -    <target name="-init-macrodef-junit">
   5.382 +    <target if="${junit.available}" name="-init-macrodef-junit-init">
   5.383 +        <condition else="false" property="nb.junit.batch" value="true">
   5.384 +            <and>
   5.385 +                <istrue value="${junit.available}"/>
   5.386 +                <not>
   5.387 +                    <isset property="test.method"/>
   5.388 +                </not>
   5.389 +            </and>
   5.390 +        </condition>
   5.391 +        <condition else="false" property="nb.junit.single" value="true">
   5.392 +            <and>
   5.393 +                <istrue value="${junit.available}"/>
   5.394 +                <isset property="test.method"/>
   5.395 +            </and>
   5.396 +        </condition>
   5.397 +    </target>
   5.398 +    <target name="-init-test-properties">
   5.399 +        <property name="test.binaryincludes" value="&lt;nothing&gt;"/>
   5.400 +        <property name="test.binarytestincludes" value=""/>
   5.401 +        <property name="test.binaryexcludes" value=""/>
   5.402 +    </target>
   5.403 +    <target depends="-init-modules-supported" if="modules.supported.internal" name="-init-macrodef-junit-prototype-with-module">
   5.404 +        <macrodef name="junit-prototype" uri="http://www.netbeans.org/ns/j2se-project/3">
   5.405 +            <attribute default="${includes}" name="includes"/>
   5.406 +            <attribute default="${excludes}" name="excludes"/>
   5.407 +            <element name="customizePrototype" optional="true"/>
   5.408 +            <sequential>
   5.409 +                <property name="junit.forkmode" value="perTest"/>
   5.410 +                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
   5.411 +                    <syspropertyset>
   5.412 +                        <propertyref prefix="test-sys-prop."/>
   5.413 +                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
   5.414 +                    </syspropertyset>
   5.415 +                    <classpath>
   5.416 +                        <path path="${run.test.classpath}"/>
   5.417 +                    </classpath>
   5.418 +                    <modulepath>
   5.419 +                        <path path="${run.test.modulepath}"/>
   5.420 +                    </modulepath>
   5.421 +                    <formatter type="brief" usefile="false"/>
   5.422 +                    <formatter type="xml"/>
   5.423 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   5.424 +                    <jvmarg value="-ea"/>
   5.425 +                    <jvmarg line="${run.test.jvmargs}"/>
   5.426 +                    <customizePrototype/>
   5.427 +                </junit>
   5.428 +            </sequential>
   5.429 +        </macrodef>
   5.430 +    </target>
   5.431 +    <target depends="-init-modules-supported" name="-init-macrodef-junit-prototype-without-module" unless="modules.supported.internal">
   5.432 +        <macrodef name="junit-prototype" uri="http://www.netbeans.org/ns/j2se-project/3">
   5.433 +            <attribute default="${includes}" name="includes"/>
   5.434 +            <attribute default="${excludes}" name="excludes"/>
   5.435 +            <element name="customizePrototype" optional="true"/>
   5.436 +            <sequential>
   5.437 +                <property name="junit.forkmode" value="perTest"/>
   5.438 +                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
   5.439 +                    <syspropertyset>
   5.440 +                        <propertyref prefix="test-sys-prop."/>
   5.441 +                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
   5.442 +                    </syspropertyset>
   5.443 +                    <classpath>
   5.444 +                        <path path="${run.test.classpath}"/>
   5.445 +                    </classpath>
   5.446 +                    <formatter type="brief" usefile="false"/>
   5.447 +                    <formatter type="xml"/>
   5.448 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   5.449 +                    <jvmarg value="-ea"/>
   5.450 +                    <customizePrototype/>
   5.451 +                </junit>
   5.452 +            </sequential>
   5.453 +        </macrodef>
   5.454 +    </target>
   5.455 +    <target depends="-init-test-properties,-init-macrodef-junit-prototype-with-module,-init-macrodef-junit-prototype-without-module" if="${nb.junit.single}" name="-init-macrodef-junit-single" unless="${nb.junit.batch}">
   5.456          <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
   5.457              <attribute default="${includes}" name="includes"/>
   5.458              <attribute default="${excludes}" name="excludes"/>
   5.459              <attribute default="**" name="testincludes"/>
   5.460 +            <attribute default="" name="testmethods"/>
   5.461 +            <element name="customize" optional="true"/>
   5.462              <sequential>
   5.463 -                <property name="junit.forkmode" value="perTest"/>
   5.464 -                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
   5.465 -                    <batchtest todir="${build.test.results.dir}">
   5.466 -                        <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
   5.467 -                            <filename name="@{testincludes}"/>
   5.468 -                        </fileset>
   5.469 -                    </batchtest>
   5.470 +                <j2seproject3:junit-prototype>
   5.471 +                    <customizePrototype>
   5.472 +                        <test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/>
   5.473 +                        <customize/>
   5.474 +                    </customizePrototype>
   5.475 +                </j2seproject3:junit-prototype>
   5.476 +            </sequential>
   5.477 +        </macrodef>
   5.478 +    </target>
   5.479 +    <target depends="-init-test-properties,-init-macrodef-junit-prototype-with-module,-init-macrodef-junit-prototype-without-module" if="${nb.junit.batch}" name="-init-macrodef-junit-batch" unless="${nb.junit.single}">
   5.480 +        <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
   5.481 +            <attribute default="${includes}" name="includes"/>
   5.482 +            <attribute default="${excludes}" name="excludes"/>
   5.483 +            <attribute default="**" name="testincludes"/>
   5.484 +            <attribute default="" name="testmethods"/>
   5.485 +            <element name="customize" optional="true"/>
   5.486 +            <sequential>
   5.487 +                <j2seproject3:junit-prototype>
   5.488 +                    <customizePrototype>
   5.489 +                        <batchtest todir="${build.test.results.dir}">
   5.490 +                            <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
   5.491 +                                <filename name="@{testincludes}"/>
   5.492 +                            </fileset>
   5.493 +                            <fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}">
   5.494 +                                <filename name="${test.binarytestincludes}"/>
   5.495 +                            </fileset>
   5.496 +                        </batchtest>
   5.497 +                        <customize/>
   5.498 +                    </customizePrototype>
   5.499 +                </j2seproject3:junit-prototype>
   5.500 +            </sequential>
   5.501 +        </macrodef>
   5.502 +    </target>
   5.503 +    <target depends="-init-macrodef-junit-init,-init-macrodef-junit-single, -init-macrodef-junit-batch" if="${junit.available}" name="-init-macrodef-junit"/>
   5.504 +    <target if="${testng.available}" name="-init-macrodef-testng">
   5.505 +        <macrodef name="testng" uri="http://www.netbeans.org/ns/j2se-project/3">
   5.506 +            <attribute default="${includes}" name="includes"/>
   5.507 +            <attribute default="${excludes}" name="excludes"/>
   5.508 +            <attribute default="**" name="testincludes"/>
   5.509 +            <attribute default="" name="testmethods"/>
   5.510 +            <element name="customize" optional="true"/>
   5.511 +            <sequential>
   5.512 +                <condition else="" property="testng.methods.arg" value="@{testincludes}.@{testmethods}">
   5.513 +                    <isset property="test.method"/>
   5.514 +                </condition>
   5.515 +                <union id="test.set">
   5.516 +                    <fileset dir="${test.src.dir}" excludes="@{excludes},**/*.xml,${excludes}" includes="@{includes}">
   5.517 +                        <filename name="@{testincludes}"/>
   5.518 +                    </fileset>
   5.519 +                </union>
   5.520 +                <taskdef classname="org.testng.TestNGAntTask" classpath="${run.test.classpath}" name="testng"/>
   5.521 +                <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="cloneproblem" testname="TestNG tests" workingDir="${work.dir}">
   5.522 +                    <xmlfileset dir="${build.test.classes.dir}" includes="@{testincludes}"/>
   5.523 +                    <propertyset>
   5.524 +                        <propertyref prefix="test-sys-prop."/>
   5.525 +                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
   5.526 +                    </propertyset>
   5.527                      <classpath>
   5.528                          <path path="${run.test.classpath}"/>
   5.529                      </classpath>
   5.530 -                    <syspropertyset>
   5.531 -                        <propertyref prefix="test-sys-prop."/>
   5.532 -                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
   5.533 -                    </syspropertyset>
   5.534 -                    <formatter type="brief" usefile="false"/>
   5.535 -                    <formatter type="xml"/>
   5.536                      <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   5.537 -                    <jvmarg value="-ea"/>
   5.538 -                    <jvmarg line="${run.jvmargs}"/>
   5.539 -                </junit>
   5.540 +                    <customize/>
   5.541 +                </testng>
   5.542              </sequential>
   5.543          </macrodef>
   5.544      </target>
   5.545 -    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check" name="profile-init"/>
   5.546 -    <target name="-profile-pre-init">
   5.547 +    <target name="-init-macrodef-test-impl">
   5.548 +        <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
   5.549 +            <attribute default="${includes}" name="includes"/>
   5.550 +            <attribute default="${excludes}" name="excludes"/>
   5.551 +            <attribute default="**" name="testincludes"/>
   5.552 +            <attribute default="" name="testmethods"/>
   5.553 +            <element implicit="true" name="customize" optional="true"/>
   5.554 +            <sequential>
   5.555 +                <echo>No tests executed.</echo>
   5.556 +            </sequential>
   5.557 +        </macrodef>
   5.558 +    </target>
   5.559 +    <target depends="-init-macrodef-junit" if="${junit.available}" name="-init-macrodef-junit-impl">
   5.560 +        <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
   5.561 +            <attribute default="${includes}" name="includes"/>
   5.562 +            <attribute default="${excludes}" name="excludes"/>
   5.563 +            <attribute default="**" name="testincludes"/>
   5.564 +            <attribute default="" name="testmethods"/>
   5.565 +            <element implicit="true" name="customize" optional="true"/>
   5.566 +            <sequential>
   5.567 +                <j2seproject3:junit excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
   5.568 +                    <customize/>
   5.569 +                </j2seproject3:junit>
   5.570 +            </sequential>
   5.571 +        </macrodef>
   5.572 +    </target>
   5.573 +    <target depends="-init-macrodef-testng" if="${testng.available}" name="-init-macrodef-testng-impl">
   5.574 +        <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
   5.575 +            <attribute default="${includes}" name="includes"/>
   5.576 +            <attribute default="${excludes}" name="excludes"/>
   5.577 +            <attribute default="**" name="testincludes"/>
   5.578 +            <attribute default="" name="testmethods"/>
   5.579 +            <element implicit="true" name="customize" optional="true"/>
   5.580 +            <sequential>
   5.581 +                <j2seproject3:testng excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
   5.582 +                    <customize/>
   5.583 +                </j2seproject3:testng>
   5.584 +            </sequential>
   5.585 +        </macrodef>
   5.586 +    </target>
   5.587 +    <target depends="-init-macrodef-test-impl,-init-macrodef-junit-impl,-init-macrodef-testng-impl" name="-init-macrodef-test">
   5.588 +        <macrodef name="test" uri="http://www.netbeans.org/ns/j2se-project/3">
   5.589 +            <attribute default="${includes}" name="includes"/>
   5.590 +            <attribute default="${excludes}" name="excludes"/>
   5.591 +            <attribute default="**" name="testincludes"/>
   5.592 +            <attribute default="" name="testmethods"/>
   5.593 +            <sequential>
   5.594 +                <j2seproject3:test-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
   5.595 +                    <customize>
   5.596 +                        <jvmarg line="${run.jvmargs}"/>
   5.597 +                        <jvmarg line="${run.jvmargs.ide}"/>
   5.598 +                    </customize>
   5.599 +                </j2seproject3:test-impl>
   5.600 +            </sequential>
   5.601 +        </macrodef>
   5.602 +    </target>
   5.603 +    <target depends="-init-macrodef-junit" if="${junit.available}" name="-init-macrodef-junit-debug-impl">
   5.604 +        <macrodef name="test-debug-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
   5.605 +            <attribute default="${includes}" name="includes"/>
   5.606 +            <attribute default="${excludes}" name="excludes"/>
   5.607 +            <attribute default="**" name="testincludes"/>
   5.608 +            <attribute default="" name="testmethods"/>
   5.609 +            <element name="customizeDebuggee" optional="true"/>
   5.610 +            <sequential>
   5.611 +                <j2seproject3:junit excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
   5.612 +                    <customize>
   5.613 +                        <jvmarg value="-agentlib:jdwp=transport=${debug-transport},address=${jpda.address}"/>
   5.614 +                        <customizeDebuggee/>
   5.615 +                    </customize>
   5.616 +                </j2seproject3:junit>
   5.617 +            </sequential>
   5.618 +        </macrodef>
   5.619 +    </target>
   5.620 +    <target if="${testng.available}" name="-init-macrodef-testng-debug">
   5.621 +        <macrodef name="testng-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
   5.622 +            <attribute default="${main.class}" name="testClass"/>
   5.623 +            <attribute default="" name="testMethod"/>
   5.624 +            <element name="customize2" optional="true"/>
   5.625 +            <sequential>
   5.626 +                <condition else="-testclass @{testClass}" property="test.class.or.method" value="-methods @{testClass}.@{testMethod}">
   5.627 +                    <isset property="test.method"/>
   5.628 +                </condition>
   5.629 +                <condition else="-suitename cloneproblem -testname @{testClass} ${test.class.or.method}" property="testng.cmd.args" value="@{testClass}">
   5.630 +                    <matches pattern=".*\.xml" string="@{testClass}"/>
   5.631 +                </condition>
   5.632 +                <delete dir="${build.test.results.dir}" quiet="true"/>
   5.633 +                <mkdir dir="${build.test.results.dir}"/>
   5.634 +                <j2seproject3:debug classname="org.testng.TestNG" classpath="${debug.test.classpath}">
   5.635 +                    <customizeDebuggee>
   5.636 +                        <customize2/>
   5.637 +                        <jvmarg value="-ea"/>
   5.638 +                        <arg line="${testng.debug.mode}"/>
   5.639 +                        <arg line="-d ${build.test.results.dir}"/>
   5.640 +                        <arg line="-listener org.testng.reporters.VerboseReporter"/>
   5.641 +                        <arg line="${testng.cmd.args}"/>
   5.642 +                    </customizeDebuggee>
   5.643 +                </j2seproject3:debug>
   5.644 +            </sequential>
   5.645 +        </macrodef>
   5.646 +    </target>
   5.647 +    <target depends="-init-macrodef-testng-debug" if="${testng.available}" name="-init-macrodef-testng-debug-impl">
   5.648 +        <macrodef name="testng-debug-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
   5.649 +            <attribute default="${main.class}" name="testClass"/>
   5.650 +            <attribute default="" name="testMethod"/>
   5.651 +            <element implicit="true" name="customize2" optional="true"/>
   5.652 +            <sequential>
   5.653 +                <j2seproject3:testng-debug testClass="@{testClass}" testMethod="@{testMethod}">
   5.654 +                    <customize2/>
   5.655 +                </j2seproject3:testng-debug>
   5.656 +            </sequential>
   5.657 +        </macrodef>
   5.658 +    </target>
   5.659 +    <target depends="-init-macrodef-junit-debug-impl" if="${junit.available}" name="-init-macrodef-test-debug-junit">
   5.660 +        <macrodef name="test-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
   5.661 +            <attribute default="${includes}" name="includes"/>
   5.662 +            <attribute default="${excludes}" name="excludes"/>
   5.663 +            <attribute default="**" name="testincludes"/>
   5.664 +            <attribute default="" name="testmethods"/>
   5.665 +            <attribute default="${main.class}" name="testClass"/>
   5.666 +            <attribute default="" name="testMethod"/>
   5.667 +            <sequential>
   5.668 +                <j2seproject3:test-debug-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
   5.669 +                    <customizeDebuggee>
   5.670 +                        <jvmarg line="${run.jvmargs}"/>
   5.671 +                        <jvmarg line="${run.jvmargs.ide}"/>
   5.672 +                    </customizeDebuggee>
   5.673 +                </j2seproject3:test-debug-impl>
   5.674 +            </sequential>
   5.675 +        </macrodef>
   5.676 +    </target>
   5.677 +    <target depends="-init-macrodef-testng-debug-impl" if="${testng.available}" name="-init-macrodef-test-debug-testng">
   5.678 +        <macrodef name="test-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
   5.679 +            <attribute default="${includes}" name="includes"/>
   5.680 +            <attribute default="${excludes}" name="excludes"/>
   5.681 +            <attribute default="**" name="testincludes"/>
   5.682 +            <attribute default="" name="testmethods"/>
   5.683 +            <attribute default="${main.class}" name="testClass"/>
   5.684 +            <attribute default="" name="testMethod"/>
   5.685 +            <sequential>
   5.686 +                <j2seproject3:testng-debug-impl testClass="@{testClass}" testMethod="@{testMethod}">
   5.687 +                    <customize2>
   5.688 +                        <syspropertyset>
   5.689 +                            <propertyref prefix="test-sys-prop."/>
   5.690 +                            <mapper from="test-sys-prop.*" to="*" type="glob"/>
   5.691 +                        </syspropertyset>
   5.692 +                    </customize2>
   5.693 +                </j2seproject3:testng-debug-impl>
   5.694 +            </sequential>
   5.695 +        </macrodef>
   5.696 +    </target>
   5.697 +    <target depends="-init-macrodef-test-debug-junit,-init-macrodef-test-debug-testng" name="-init-macrodef-test-debug"/>
   5.698 +    <!--
   5.699 +                pre NB7.2 profiling section; consider it deprecated
   5.700 +            -->
   5.701 +    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check" if="profiler.info.jvmargs.agent" name="profile-init"/>
   5.702 +    <target if="profiler.info.jvmargs.agent" name="-profile-pre-init">
   5.703          <!-- Empty placeholder for easier customization. -->
   5.704          <!-- You can override this target in the ../build.xml file. -->
   5.705      </target>
   5.706 -    <target name="-profile-post-init">
   5.707 +    <target if="profiler.info.jvmargs.agent" name="-profile-post-init">
   5.708          <!-- Empty placeholder for easier customization. -->
   5.709          <!-- You can override this target in the ../build.xml file. -->
   5.710      </target>
   5.711 -    <target name="-profile-init-macrodef-profile">
   5.712 +    <target if="profiler.info.jvmargs.agent" name="-profile-init-macrodef-profile">
   5.713          <macrodef name="resolve">
   5.714              <attribute name="name"/>
   5.715              <attribute name="value"/>
   5.716 @@ -375,7 +811,8 @@
   5.717              <sequential>
   5.718                  <property environment="env"/>
   5.719                  <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
   5.720 -                <java classname="@{classname}" dir="${profiler.info.dir}" fork="true" jvm="${profiler.info.jvm}">
   5.721 +                <java classname="@{classname}" dir="${profiler.info.dir}" failonerror="${java.failonerror}" fork="true" jvm="${profiler.info.jvm}">
   5.722 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   5.723                      <jvmarg value="${profiler.info.jvmargs.agent}"/>
   5.724                      <jvmarg line="${profiler.info.jvmargs}"/>
   5.725                      <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
   5.726 @@ -392,17 +829,24 @@
   5.727              </sequential>
   5.728          </macrodef>
   5.729      </target>
   5.730 -    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile" name="-profile-init-check">
   5.731 +    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile" if="profiler.info.jvmargs.agent" name="-profile-init-check">
   5.732          <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail>
   5.733          <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
   5.734      </target>
   5.735 +    <!--
   5.736 +                end of pre NB7.2 profiling section
   5.737 +            -->
   5.738      <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
   5.739          <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
   5.740              <attribute default="${main.class}" name="name"/>
   5.741 +            <attribute default="${debug.modulepath}" name="modulepath"/>
   5.742              <attribute default="${debug.classpath}" name="classpath"/>
   5.743              <attribute default="" name="stopclassname"/>
   5.744              <sequential>
   5.745                  <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport}">
   5.746 +                    <modulepath>
   5.747 +                        <path path="@{modulepath}"/>
   5.748 +                    </modulepath>
   5.749                      <classpath>
   5.750                          <path path="@{classpath}"/>
   5.751                      </classpath>
   5.752 @@ -421,18 +865,6 @@
   5.753          </macrodef>
   5.754      </target>
   5.755      <target name="-init-debug-args">
   5.756 -        <property name="version-output" value="java version &quot;${ant.java.version}"/>
   5.757 -        <condition property="have-jdk-older-than-1.4">
   5.758 -            <or>
   5.759 -                <contains string="${version-output}" substring="java version &quot;1.0"/>
   5.760 -                <contains string="${version-output}" substring="java version &quot;1.1"/>
   5.761 -                <contains string="${version-output}" substring="java version &quot;1.2"/>
   5.762 -                <contains string="${version-output}" substring="java version &quot;1.3"/>
   5.763 -            </or>
   5.764 -        </condition>
   5.765 -        <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
   5.766 -            <istrue value="${have-jdk-older-than-1.4}"/>
   5.767 -        </condition>
   5.768          <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
   5.769              <os family="windows"/>
   5.770          </condition>
   5.771 @@ -442,17 +874,103 @@
   5.772      </target>
   5.773      <target depends="-init-debug-args" name="-init-macrodef-debug">
   5.774          <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
   5.775 +            <attribute default="${module.name}" name="modulename"/>
   5.776              <attribute default="${main.class}" name="classname"/>
   5.777 +            <attribute default="${debug.modulepath}" name="modulepath"/>
   5.778              <attribute default="${debug.classpath}" name="classpath"/>
   5.779 +            <element name="customizeDebuggee" optional="true"/>
   5.780 +            <sequential>
   5.781 +                <j2seproject1:java classname="@{classname}" classpath="@{classpath}" modulename="@{modulename}" modulepath="@{modulepath}">
   5.782 +                    <customize>
   5.783 +                        <jvmarg value="-agentlib:jdwp=transport=${debug-transport},address=${jpda.address}"/>
   5.784 +                        <customizeDebuggee/>
   5.785 +                    </customize>
   5.786 +                </j2seproject1:java>
   5.787 +            </sequential>
   5.788 +        </macrodef>
   5.789 +    </target>
   5.790 +    <target depends="-init-source-module-properties" if="named.module.internal" name="-init-macrodef-java-with-module">
   5.791 +        <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
   5.792 +            <attribute default="${module.name}" name="modulename"/>
   5.793 +            <attribute default="${main.class}" name="classname"/>
   5.794 +            <attribute default="${run.modulepath}" name="modulepath"/>
   5.795 +            <attribute default="${run.upgrademodulepath}" name="upgrademodulepath"/>
   5.796 +            <attribute default="${run.classpath}" name="classpath"/>
   5.797 +            <attribute default="jvm" name="jvm"/>
   5.798              <element name="customize" optional="true"/>
   5.799              <sequential>
   5.800 -                <java classname="@{classname}" dir="${work.dir}" fork="true">
   5.801 -                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   5.802 -                    <jvmarg line="${debug-args-line}"/>
   5.803 -                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
   5.804 +                <java classname="@{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true" module="@{modulename}">
   5.805 +                    <classpath>
   5.806 +                        <path path="@{classpath}"/>
   5.807 +                    </classpath>
   5.808 +                    <modulepath>
   5.809 +                        <pathelement path="@{modulepath}"/>
   5.810 +                        <pathelement location="${module.build.classes.dir}"/>
   5.811 +                    </modulepath>
   5.812 +                    <upgrademodulepath>
   5.813 +                        <path path="@{upgrademodulepath}"/>
   5.814 +                    </upgrademodulepath>
   5.815                      <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
   5.816                      <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
   5.817                      <jvmarg line="${run.jvmargs}"/>
   5.818 +                    <jvmarg line="${run.jvmargs.ide}"/>
   5.819 +                    <syspropertyset>
   5.820 +                        <propertyref prefix="run-sys-prop."/>
   5.821 +                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
   5.822 +                    </syspropertyset>
   5.823 +                    <customize/>
   5.824 +                </java>
   5.825 +            </sequential>
   5.826 +        </macrodef>
   5.827 +    </target>
   5.828 +    <target depends="-init-source-module-properties" if="unnamed.module.internal" name="-init-macrodef-java-with-unnamed-module">
   5.829 +        <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
   5.830 +            <attribute default="" name="modulename"/>
   5.831 +            <attribute default="${main.class}" name="classname"/>
   5.832 +            <attribute default="${run.modulepath}" name="modulepath"/>
   5.833 +            <attribute default="${run.upgrademodulepath}" name="upgrademodulepath"/>
   5.834 +            <attribute default="${run.classpath}" name="classpath"/>
   5.835 +            <attribute default="jvm" name="jvm"/>
   5.836 +            <element name="customize" optional="true"/>
   5.837 +            <sequential>
   5.838 +                <java classname="@{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true">
   5.839 +                    <classpath>
   5.840 +                        <path path="@{classpath}"/>
   5.841 +                    </classpath>
   5.842 +                    <modulepath>
   5.843 +                        <path path="@{modulepath}"/>
   5.844 +                    </modulepath>
   5.845 +                    <upgrademodulepath>
   5.846 +                        <path path="@{upgrademodulepath}"/>
   5.847 +                    </upgrademodulepath>
   5.848 +                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
   5.849 +                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
   5.850 +                    <jvmarg line="${run.jvmargs}"/>
   5.851 +                    <jvmarg line="${run.jvmargs.ide}"/>
   5.852 +                    <syspropertyset>
   5.853 +                        <propertyref prefix="run-sys-prop."/>
   5.854 +                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
   5.855 +                    </syspropertyset>
   5.856 +                    <customize/>
   5.857 +                </java>
   5.858 +            </sequential>
   5.859 +        </macrodef>
   5.860 +    </target>
   5.861 +    <target depends="-init-source-module-properties" name="-init-macrodef-java-without-module" unless="modules.supported.internal">
   5.862 +        <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
   5.863 +            <attribute default="" name="modulename"/>
   5.864 +            <attribute default="${main.class}" name="classname"/>
   5.865 +            <attribute default="" name="modulepath"/>
   5.866 +            <attribute default="${run.classpath}" name="classpath"/>
   5.867 +            <attribute default="jvm" name="jvm"/>
   5.868 +            <element name="customize" optional="true"/>
   5.869 +            <sequential>
   5.870 +                <java classname="@{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true">
   5.871 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   5.872 +                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
   5.873 +                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
   5.874 +                    <jvmarg line="${run.jvmargs}"/>
   5.875 +                    <jvmarg line="${run.jvmargs.ide}"/>
   5.876                      <classpath>
   5.877                          <path path="@{classpath}"/>
   5.878                      </classpath>
   5.879 @@ -465,29 +983,7 @@
   5.880              </sequential>
   5.881          </macrodef>
   5.882      </target>
   5.883 -    <target name="-init-macrodef-java">
   5.884 -        <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
   5.885 -            <attribute default="${main.class}" name="classname"/>
   5.886 -            <attribute default="${run.classpath}" name="classpath"/>
   5.887 -            <element name="customize" optional="true"/>
   5.888 -            <sequential>
   5.889 -                <java classname="@{classname}" dir="${work.dir}" fork="true">
   5.890 -                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   5.891 -                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
   5.892 -                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
   5.893 -                    <jvmarg line="${run.jvmargs}"/>
   5.894 -                    <classpath>
   5.895 -                        <path path="@{classpath}"/>
   5.896 -                    </classpath>
   5.897 -                    <syspropertyset>
   5.898 -                        <propertyref prefix="run-sys-prop."/>
   5.899 -                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
   5.900 -                    </syspropertyset>
   5.901 -                    <customize/>
   5.902 -                </java>
   5.903 -            </sequential>
   5.904 -        </macrodef>
   5.905 -    </target>
   5.906 +    <target depends="-init-macrodef-java-with-module, -init-macrodef-java-with-unnamed-module, -init-macrodef-java-without-module" name="-init-macrodef-java"/>
   5.907      <target name="-init-macrodef-copylibs">
   5.908          <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
   5.909              <attribute default="${manifest.file}" name="manifest"/>
   5.910 @@ -502,12 +998,15 @@
   5.911                      <path path="${run.classpath.without.build.classes.dir}"/>
   5.912                      <chainedmapper>
   5.913                          <flattenmapper/>
   5.914 +                        <filtermapper>
   5.915 +                            <replacestring from=" " to="%20"/>
   5.916 +                        </filtermapper>
   5.917                          <globmapper from="*" to="lib/*"/>
   5.918                      </chainedmapper>
   5.919                  </pathconvert>
   5.920                  <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
   5.921 -                <copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
   5.922 -                    <fileset dir="${build.classes.dir}"/>
   5.923 +                <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}">
   5.924 +                    <fileset dir="${build.classes.dir}" excludes="${dist.archive.excludes}"/>
   5.925                      <manifest>
   5.926                          <attribute name="Class-Path" value="${jar.classpath}"/>
   5.927                          <customize/>
   5.928 @@ -518,8 +1017,8 @@
   5.929      </target>
   5.930      <target name="-init-presetdef-jar">
   5.931          <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
   5.932 -            <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}">
   5.933 -                <j2seproject1:fileset dir="${build.classes.dir}"/>
   5.934 +            <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}" manifestencoding="UTF-8">
   5.935 +                <j2seproject1:fileset dir="${build.classes.dir}" excludes="${dist.archive.excludes}"/>
   5.936              </jar>
   5.937          </presetdef>
   5.938      </target>
   5.939 @@ -547,7 +1046,7 @@
   5.940      <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline">
   5.941          <property name="ap.cmd.line.internal" value=""/>
   5.942      </target>
   5.943 -    <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,-init-ap-cmdline" name="init"/>
   5.944 +    <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"/>
   5.945      <!--
   5.946                  ===================
   5.947                  COMPILATION SECTION
   5.948 @@ -574,7 +1073,9 @@
   5.949          <available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/>
   5.950      </target>
   5.951      <target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build">
   5.952 -        <antcall target="clean"/>
   5.953 +        <antcall target="clean">
   5.954 +            <param name="no.dependencies" value="true"/>
   5.955 +        </antcall>
   5.956      </target>
   5.957      <target depends="init,deps-jar" name="-pre-pre-compile">
   5.958          <mkdir dir="${build.classes.dir}"/>
   5.959 @@ -600,7 +1101,7 @@
   5.960      <target if="has.persistence.xml" name="-copy-persistence-xml">
   5.961          <mkdir dir="${build.classes.dir}/META-INF"/>
   5.962          <copy todir="${build.classes.dir}/META-INF">
   5.963 -            <fileset dir="${meta.inf.dir}" includes="persistence.xml"/>
   5.964 +            <fileset dir="${meta.inf.dir}" includes="persistence.xml orm.xml"/>
   5.965          </copy>
   5.966      </target>
   5.967      <target name="-post-compile">
   5.968 @@ -615,7 +1116,7 @@
   5.969      <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
   5.970          <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
   5.971          <j2seproject3:force-recompile/>
   5.972 -        <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.dir}"/>
   5.973 +        <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}, module-info.java" sourcepath="${src.dir}"/>
   5.974      </target>
   5.975      <target name="-post-compile-single">
   5.976          <!-- Empty placeholder for easier customization. -->
   5.977 @@ -635,65 +1136,191 @@
   5.978          <!-- Empty placeholder for easier customization. -->
   5.979          <!-- You can override this target in the ../build.xml file. -->
   5.980      </target>
   5.981 -    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive" name="-do-jar-without-manifest" unless="manifest.available-mkdist.available">
   5.982 -        <j2seproject1:jar/>
   5.983 +    <target depends="init,compile" name="-check-module-main-class">
   5.984 +        <pathconvert property="main.class.file">
   5.985 +            <string value="${main.class}"/>
   5.986 +            <unpackagemapper from="*" to="*.class"/>
   5.987 +        </pathconvert>
   5.988 +        <condition property="do.module.main.class">
   5.989 +            <and>
   5.990 +                <isset property="main.class.available"/>
   5.991 +                <available file="${build.classes.dir}/module-info.class"/>
   5.992 +                <available file="${build.classes.dir}/${main.class.file}"/>
   5.993 +                <isset property="libs.CopyLibs.classpath"/>
   5.994 +                <available classname="org.netbeans.modules.java.j2seproject.moduletask.ModuleMainClass" classpath="${libs.CopyLibs.classpath}"/>
   5.995 +            </and>
   5.996 +        </condition>
   5.997      </target>
   5.998 -    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class-mkdist.available">
   5.999 -        <j2seproject1:jar manifest="${manifest.file}"/>
  5.1000 +    <target depends="-check-module-main-class" if="do.module.main.class" name="-set-module-main-class">
  5.1001 +        <taskdef classname="org.netbeans.modules.java.j2seproject.moduletask.ModuleMainClass" classpath="${libs.CopyLibs.classpath}" name="modulemainclass"/>
  5.1002 +        <modulemainclass failonerror="false" mainclass="${main.class}" moduleinfo="${build.classes.dir}/module-info.class"/>
  5.1003      </target>
  5.1004 -    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available+main.class" name="-do-jar-with-mainclass" unless="manifest.available+main.class+mkdist.available">
  5.1005 -        <j2seproject1:jar manifest="${manifest.file}">
  5.1006 -            <j2seproject1:manifest>
  5.1007 -                <j2seproject1:attribute name="Main-Class" value="${main.class}"/>
  5.1008 -            </j2seproject1:manifest>
  5.1009 -        </j2seproject1:jar>
  5.1010 -        <echo level="info">To run this application from the command line without Ant, try:</echo>
  5.1011 -        <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
  5.1012 -        <property location="${dist.jar}" name="dist.jar.resolved"/>
  5.1013 -        <pathconvert property="run.classpath.with.dist.jar">
  5.1014 -            <path path="${run.classpath}"/>
  5.1015 -            <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
  5.1016 -        </pathconvert>
  5.1017 -        <echo level="info">java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
  5.1018 -    </target>
  5.1019 -    <target depends="init" if="do.archive" name="-do-jar-with-libraries-create-manifest" unless="manifest.available">
  5.1020 +    <target depends="init" if="do.archive" name="-do-jar-create-manifest" unless="manifest.available">
  5.1021          <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
  5.1022          <touch file="${tmp.manifest.file}" verbose="false"/>
  5.1023      </target>
  5.1024 -    <target depends="init" if="do.archive+manifest.available" name="-do-jar-with-libraries-copy-manifest">
  5.1025 +    <target depends="init" if="do.archive+manifest.available" name="-do-jar-copy-manifest">
  5.1026          <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
  5.1027 -        <copy file="${manifest.file}" tofile="${tmp.manifest.file}"/>
  5.1028 +        <copy encoding="${manifest.encoding}" file="${manifest.file}" outputencoding="UTF-8" tofile="${tmp.manifest.file}"/>
  5.1029      </target>
  5.1030 -    <target depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest" if="do.archive+main.class.available" name="-do-jar-with-libraries-set-main">
  5.1031 -        <manifest file="${tmp.manifest.file}" mode="update">
  5.1032 +    <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+main.class.available" name="-do-jar-set-mainclass">
  5.1033 +        <manifest encoding="UTF-8" file="${tmp.manifest.file}" mode="update">
  5.1034              <attribute name="Main-Class" value="${main.class}"/>
  5.1035          </manifest>
  5.1036      </target>
  5.1037 -    <target depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest" if="do.archive+splashscreen.available" name="-do-jar-with-libraries-set-splashscreen">
  5.1038 +    <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+profile.available" name="-do-jar-set-profile">
  5.1039 +        <manifest encoding="UTF-8" file="${tmp.manifest.file}" mode="update">
  5.1040 +            <attribute name="Profile" value="${javac.profile}"/>
  5.1041 +        </manifest>
  5.1042 +    </target>
  5.1043 +    <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+splashscreen.available" name="-do-jar-set-splashscreen">
  5.1044          <basename file="${application.splash}" property="splashscreen.basename"/>
  5.1045          <mkdir dir="${build.classes.dir}/META-INF"/>
  5.1046          <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
  5.1047 -        <manifest file="${tmp.manifest.file}" mode="update">
  5.1048 +        <manifest encoding="UTF-8" file="${tmp.manifest.file}" mode="update">
  5.1049              <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
  5.1050          </manifest>
  5.1051      </target>
  5.1052 -    <target depends="init,-init-macrodef-copylibs,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen" if="do.mkdist" name="-do-jar-with-libraries-pack">
  5.1053 +    <target depends="init,compile" name="-check-do-mkdist">
  5.1054 +        <condition property="do.mkdist">
  5.1055 +            <and>
  5.1056 +                <isset property="do.archive"/>
  5.1057 +                <isset property="libs.CopyLibs.classpath"/>
  5.1058 +                <not>
  5.1059 +                    <istrue value="${mkdist.disabled}"/>
  5.1060 +                </not>
  5.1061 +                <not>
  5.1062 +                    <available file="${build.classes.dir}/module-info.class"/>
  5.1063 +                </not>
  5.1064 +            </and>
  5.1065 +        </condition>
  5.1066 +    </target>
  5.1067 +    <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,-check-do-mkdist" if="do.mkdist" name="-do-jar-copylibs">
  5.1068          <j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
  5.1069          <echo level="info">To run this application from the command line without Ant, try:</echo>
  5.1070          <property location="${dist.jar}" name="dist.jar.resolved"/>
  5.1071          <echo level="info">java -jar "${dist.jar.resolved}"</echo>
  5.1072      </target>
  5.1073 -    <target depends="-do-jar-with-libraries-pack" if="do.archive" name="-do-jar-with-libraries-delete-manifest">
  5.1074 +    <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,-check-do-mkdist" if="do.archive" name="-do-jar-jar" unless="do.mkdist">
  5.1075 +        <j2seproject1:jar manifest="${tmp.manifest.file}"/>
  5.1076 +        <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
  5.1077 +        <property location="${dist.jar}" name="dist.jar.resolved"/>
  5.1078 +        <condition else="${dist.jar.resolved}" property="jar.usage.message.class.path.replacement" value="">
  5.1079 +            <isset property="named.module.internal"/>
  5.1080 +        </condition>
  5.1081 +        <pathconvert property="run.classpath.with.dist.jar">
  5.1082 +            <path path="${run.classpath}"/>
  5.1083 +            <map from="${build.classes.dir.resolved}" to="${jar.usage.message.class.path.replacement}"/>
  5.1084 +        </pathconvert>
  5.1085 +        <pathconvert property="run.modulepath.with.dist.jar">
  5.1086 +            <path location="${dist.jar.resolved}"/>
  5.1087 +            <path path="${run.modulepath}"/>
  5.1088 +            <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
  5.1089 +        </pathconvert>
  5.1090 +        <condition else="${run.modulepath}" property="jar.usage.message.run.modulepath.with.dist.jar" value="${run.modulepath.with.dist.jar}">
  5.1091 +            <isset property="named.module.internal"/>
  5.1092 +        </condition>
  5.1093 +        <condition else="" property="jar.usage.message.module.path" value=" -p ${jar.usage.message.run.modulepath.with.dist.jar}">
  5.1094 +            <and>
  5.1095 +                <isset property="modules.supported.internal"/>
  5.1096 +                <length length="0" string="${jar.usage.message.run.modulepath.with.dist.jar}" when="greater"/>
  5.1097 +            </and>
  5.1098 +        </condition>
  5.1099 +        <condition else="" property="jar.usage.message.class.path" value=" -cp ${run.classpath.with.dist.jar}">
  5.1100 +            <length length="0" string="${run.classpath.with.dist.jar}" when="greater"/>
  5.1101 +        </condition>
  5.1102 +        <condition else="/${main.class}" property="jar.usage.message.main.class.class.selector" value="">
  5.1103 +            <isset property="do.module.main.class"/>
  5.1104 +        </condition>
  5.1105 +        <condition else=" ${main.class}" property="jar.usage.message.main.class" value=" -m ${module.name}${jar.usage.message.main.class.class.selector}">
  5.1106 +            <isset property="named.module.internal"/>
  5.1107 +        </condition>
  5.1108 +        <condition else="" property="jar.usage.message" value="To run this application from the command line without Ant, try:${line.separator}${platform.java}${jar.usage.message.module.path}${jar.usage.message.class.path}${jar.usage.message.main.class}">
  5.1109 +            <isset property="main.class.available"/>
  5.1110 +        </condition>
  5.1111 +        <condition else="debug" property="jar.usage.level" value="info">
  5.1112 +            <isset property="main.class.available"/>
  5.1113 +        </condition>
  5.1114 +        <echo level="${jar.usage.level}" message="${jar.usage.message}"/>
  5.1115 +    </target>
  5.1116 +    <target depends="-do-jar-copylibs" if="do.archive" name="-do-jar-delete-manifest">
  5.1117          <delete>
  5.1118              <fileset file="${tmp.manifest.file}"/>
  5.1119          </delete>
  5.1120      </target>
  5.1121 -    <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen,-do-jar-with-libraries-pack,-do-jar-with-libraries-delete-manifest" name="-do-jar-with-libraries"/>
  5.1122 +    <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"/>
  5.1123 +    <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"/>
  5.1124      <target name="-post-jar">
  5.1125          <!-- Empty placeholder for easier customization. -->
  5.1126          <!-- You can override this target in the ../build.xml file. -->
  5.1127      </target>
  5.1128 -    <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"/>
  5.1129 +    <target depends="init,compile,-pre-jar,-set-module-main-class,-do-jar-without-libraries,-do-jar-with-libraries,-post-jar" name="-do-jar"/>
  5.1130 +    <target depends="init,compile,-pre-jar,-do-jar,-post-jar,deploy" description="Build JAR." name="jar"/>
  5.1131 +    <!--
  5.1132 +                =================
  5.1133 +                DEPLOY SECTION
  5.1134 +                =================
  5.1135 +            -->
  5.1136 +    <target name="-pre-deploy">
  5.1137 +        <!-- Empty placeholder for easier customization. -->
  5.1138 +        <!-- You can override this target in the ../build.xml file. -->
  5.1139 +    </target>
  5.1140 +    <target depends="init" name="-check-jlink">
  5.1141 +        <condition property="do.jlink.internal">
  5.1142 +            <and>
  5.1143 +                <istrue value="${do.jlink}"/>
  5.1144 +                <isset property="do.archive"/>
  5.1145 +                <isset property="named.module.internal"/>
  5.1146 +            </and>
  5.1147 +        </condition>
  5.1148 +    </target>
  5.1149 +    <target depends="init,-do-jar,-post-jar,-pre-deploy,-check-jlink" if="do.jlink.internal" name="-do-deploy">
  5.1150 +        <delete dir="${dist.jlink.dir}" failonerror="false" quiet="true"/>
  5.1151 +        <property name="jlink.launcher.name" value="${application.title}"/>
  5.1152 +        <condition else="${module.name}" property="jlink.add.modules" value="${module.name},${jlink.additionalmodules}">
  5.1153 +            <and>
  5.1154 +                <isset property="jlink.additionalmodules"/>
  5.1155 +                <length length="0" string="${jlink.additionalmodules}" when="greater"/>
  5.1156 +            </and>
  5.1157 +        </condition>
  5.1158 +        <condition property="jlink.do.strip.internal">
  5.1159 +            <and>
  5.1160 +                <isset property="jlink.strip"/>
  5.1161 +                <istrue value="${jlink.strip}"/>
  5.1162 +            </and>
  5.1163 +        </condition>
  5.1164 +        <condition property="jlink.do.additionalparam.internal">
  5.1165 +            <and>
  5.1166 +                <isset property="jlink.additionalparam"/>
  5.1167 +                <length length="0" string="${jlink.additionalparam}" when="greater"/>
  5.1168 +            </and>
  5.1169 +        </condition>
  5.1170 +        <condition property="jlink.do.launcher.internal">
  5.1171 +            <and>
  5.1172 +                <istrue value="${jlink.launcher}"/>
  5.1173 +                <isset property="main.class.available"/>
  5.1174 +            </and>
  5.1175 +        </condition>
  5.1176 +        <property name="platform.jlink" value="${jdk.home}/bin/jlink"/>
  5.1177 +        <property name="jlink.systemmodules.internal" value="${jdk.home}/jmods"/>
  5.1178 +        <exec executable="${platform.jlink}">
  5.1179 +            <arg value="--module-path"/>
  5.1180 +            <arg path="${jlink.systemmodules.internal}:${run.modulepath}:${dist.jar}"/>
  5.1181 +            <arg value="--add-modules"/>
  5.1182 +            <arg value="${jlink.add.modules}"/>
  5.1183 +            <arg if:set="jlink.do.strip.internal" value="--strip-debug"/>
  5.1184 +            <arg if:set="jlink.do.launcher.internal" value="--launcher"/>
  5.1185 +            <arg if:set="jlink.do.launcher.internal" value="${jlink.launcher.name}=${module.name}/${main.class}"/>
  5.1186 +            <arg if:set="jlink.do.additionalparam.internal" line="${jlink.additionalparam}"/>
  5.1187 +            <arg value="--output"/>
  5.1188 +            <arg value="${dist.jlink.output}"/>
  5.1189 +        </exec>
  5.1190 +    </target>
  5.1191 +    <target name="-post-deploy">
  5.1192 +        <!-- Empty placeholder for easier customization. -->
  5.1193 +        <!-- You can override this target in the ../build.xml file. -->
  5.1194 +    </target>
  5.1195 +    <target depends="-do-jar,-post-jar,-pre-deploy,-do-deploy,-post-deploy" name="deploy"/>
  5.1196      <!--
  5.1197                  =================
  5.1198                  EXECUTION SECTION
  5.1199 @@ -730,9 +1357,9 @@
  5.1200      </target>
  5.1201      <target depends="init,compile" name="-debug-start-debuggee">
  5.1202          <j2seproject3:debug>
  5.1203 -            <customize>
  5.1204 +            <customizeDebuggee>
  5.1205                  <arg line="${application.args}"/>
  5.1206 -            </customize>
  5.1207 +            </customizeDebuggee>
  5.1208          </j2seproject3:debug>
  5.1209      </target>
  5.1210      <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/>
  5.1211 @@ -763,7 +1390,11 @@
  5.1212                  PROFILING SECTION
  5.1213                  =================
  5.1214              -->
  5.1215 -    <target depends="profile-init,compile" description="Profile a project in the IDE." if="netbeans.home" name="profile">
  5.1216 +    <!--
  5.1217 +                pre NB7.2 profiler integration
  5.1218 +            -->
  5.1219 +    <target depends="profile-init,compile" description="Profile a project in the IDE." if="profiler.info.jvmargs.agent" name="-profile-pre72">
  5.1220 +        <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
  5.1221          <nbprofiledirect>
  5.1222              <classpath>
  5.1223                  <path path="${run.classpath}"/>
  5.1224 @@ -771,8 +1402,9 @@
  5.1225          </nbprofiledirect>
  5.1226          <profile/>
  5.1227      </target>
  5.1228 -    <target depends="profile-init,compile-single" description="Profile a selected class in the IDE." if="netbeans.home" name="profile-single">
  5.1229 +    <target depends="profile-init,compile-single" description="Profile a selected class in the IDE." if="profiler.info.jvmargs.agent" name="-profile-single-pre72">
  5.1230          <fail unless="profile.class">Must select one file in the IDE or set profile.class</fail>
  5.1231 +        <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
  5.1232          <nbprofiledirect>
  5.1233              <classpath>
  5.1234                  <path path="${run.classpath}"/>
  5.1235 @@ -780,12 +1412,8 @@
  5.1236          </nbprofiledirect>
  5.1237          <profile classname="${profile.class}"/>
  5.1238      </target>
  5.1239 -    <!--
  5.1240 -                =========================
  5.1241 -                APPLET PROFILING  SECTION
  5.1242 -                =========================
  5.1243 -            -->
  5.1244 -    <target depends="profile-init,compile-single" if="netbeans.home" name="profile-applet">
  5.1245 +    <target depends="profile-init,compile-single" if="profiler.info.jvmargs.agent" name="-profile-applet-pre72">
  5.1246 +        <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
  5.1247          <nbprofiledirect>
  5.1248              <classpath>
  5.1249                  <path path="${run.classpath}"/>
  5.1250 @@ -797,32 +1425,60 @@
  5.1251              </customize>
  5.1252          </profile>
  5.1253      </target>
  5.1254 -    <!--
  5.1255 -                =========================
  5.1256 -                TESTS PROFILING  SECTION
  5.1257 -                =========================
  5.1258 -            -->
  5.1259 -    <target depends="profile-init,compile-test-single" if="netbeans.home" name="profile-test-single">
  5.1260 +    <target depends="-init-macrodef-junit,profile-init,compile-test-single" if="profiler.info.jvmargs.agent" name="-profile-test-single-pre72">
  5.1261 +        <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
  5.1262          <nbprofiledirect>
  5.1263              <classpath>
  5.1264                  <path path="${run.test.classpath}"/>
  5.1265              </classpath>
  5.1266          </nbprofiledirect>
  5.1267 -        <junit dir="${profiler.info.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" jvm="${profiler.info.jvm}" showoutput="true">
  5.1268 -            <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
  5.1269 -            <jvmarg value="${profiler.info.jvmargs.agent}"/>
  5.1270 -            <jvmarg line="${profiler.info.jvmargs}"/>
  5.1271 -            <test name="${profile.class}"/>
  5.1272 -            <classpath>
  5.1273 -                <path path="${run.test.classpath}"/>
  5.1274 -            </classpath>
  5.1275 -            <syspropertyset>
  5.1276 -                <propertyref prefix="test-sys-prop."/>
  5.1277 -                <mapper from="test-sys-prop.*" to="*" type="glob"/>
  5.1278 -            </syspropertyset>
  5.1279 -            <formatter type="brief" usefile="false"/>
  5.1280 -            <formatter type="xml"/>
  5.1281 -        </junit>
  5.1282 +        <j2seproject3:junit excludes="${excludes}" includes="${includes}" testincludes="${profile.class}" testmethods="">
  5.1283 +            <customize>
  5.1284 +                <jvmarg value="-agentlib:jdwp=transport=${debug-transport},address=${jpda.address}"/>
  5.1285 +                <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
  5.1286 +                <jvmarg value="${profiler.info.jvmargs.agent}"/>
  5.1287 +                <jvmarg line="${profiler.info.jvmargs}"/>
  5.1288 +                <classpath>
  5.1289 +                    <path path="${run.test.classpath}"/>
  5.1290 +                </classpath>
  5.1291 +            </customize>
  5.1292 +        </j2seproject3:junit>
  5.1293 +    </target>
  5.1294 +    <!--
  5.1295 +                end of pre NB72 profiling section
  5.1296 +            -->
  5.1297 +    <target if="netbeans.home" name="-profile-check">
  5.1298 +        <condition property="profiler.configured">
  5.1299 +            <or>
  5.1300 +                <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-agentpath:"/>
  5.1301 +                <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-javaagent:"/>
  5.1302 +            </or>
  5.1303 +        </condition>
  5.1304 +    </target>
  5.1305 +    <target depends="-profile-check,-profile-pre72" description="Profile a project in the IDE." if="profiler.configured" name="profile" unless="profiler.info.jvmargs.agent">
  5.1306 +        <startprofiler/>
  5.1307 +        <antcall target="run"/>
  5.1308 +    </target>
  5.1309 +    <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">
  5.1310 +        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
  5.1311 +        <startprofiler/>
  5.1312 +        <antcall target="run-single"/>
  5.1313 +    </target>
  5.1314 +    <target depends="-profile-test-single-pre72" description="Profile a selected test in the IDE." name="profile-test-single"/>
  5.1315 +    <target depends="-profile-check" description="Profile a selected test in the IDE." if="profiler.configured" name="profile-test" unless="profiler.info.jvmargs">
  5.1316 +        <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
  5.1317 +        <startprofiler/>
  5.1318 +        <antcall target="test-single"/>
  5.1319 +    </target>
  5.1320 +    <target depends="-profile-check" description="Profile a selected class in the IDE." if="profiler.configured" name="profile-test-with-main">
  5.1321 +        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
  5.1322 +        <startprofiler/>
  5.1323 +        <antcall target="run-test-with-main"/>
  5.1324 +    </target>
  5.1325 +    <target depends="-profile-check,-profile-applet-pre72" if="profiler.configured" name="profile-applet" unless="profiler.info.jvmargs.agent">
  5.1326 +        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
  5.1327 +        <startprofiler/>
  5.1328 +        <antcall target="run-applet"/>
  5.1329      </target>
  5.1330      <!--
  5.1331                  ===============
  5.1332 @@ -831,16 +1487,36 @@
  5.1333              -->
  5.1334      <target depends="init" if="have.sources" name="-javadoc-build">
  5.1335          <mkdir dir="${dist.javadoc.dir}"/>
  5.1336 -        <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}">
  5.1337 +        <condition else="" property="javadoc.endorsed.classpath.cmd.line.arg" value="-J${endorsed.classpath.cmd.line.arg}">
  5.1338 +            <and>
  5.1339 +                <isset property="endorsed.classpath.cmd.line.arg"/>
  5.1340 +                <not>
  5.1341 +                    <equals arg1="${endorsed.classpath.cmd.line.arg}" arg2=""/>
  5.1342 +                </not>
  5.1343 +            </and>
  5.1344 +        </condition>
  5.1345 +        <condition else="" property="bug5101868workaround" value="*.java">
  5.1346 +            <matches pattern="1\.[56](\..*)?" string="${java.version}"/>
  5.1347 +        </condition>
  5.1348 +        <condition else="" property="javadoc.html5.cmd.line.arg" value="-html5">
  5.1349 +            <and>
  5.1350 +                <isset property="javadoc.html5"/>
  5.1351 +                <available file="${jdk.home}${file.separator}lib${file.separator}jrt-fs.jar"/>
  5.1352 +            </and>
  5.1353 +        </condition>
  5.1354 +        <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}">
  5.1355              <classpath>
  5.1356                  <path path="${javac.classpath}"/>
  5.1357              </classpath>
  5.1358 -            <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
  5.1359 +            <fileset dir="${src.dir}" excludes="${bug5101868workaround},${excludes}" includes="${includes}">
  5.1360                  <filename name="**/*.java"/>
  5.1361              </fileset>
  5.1362              <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
  5.1363                  <include name="**/*.java"/>
  5.1364 +                <exclude name="*.java"/>
  5.1365              </fileset>
  5.1366 +            <arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/>
  5.1367 +            <arg line="${javadoc.html5.cmd.line.arg}"/>
  5.1368          </javadoc>
  5.1369          <copy todir="${dist.javadoc.dir}">
  5.1370              <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
  5.1371 @@ -857,7 +1533,7 @@
  5.1372      <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
  5.1373      <!--
  5.1374                  =========================
  5.1375 -                JUNIT COMPILATION SECTION
  5.1376 +                TEST COMPILATION SECTION
  5.1377                  =========================
  5.1378              -->
  5.1379      <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
  5.1380 @@ -867,11 +1543,63 @@
  5.1381          <!-- Empty placeholder for easier customization. -->
  5.1382          <!-- You can override this target in the ../build.xml file. -->
  5.1383      </target>
  5.1384 +    <target depends="-init-source-module-properties" if="named.module.internal" name="-init-test-javac-module-properties-with-module">
  5.1385 +        <j2seproject3:modulename property="test.module.name" sourcepath="${test.src.dir}"/>
  5.1386 +        <condition else="${empty.dir}" property="javac.test.sourcepath" value="${test.src.dir}">
  5.1387 +            <and>
  5.1388 +                <isset property="test.module.name"/>
  5.1389 +                <length length="0" string="${test.module.name}" when="greater"/>
  5.1390 +            </and>
  5.1391 +        </condition>
  5.1392 +        <condition else="--patch-module ${module.name}=${test.src.dir} --add-reads ${module.name}=ALL-UNNAMED" property="javac.test.compilerargs" value="--add-reads ${test.module.name}=ALL-UNNAMED">
  5.1393 +            <and>
  5.1394 +                <isset property="test.module.name"/>
  5.1395 +                <length length="0" string="${test.module.name}" when="greater"/>
  5.1396 +            </and>
  5.1397 +        </condition>
  5.1398 +    </target>
  5.1399 +    <target depends="-init-source-module-properties" if="named.module.internal" name="-init-test-run-module-properties">
  5.1400 +        <condition else="${module.name}" property="run.test.addexport.source.module.internal" value="${test.module.name}">
  5.1401 +            <and>
  5.1402 +                <isset property="test.module.name"/>
  5.1403 +                <length length="0" string="${test.module.name}" when="greater"/>
  5.1404 +            </and>
  5.1405 +        </condition>
  5.1406 +        <fileset dir="${build.test.classes.dir}" id="run.test.packages.internal" includes="**/*.class"/>
  5.1407 +        <property location="${build.test.classes.dir}" name="build.test.classes.dir.abs.internal"/>
  5.1408 +        <pathconvert pathsep=" " property="run.test.addexports.internal" refid="run.test.packages.internal">
  5.1409 +            <chainedmapper>
  5.1410 +                <regexpmapper from="^(.*)\Q${file.separator}\E.*\.class$$" to="\1"/>
  5.1411 +                <filtermapper>
  5.1412 +                    <uniqfilter/>
  5.1413 +                    <replacestring from="${build.test.classes.dir.abs.internal}" to=""/>
  5.1414 +                </filtermapper>
  5.1415 +                <cutdirsmapper dirs="1"/>
  5.1416 +                <packagemapper from="*" to="--add-exports ${run.test.addexport.source.module.internal}/*=ALL-UNNAMED"/>
  5.1417 +            </chainedmapper>
  5.1418 +        </pathconvert>
  5.1419 +        <condition else="--patch-module ${module.name}=${build.test.classes.dir} --add-modules ${module.name} --add-reads ${module.name}=ALL-UNNAMED ${run.test.addexports.internal}" property="run.test.jvmargs" value="--add-modules ${test.module.name} --add-reads ${test.module.name}=ALL-UNNAMED ${run.test.addexports.internal}">
  5.1420 +            <and>
  5.1421 +                <isset property="test.module.name"/>
  5.1422 +                <length length="0" string="${test.module.name}" when="greater"/>
  5.1423 +            </and>
  5.1424 +        </condition>
  5.1425 +    </target>
  5.1426 +    <target depends="-init-source-module-properties" name="-init-test-module-properties-without-module" unless="named.module.internal">
  5.1427 +        <property name="javac.test.sourcepath" value="${empty.dir}"/>
  5.1428 +        <property name="javac.test.compilerargs" value=""/>
  5.1429 +        <property name="run.test.jvmargs" value=""/>
  5.1430 +    </target>
  5.1431 +    <target depends="-init-test-javac-module-properties-with-module,-init-test-module-properties-without-module" name="-init-test-module-properties"/>
  5.1432      <target if="do.depend.true" name="-compile-test-depend">
  5.1433          <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
  5.1434      </target>
  5.1435 -    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
  5.1436 -        <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}"/>
  5.1437 +    <target depends="init,deps-jar,compile,-init-test-module-properties,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
  5.1438 +        <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" modulepath="${javac.test.modulepath}" processorpath="${javac.test.processorpath}" sourcepath="${javac.test.sourcepath}" srcdir="${test.src.dir}">
  5.1439 +            <customize>
  5.1440 +                <compilerarg line="${javac.test.compilerargs}"/>
  5.1441 +            </customize>
  5.1442 +        </j2seproject3:javac>
  5.1443          <copy todir="${build.test.classes.dir}">
  5.1444              <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
  5.1445          </copy>
  5.1446 @@ -885,10 +1613,14 @@
  5.1447          <!-- Empty placeholder for easier customization. -->
  5.1448          <!-- You can override this target in the ../build.xml file. -->
  5.1449      </target>
  5.1450 -    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
  5.1451 +    <target depends="init,deps-jar,compile,-init-test-module-properties,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
  5.1452          <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
  5.1453          <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
  5.1454 -        <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}"/>
  5.1455 +        <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}, module-info.java" modulepath="${javac.test.modulepath}" processorpath="${javac.test.processorpath}" sourcepath="${test.src.dir}" srcdir="${test.src.dir}">
  5.1456 +            <customize>
  5.1457 +                <compilerarg line="${javac.test.compilerargs}"/>
  5.1458 +            </customize>
  5.1459 +        </j2seproject3:javac>
  5.1460          <copy todir="${build.test.classes.dir}">
  5.1461              <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
  5.1462          </copy>
  5.1463 @@ -900,14 +1632,14 @@
  5.1464      <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
  5.1465      <!--
  5.1466                  =======================
  5.1467 -                JUNIT EXECUTION SECTION
  5.1468 +                TEST EXECUTION SECTION
  5.1469                  =======================
  5.1470              -->
  5.1471      <target depends="init" if="have.tests" name="-pre-test-run">
  5.1472          <mkdir dir="${build.test.results.dir}"/>
  5.1473      </target>
  5.1474 -    <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
  5.1475 -        <j2seproject3:junit testincludes="**/*Test.java"/>
  5.1476 +    <target depends="init,compile-test,-init-test-run-module-properties,-pre-test-run" if="have.tests" name="-do-test-run">
  5.1477 +        <j2seproject3:test includes="${includes}" testincludes="**/*Test.java"/>
  5.1478      </target>
  5.1479      <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
  5.1480          <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
  5.1481 @@ -918,41 +1650,42 @@
  5.1482      <target depends="init" if="have.tests" name="-pre-test-run-single">
  5.1483          <mkdir dir="${build.test.results.dir}"/>
  5.1484      </target>
  5.1485 -    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
  5.1486 +    <target depends="init,compile-test-single,-init-test-run-module-properties,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
  5.1487          <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
  5.1488 -        <j2seproject3:junit excludes="" includes="${test.includes}"/>
  5.1489 +        <j2seproject3:test excludes="" includes="${test.includes}" testincludes="${test.includes}"/>
  5.1490      </target>
  5.1491      <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
  5.1492          <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
  5.1493      </target>
  5.1494 -    <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"/>
  5.1495 +    <target depends="init,compile-test-single,-init-test-run-module-properties,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/>
  5.1496 +    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single-method">
  5.1497 +        <fail unless="test.class">Must select some files in the IDE or set test.class</fail>
  5.1498 +        <fail unless="test.method">Must select some method in the IDE or set test.method</fail>
  5.1499 +        <j2seproject3:test excludes="" includes="${javac.includes}" testincludes="${test.class}" testmethods="${test.method}"/>
  5.1500 +    </target>
  5.1501 +    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single-method" if="have.tests" name="-post-test-run-single-method">
  5.1502 +        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
  5.1503 +    </target>
  5.1504 +    <target depends="init,compile-test-single,-init-test-run-module-properties,-pre-test-run-single,-do-test-run-single-method,-post-test-run-single-method" description="Run single unit test." name="test-single-method"/>
  5.1505      <!--
  5.1506                  =======================
  5.1507 -                JUNIT DEBUGGING SECTION
  5.1508 +                TEST DEBUGGING SECTION
  5.1509                  =======================
  5.1510              -->
  5.1511 -    <target depends="init,compile-test" if="have.tests" name="-debug-start-debuggee-test">
  5.1512 +    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test">
  5.1513          <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
  5.1514 -        <property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/>
  5.1515 -        <delete file="${test.report.file}"/>
  5.1516 -        <mkdir dir="${build.test.results.dir}"/>
  5.1517 -        <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}">
  5.1518 -            <customize>
  5.1519 -                <syspropertyset>
  5.1520 -                    <propertyref prefix="test-sys-prop."/>
  5.1521 -                    <mapper from="test-sys-prop.*" to="*" type="glob"/>
  5.1522 -                </syspropertyset>
  5.1523 -                <arg value="${test.class}"/>
  5.1524 -                <arg value="showoutput=true"/>
  5.1525 -                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/>
  5.1526 -                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/>
  5.1527 -            </customize>
  5.1528 -        </j2seproject3:debug>
  5.1529 +        <j2seproject3:test-debug excludes="" includes="${javac.includes}" testClass="${test.class}" testincludes="${javac.includes}"/>
  5.1530 +    </target>
  5.1531 +    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test-method">
  5.1532 +        <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
  5.1533 +        <fail unless="test.method">Must select some method in the IDE or set test.method</fail>
  5.1534 +        <j2seproject3:test-debug excludes="" includes="${javac.includes}" testClass="${test.class}" testMethod="${test.method}" testincludes="${test.class}" testmethods="${test.method}"/>
  5.1535      </target>
  5.1536      <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
  5.1537          <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
  5.1538      </target>
  5.1539 -    <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
  5.1540 +    <target depends="init,compile-test-single,-init-test-run-module-properties,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
  5.1541 +    <target depends="init,compile-test-single,-init-test-run-module-properties,-debug-start-debugger-test,-debug-start-debuggee-test-method" name="debug-test-method"/>
  5.1542      <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
  5.1543          <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
  5.1544      </target>
  5.1545 @@ -978,9 +1711,9 @@
  5.1546      <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet">
  5.1547          <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
  5.1548          <j2seproject3:debug classname="sun.applet.AppletViewer">
  5.1549 -            <customize>
  5.1550 +            <customizeDebuggee>
  5.1551                  <arg value="${applet.url}"/>
  5.1552 -            </customize>
  5.1553 +            </customizeDebuggee>
  5.1554          </j2seproject3:debug>
  5.1555      </target>
  5.1556      <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/>
  5.1557 @@ -1007,6 +1740,7 @@
  5.1558      </target>
  5.1559      <target depends="init" name="-do-clean">
  5.1560          <delete dir="${build.dir}"/>
  5.1561 +        <delete dir="${dist.jlink.output}"/>
  5.1562          <delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/>
  5.1563      </target>
  5.1564      <target name="-post-clean">
  5.1565 @@ -1017,9 +1751,12 @@
  5.1566      <target name="-check-call-dep">
  5.1567          <property file="${call.built.properties}" prefix="already.built."/>
  5.1568          <condition property="should.call.dep">
  5.1569 -            <not>
  5.1570 -                <isset property="already.built.${call.subproject}"/>
  5.1571 -            </not>
  5.1572 +            <and>
  5.1573 +                <not>
  5.1574 +                    <isset property="already.built.${call.subproject}"/>
  5.1575 +                </not>
  5.1576 +                <available file="${call.script}"/>
  5.1577 +            </and>
  5.1578          </condition>
  5.1579      </target>
  5.1580      <target depends="-check-call-dep" if="should.call.dep" name="-maybe-call-dep">
     6.1 --- a/samples/cloneproblem/nbproject/genfiles.properties	Mon Nov 11 05:47:32 2019 +0100
     6.2 +++ b/samples/cloneproblem/nbproject/genfiles.properties	Mon Nov 11 13:17:34 2019 +0100
     6.3 @@ -1,8 +1,8 @@
     6.4  build.xml.data.CRC32=2edef413
     6.5 -build.xml.script.CRC32=dba6e1dd
     6.6 -build.xml.stylesheet.CRC32=28e38971@1.42.0.45
     6.7 +build.xml.script.CRC32=b3286d36
     6.8 +build.xml.stylesheet.CRC32=f85dc8f2@1.93.0.48
     6.9  # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
    6.10  # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
    6.11  nbproject/build-impl.xml.data.CRC32=2edef413
    6.12 -nbproject/build-impl.xml.script.CRC32=53b45d06
    6.13 -nbproject/build-impl.xml.stylesheet.CRC32=7bd59c26@1.42.0.45
    6.14 +nbproject/build-impl.xml.script.CRC32=e41d3d3d
    6.15 +nbproject/build-impl.xml.stylesheet.CRC32=f89f7d21@1.93.0.48
     7.1 --- a/samples/cloneproblem/nbproject/project.properties	Mon Nov 11 05:47:32 2019 +0100
     7.2 +++ b/samples/cloneproblem/nbproject/project.properties	Mon Nov 11 13:17:34 2019 +0100
     7.3 @@ -18,8 +18,12 @@
     7.4  #debug.transport=dt_socket
     7.5  debug.classpath=\
     7.6      ${run.classpath}
     7.7 +debug.modulepath=\
     7.8 +    ${run.modulepath}
     7.9  debug.test.classpath=\
    7.10      ${run.test.classpath}
    7.11 +debug.test.modulepath=\
    7.12 +    ${run.test.modulepath}
    7.13  # This directory is removed when the project is cleaned:
    7.14  dist.dir=dist
    7.15  dist.jar=${dist.dir}/cloneproblem.jar
    7.16 @@ -32,6 +36,8 @@
    7.17  # Space-separated list of extra javac options
    7.18  javac.compilerargs=
    7.19  javac.deprecation=false
    7.20 +javac.modulepath=
    7.21 +javac.processormodulepath=
    7.22  javac.processorpath=\
    7.23      ${javac.classpath}
    7.24  javac.source=1.6
    7.25 @@ -40,6 +46,8 @@
    7.26      ${javac.classpath}:\
    7.27      ${build.classes.dir}:\
    7.28      ${file.reference.junit-4.4.jar}
    7.29 +javac.test.modulepath=\
    7.30 +    ${javac.modulepath}
    7.31  javac.test.processorpath=\
    7.32      ${javac.test.classpath}
    7.33  javadoc.additionalparam=
    7.34 @@ -63,9 +71,13 @@
    7.35  # (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
    7.36  # or test-sys-prop.name=value to set system properties for unit tests):
    7.37  run.jvmargs=
    7.38 +run.modulepath=\
    7.39 +    ${javac.modulepath}
    7.40  run.test.classpath=\
    7.41      ${javac.test.classpath}:\
    7.42      ${build.test.classes.dir}
    7.43 +run.test.modulepath=\
    7.44 +    ${javac.test.modulepath}
    7.45  source.encoding=UTF-8
    7.46  src.dir=src
    7.47  test.src.dir=test
     8.1 --- a/samples/codeinjection/build.xml	Mon Nov 11 05:47:32 2019 +0100
     8.2 +++ b/samples/codeinjection/build.xml	Mon Nov 11 13:17:34 2019 +0100
     8.3 @@ -51,8 +51,7 @@
     8.4        -init-macrodef-junit:     defines macro for junit execution
     8.5        -init-macrodef-debug:     defines macro for class debugging
     8.6        -init-macrodef-java:      defines macro for class execution
     8.7 -      -do-jar-with-manifest:    JAR building (if you are using a manifest)
     8.8 -      -do-jar-without-manifest: JAR building (if you are not using a manifest)
     8.9 +      -do-jar:                  JAR building
    8.10        run:                      execution of project 
    8.11        -javadoc-build:           Javadoc generation
    8.12        test-report:              JUnit report generation
     9.1 --- a/samples/codeinjection/nbproject/build-impl.xml	Mon Nov 11 05:47:32 2019 +0100
     9.2 +++ b/samples/codeinjection/nbproject/build-impl.xml	Mon Nov 11 13:17:34 2019 +0100
     9.3 @@ -19,7 +19,7 @@
     9.4    - cleanup
     9.5  
     9.6          -->
     9.7 -<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="codeinjection-impl">
     9.8 +<project xmlns:if="ant:if" 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" xmlns:unless="ant:unless" basedir=".." default="default" name="codeinjection-impl">
     9.9      <fail message="Please build using Ant 1.8.0 or higher.">
    9.10          <condition>
    9.11              <not>
    9.12 @@ -46,14 +46,80 @@
    9.13          <property file="${user.properties.file}"/>
    9.14          <!-- The two properties below are usually overridden -->
    9.15          <!-- by the active platform. Just a fallback. -->
    9.16 -        <property name="default.javac.source" value="1.4"/>
    9.17 -        <property name="default.javac.target" value="1.4"/>
    9.18 +        <property name="default.javac.source" value="1.6"/>
    9.19 +        <property name="default.javac.target" value="1.6"/>
    9.20      </target>
    9.21      <target depends="-pre-init,-init-private,-init-user" name="-init-project">
    9.22          <property file="nbproject/configs/${config}.properties"/>
    9.23          <property file="nbproject/project.properties"/>
    9.24      </target>
    9.25 -    <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init">
    9.26 +    <target name="-init-modules-supported">
    9.27 +        <condition property="modules.supported.internal" value="true">
    9.28 +            <not>
    9.29 +                <matches pattern="1\.[0-8](\..*)?" string="${javac.source}"/>
    9.30 +            </not>
    9.31 +        </condition>
    9.32 +    </target>
    9.33 +    <target depends="-init-modules-supported" if="modules.supported.internal" name="-init-macrodef-modulename">
    9.34 +        <macrodef name="modulename" uri="http://www.netbeans.org/ns/j2se-project/3">
    9.35 +            <attribute name="property"/>
    9.36 +            <attribute name="sourcepath"/>
    9.37 +            <sequential>
    9.38 +                <loadresource property="@{property}" quiet="true">
    9.39 +                    <javaresource classpath="@{sourcepath}" name="module-info.java" parentFirst="false"/>
    9.40 +                    <filterchain>
    9.41 +                        <stripjavacomments/>
    9.42 +                        <linecontainsregexp>
    9.43 +                            <regexp pattern="module .* \{"/>
    9.44 +                        </linecontainsregexp>
    9.45 +                        <tokenfilter>
    9.46 +                            <linetokenizer/>
    9.47 +                            <replaceregex flags="s" pattern="(\s*module\s+)(\S*)(\s*\{.*)" replace="\2"/>
    9.48 +                        </tokenfilter>
    9.49 +                        <striplinebreaks/>
    9.50 +                    </filterchain>
    9.51 +                </loadresource>
    9.52 +            </sequential>
    9.53 +        </macrodef>
    9.54 +    </target>
    9.55 +    <target depends="-init-modules-supported,-init-macrodef-modulename" if="modules.supported.internal" name="-init-source-module-properties">
    9.56 +        <fail message="Java 9 support requires Ant 1.10.0 or higher.">
    9.57 +            <condition>
    9.58 +                <not>
    9.59 +                    <antversion atleast="1.10.0"/>
    9.60 +                </not>
    9.61 +            </condition>
    9.62 +        </fail>
    9.63 +        <j2seproject3:modulename property="module.name" sourcepath="${src.dir}"/>
    9.64 +        <condition property="named.module.internal">
    9.65 +            <and>
    9.66 +                <isset property="module.name"/>
    9.67 +                <length length="0" string="${module.name}" when="greater"/>
    9.68 +            </and>
    9.69 +        </condition>
    9.70 +        <condition property="unnamed.module.internal">
    9.71 +            <not>
    9.72 +                <isset property="named.module.internal"/>
    9.73 +            </not>
    9.74 +        </condition>
    9.75 +        <property name="javac.modulepath" value=""/>
    9.76 +        <property name="run.modulepath" value="${javac.modulepath}"/>
    9.77 +        <property name="module.build.classes.dir" value="${build.classes.dir}"/>
    9.78 +        <property name="debug.modulepath" value="${run.modulepath}"/>
    9.79 +        <property name="javac.upgrademodulepath" value=""/>
    9.80 +        <property name="run.upgrademodulepath" value="${javac.upgrademodulepath}"/>
    9.81 +        <condition else="" property="javac.systemmodulepath.cmd.line.arg" value="--system '${javac.systemmodulepath}'">
    9.82 +            <and>
    9.83 +                <isset property="javac.systemmodulepath"/>
    9.84 +                <length length="0" string="${javac.systemmodulepath}" when="greater"/>
    9.85 +            </and>
    9.86 +        </condition>
    9.87 +        <property name="dist.jlink.dir" value="${dist.dir}/jlink"/>
    9.88 +        <property name="dist.jlink.output" value="${dist.jlink.dir}/${application.title}"/>
    9.89 +        <property name="module.name" value=""/>
    9.90 +    </target>
    9.91 +    <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property,-init-modules-supported" name="-do-init">
    9.92 +        <property name="platform.java" value="${java.home}/bin/java"/>
    9.93          <available file="${manifest.file}" property="manifest.available"/>
    9.94          <condition property="splashscreen.available">
    9.95              <and>
    9.96 @@ -71,31 +137,22 @@
    9.97                  </not>
    9.98              </and>
    9.99          </condition>
   9.100 -        <condition property="manifest.available+main.class">
   9.101 +        <condition property="profile.available">
   9.102              <and>
   9.103 -                <isset property="manifest.available"/>
   9.104 -                <isset property="main.class.available"/>
   9.105 +                <isset property="javac.profile"/>
   9.106 +                <length length="0" string="${javac.profile}" when="greater"/>
   9.107 +                <not>
   9.108 +                    <matches pattern="1\.[0-7](\..*)?" string="${javac.source}"/>
   9.109 +                </not>
   9.110              </and>
   9.111          </condition>
   9.112          <condition property="do.archive">
   9.113 -            <not>
   9.114 -                <istrue value="${jar.archive.disabled}"/>
   9.115 -            </not>
   9.116 -        </condition>
   9.117 -        <condition property="do.mkdist">
   9.118 -            <and>
   9.119 -                <isset property="do.archive"/>
   9.120 -                <isset property="libs.CopyLibs.classpath"/>
   9.121 +            <or>
   9.122                  <not>
   9.123 -                    <istrue value="${mkdist.disabled}"/>
   9.124 +                    <istrue value="${jar.archive.disabled}"/>
   9.125                  </not>
   9.126 -            </and>
   9.127 -        </condition>
   9.128 -        <condition property="manifest.available+main.class+mkdist.available">
   9.129 -            <and>
   9.130 -                <istrue value="${manifest.available+main.class}"/>
   9.131 -                <isset property="do.mkdist"/>
   9.132 -            </and>
   9.133 +                <istrue value="${not.archive.disabled}"/>
   9.134 +            </or>
   9.135          </condition>
   9.136          <condition property="do.archive+manifest.available">
   9.137              <and>
   9.138 @@ -115,24 +172,12 @@
   9.139                  <istrue value="${do.archive}"/>
   9.140              </and>
   9.141          </condition>
   9.142 -        <condition property="do.archive+manifest.available+main.class">
   9.143 +        <condition property="do.archive+profile.available">
   9.144              <and>
   9.145 -                <istrue value="${manifest.available+main.class}"/>
   9.146 +                <isset property="profile.available"/>
   9.147                  <istrue value="${do.archive}"/>
   9.148              </and>
   9.149          </condition>
   9.150 -        <condition property="manifest.available-mkdist.available">
   9.151 -            <or>
   9.152 -                <istrue value="${manifest.available}"/>
   9.153 -                <isset property="do.mkdist"/>
   9.154 -            </or>
   9.155 -        </condition>
   9.156 -        <condition property="manifest.available+main.class-mkdist.available">
   9.157 -            <or>
   9.158 -                <istrue value="${manifest.available+main.class}"/>
   9.159 -                <isset property="do.mkdist"/>
   9.160 -            </or>
   9.161 -        </condition>
   9.162          <condition property="have.tests">
   9.163              <or>
   9.164                  <available file="${test.src.dir}"/>
   9.165 @@ -169,6 +214,7 @@
   9.166          <property name="application.args" value=""/>
   9.167          <property name="source.encoding" value="${file.encoding}"/>
   9.168          <property name="runtime.encoding" value="${source.encoding}"/>
   9.169 +        <property name="manifest.encoding" value="${source.encoding}"/>
   9.170          <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
   9.171              <and>
   9.172                  <isset property="javadoc.encoding"/>
   9.173 @@ -186,7 +232,15 @@
   9.174          </condition>
   9.175          <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
   9.176          <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
   9.177 -            <length length="0" string="${endorsed.classpath}" when="greater"/>
   9.178 +            <and>
   9.179 +                <isset property="endorsed.classpath"/>
   9.180 +                <not>
   9.181 +                    <equals arg1="${endorsed.classpath}" arg2="" trim="true"/>
   9.182 +                </not>
   9.183 +            </and>
   9.184 +        </condition>
   9.185 +        <condition else="" property="javac.profile.cmd.line.arg" value="-profile ${javac.profile}">
   9.186 +            <isset property="profile.available"/>
   9.187          </condition>
   9.188          <condition else="false" property="jdkBug6558476">
   9.189              <and>
   9.190 @@ -196,7 +250,12 @@
   9.191                  </not>
   9.192              </and>
   9.193          </condition>
   9.194 -        <property name="javac.fork" value="${jdkBug6558476}"/>
   9.195 +        <condition else="false" property="javac.fork">
   9.196 +            <or>
   9.197 +                <istrue value="${jdkBug6558476}"/>
   9.198 +                <istrue value="${javac.external.vm}"/>
   9.199 +            </or>
   9.200 +        </condition>
   9.201          <property name="jar.index" value="false"/>
   9.202          <property name="jar.index.metainf" value="${jar.index}"/>
   9.203          <property name="copylibs.rebase" value="true"/>
   9.204 @@ -222,6 +281,7 @@
   9.205          <condition else="" property="testng.debug.mode" value="-mixed">
   9.206              <istrue value="${junit+testng.available}"/>
   9.207          </condition>
   9.208 +        <property name="java.failonerror" value="true"/>
   9.209      </target>
   9.210      <target name="-post-init">
   9.211          <!-- Empty placeholder for easier customization. -->
   9.212 @@ -248,11 +308,80 @@
   9.213              </sequential>
   9.214          </macrodef>
   9.215      </target>
   9.216 -    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors">
   9.217 +    <target depends="-init-ap-cmdline-properties,-init-source-module-properties" if="modules.supported.internal" name="-init-macrodef-javac-with-module">
   9.218          <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
   9.219              <attribute default="${src.dir}" name="srcdir"/>
   9.220              <attribute default="${build.classes.dir}" name="destdir"/>
   9.221              <attribute default="${javac.classpath}" name="classpath"/>
   9.222 +            <attribute default="${javac.modulepath}" name="modulepath"/>
   9.223 +            <attribute default="${javac.upgrademodulepath}" name="upgrademodulepath"/>
   9.224 +            <attribute default="${javac.processorpath}" name="processorpath"/>
   9.225 +            <attribute default="${javac.processormodulepath}" name="processormodulepath"/>
   9.226 +            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
   9.227 +            <attribute default="${includes}" name="includes"/>
   9.228 +            <attribute default="${excludes}" name="excludes"/>
   9.229 +            <attribute default="${javac.debug}" name="debug"/>
   9.230 +            <attribute default="${empty.dir}" name="sourcepath" unless:set="named.module.internal"/>
   9.231 +            <attribute default="${src.dir}" if:set="named.module.internal" name="sourcepath"/>
   9.232 +            <attribute default="${empty.dir}" name="gensrcdir"/>
   9.233 +            <element name="customize" optional="true"/>
   9.234 +            <sequential>
   9.235 +                <condition property="warn.excludes.internal">
   9.236 +                    <and>
   9.237 +                        <isset property="named.module.internal"/>
   9.238 +                        <length length="0" string="@{excludes}" trim="true" when="greater"/>
   9.239 +                    </and>
   9.240 +                </condition>
   9.241 +                <echo if:set="warn.excludes.internal" level="warning" message="The javac excludes are not supported in the JDK 9 Named Module."/>
   9.242 +                <property location="${build.dir}/empty" name="empty.dir"/>
   9.243 +                <mkdir dir="${empty.dir}"/>
   9.244 +                <mkdir dir="@{apgeneratedsrcdir}"/>
   9.245 +                <condition property="processormodulepath.set">
   9.246 +                    <resourcecount count="0" when="greater">
   9.247 +                        <path>
   9.248 +                            <pathelement path="@{processormodulepath}"/>
   9.249 +                        </path>
   9.250 +                    </resourcecount>
   9.251 +                </condition>
   9.252 +                <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}">
   9.253 +                    <src>
   9.254 +                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
   9.255 +                            <include name="*"/>
   9.256 +                        </dirset>
   9.257 +                    </src>
   9.258 +                    <classpath>
   9.259 +                        <path path="@{classpath}"/>
   9.260 +                    </classpath>
   9.261 +                    <modulepath>
   9.262 +                        <path path="@{modulepath}"/>
   9.263 +                    </modulepath>
   9.264 +                    <upgrademodulepath>
   9.265 +                        <path path="@{upgrademodulepath}"/>
   9.266 +                    </upgrademodulepath>
   9.267 +                    <compilerarg line="${javac.systemmodulepath.cmd.line.arg}"/>
   9.268 +                    <compilerarg line="${javac.profile.cmd.line.arg}"/>
   9.269 +                    <compilerarg line="${javac.compilerargs}"/>
   9.270 +                    <compilerarg if:set="processormodulepath.set" value="--processor-module-path"/>
   9.271 +                    <compilerarg if:set="processormodulepath.set" path="@{processormodulepath}"/>
   9.272 +                    <compilerarg unless:set="processormodulepath.set" value="-processorpath"/>
   9.273 +                    <compilerarg path="@{processorpath}:${empty.dir}" unless:set="processormodulepath.set"/>
   9.274 +                    <compilerarg line="${ap.processors.internal}"/>
   9.275 +                    <compilerarg line="${annotation.processing.processor.options}"/>
   9.276 +                    <compilerarg value="-s"/>
   9.277 +                    <compilerarg path="@{apgeneratedsrcdir}"/>
   9.278 +                    <compilerarg line="${ap.proc.none.internal}"/>
   9.279 +                    <customize/>
   9.280 +                </javac>
   9.281 +            </sequential>
   9.282 +        </macrodef>
   9.283 +    </target>
   9.284 +    <target depends="-init-ap-cmdline-properties,-init-source-module-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors" unless="modules.supported.internal">
   9.285 +        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
   9.286 +            <attribute default="${src.dir}" name="srcdir"/>
   9.287 +            <attribute default="${build.classes.dir}" name="destdir"/>
   9.288 +            <attribute default="${javac.classpath}" name="classpath"/>
   9.289 +            <attribute default="${javac.modulepath}" name="modulepath"/>
   9.290 +            <attribute default="${javac.upgrademodulepath}" name="upgrademodulepath"/>
   9.291              <attribute default="${javac.processorpath}" name="processorpath"/>
   9.292              <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
   9.293              <attribute default="${includes}" name="includes"/>
   9.294 @@ -275,6 +404,7 @@
   9.295                          <path path="@{classpath}"/>
   9.296                      </classpath>
   9.297                      <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
   9.298 +                    <compilerarg line="${javac.profile.cmd.line.arg}"/>
   9.299                      <compilerarg line="${javac.compilerargs}"/>
   9.300                      <compilerarg value="-processorpath"/>
   9.301                      <compilerarg path="@{processorpath}:${empty.dir}"/>
   9.302 @@ -288,11 +418,13 @@
   9.303              </sequential>
   9.304          </macrodef>
   9.305      </target>
   9.306 -    <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
   9.307 +    <target depends="-init-ap-cmdline-properties,-init-source-module-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
   9.308          <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
   9.309              <attribute default="${src.dir}" name="srcdir"/>
   9.310              <attribute default="${build.classes.dir}" name="destdir"/>
   9.311              <attribute default="${javac.classpath}" name="classpath"/>
   9.312 +            <attribute default="${javac.modulepath}" name="modulepath"/>
   9.313 +            <attribute default="${javac.upgrademodulepath}" name="upgrademodulepath"/>
   9.314              <attribute default="${javac.processorpath}" name="processorpath"/>
   9.315              <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
   9.316              <attribute default="${includes}" name="includes"/>
   9.317 @@ -314,13 +446,14 @@
   9.318                          <path path="@{classpath}"/>
   9.319                      </classpath>
   9.320                      <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
   9.321 +                    <compilerarg line="${javac.profile.cmd.line.arg}"/>
   9.322                      <compilerarg line="${javac.compilerargs}"/>
   9.323                      <customize/>
   9.324                  </javac>
   9.325              </sequential>
   9.326          </macrodef>
   9.327      </target>
   9.328 -    <target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
   9.329 +    <target depends="-init-macrodef-javac-with-module,-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
   9.330          <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
   9.331              <attribute default="${src.dir}" name="srcdir"/>
   9.332              <attribute default="${build.classes.dir}" name="destdir"/>
   9.333 @@ -370,7 +503,64 @@
   9.334              </and>
   9.335          </condition>
   9.336      </target>
   9.337 -    <target if="${nb.junit.single}" name="-init-macrodef-junit-single" unless="${nb.junit.batch}">
   9.338 +    <target name="-init-test-properties">
   9.339 +        <property name="test.binaryincludes" value="&lt;nothing&gt;"/>
   9.340 +        <property name="test.binarytestincludes" value=""/>
   9.341 +        <property name="test.binaryexcludes" value=""/>
   9.342 +    </target>
   9.343 +    <target depends="-init-modules-supported" if="modules.supported.internal" name="-init-macrodef-junit-prototype-with-module">
   9.344 +        <macrodef name="junit-prototype" uri="http://www.netbeans.org/ns/j2se-project/3">
   9.345 +            <attribute default="${includes}" name="includes"/>
   9.346 +            <attribute default="${excludes}" name="excludes"/>
   9.347 +            <element name="customizePrototype" optional="true"/>
   9.348 +            <sequential>
   9.349 +                <property name="junit.forkmode" value="perTest"/>
   9.350 +                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
   9.351 +                    <syspropertyset>
   9.352 +                        <propertyref prefix="test-sys-prop."/>
   9.353 +                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
   9.354 +                    </syspropertyset>
   9.355 +                    <classpath>
   9.356 +                        <path path="${run.test.classpath}"/>
   9.357 +                    </classpath>
   9.358 +                    <modulepath>
   9.359 +                        <path path="${run.test.modulepath}"/>
   9.360 +                    </modulepath>
   9.361 +                    <formatter type="brief" usefile="false"/>
   9.362 +                    <formatter type="xml"/>
   9.363 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   9.364 +                    <jvmarg value="-ea"/>
   9.365 +                    <jvmarg line="${run.test.jvmargs}"/>
   9.366 +                    <customizePrototype/>
   9.367 +                </junit>
   9.368 +            </sequential>
   9.369 +        </macrodef>
   9.370 +    </target>
   9.371 +    <target depends="-init-modules-supported" name="-init-macrodef-junit-prototype-without-module" unless="modules.supported.internal">
   9.372 +        <macrodef name="junit-prototype" uri="http://www.netbeans.org/ns/j2se-project/3">
   9.373 +            <attribute default="${includes}" name="includes"/>
   9.374 +            <attribute default="${excludes}" name="excludes"/>
   9.375 +            <element name="customizePrototype" optional="true"/>
   9.376 +            <sequential>
   9.377 +                <property name="junit.forkmode" value="perTest"/>
   9.378 +                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
   9.379 +                    <syspropertyset>
   9.380 +                        <propertyref prefix="test-sys-prop."/>
   9.381 +                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
   9.382 +                    </syspropertyset>
   9.383 +                    <classpath>
   9.384 +                        <path path="${run.test.classpath}"/>
   9.385 +                    </classpath>
   9.386 +                    <formatter type="brief" usefile="false"/>
   9.387 +                    <formatter type="xml"/>
   9.388 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   9.389 +                    <jvmarg value="-ea"/>
   9.390 +                    <customizePrototype/>
   9.391 +                </junit>
   9.392 +            </sequential>
   9.393 +        </macrodef>
   9.394 +    </target>
   9.395 +    <target depends="-init-test-properties,-init-macrodef-junit-prototype-with-module,-init-macrodef-junit-prototype-without-module" if="${nb.junit.single}" name="-init-macrodef-junit-single" unless="${nb.junit.batch}">
   9.396          <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
   9.397              <attribute default="${includes}" name="includes"/>
   9.398              <attribute default="${excludes}" name="excludes"/>
   9.399 @@ -378,22 +568,16 @@
   9.400              <attribute default="" name="testmethods"/>
   9.401              <element name="customize" optional="true"/>
   9.402              <sequential>
   9.403 -                <property name="junit.forkmode" value="perTest"/>
   9.404 -                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
   9.405 -                    <test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/>
   9.406 -                    <syspropertyset>
   9.407 -                        <propertyref prefix="test-sys-prop."/>
   9.408 -                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
   9.409 -                    </syspropertyset>
   9.410 -                    <formatter type="brief" usefile="false"/>
   9.411 -                    <formatter type="xml"/>
   9.412 -                    <jvmarg value="-ea"/>
   9.413 -                    <customize/>
   9.414 -                </junit>
   9.415 +                <j2seproject3:junit-prototype>
   9.416 +                    <customizePrototype>
   9.417 +                        <test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/>
   9.418 +                        <customize/>
   9.419 +                    </customizePrototype>
   9.420 +                </j2seproject3:junit-prototype>
   9.421              </sequential>
   9.422          </macrodef>
   9.423      </target>
   9.424 -    <target if="${nb.junit.batch}" name="-init-macrodef-junit-batch" unless="${nb.junit.single}">
   9.425 +    <target depends="-init-test-properties,-init-macrodef-junit-prototype-with-module,-init-macrodef-junit-prototype-without-module" if="${nb.junit.batch}" name="-init-macrodef-junit-batch" unless="${nb.junit.single}">
   9.426          <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
   9.427              <attribute default="${includes}" name="includes"/>
   9.428              <attribute default="${excludes}" name="excludes"/>
   9.429 @@ -401,22 +585,19 @@
   9.430              <attribute default="" name="testmethods"/>
   9.431              <element name="customize" optional="true"/>
   9.432              <sequential>
   9.433 -                <property name="junit.forkmode" value="perTest"/>
   9.434 -                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
   9.435 -                    <batchtest todir="${build.test.results.dir}">
   9.436 -                        <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
   9.437 -                            <filename name="@{testincludes}"/>
   9.438 -                        </fileset>
   9.439 -                    </batchtest>
   9.440 -                    <syspropertyset>
   9.441 -                        <propertyref prefix="test-sys-prop."/>
   9.442 -                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
   9.443 -                    </syspropertyset>
   9.444 -                    <formatter type="brief" usefile="false"/>
   9.445 -                    <formatter type="xml"/>
   9.446 -                    <jvmarg value="-ea"/>
   9.447 -                    <customize/>
   9.448 -                </junit>
   9.449 +                <j2seproject3:junit-prototype>
   9.450 +                    <customizePrototype>
   9.451 +                        <batchtest todir="${build.test.results.dir}">
   9.452 +                            <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
   9.453 +                                <filename name="@{testincludes}"/>
   9.454 +                            </fileset>
   9.455 +                            <fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}">
   9.456 +                                <filename name="${test.binarytestincludes}"/>
   9.457 +                            </fileset>
   9.458 +                        </batchtest>
   9.459 +                        <customize/>
   9.460 +                    </customizePrototype>
   9.461 +                </j2seproject3:junit-prototype>
   9.462              </sequential>
   9.463          </macrodef>
   9.464      </target>
   9.465 @@ -438,12 +619,16 @@
   9.466                      </fileset>
   9.467                  </union>
   9.468                  <taskdef classname="org.testng.TestNGAntTask" classpath="${run.test.classpath}" name="testng"/>
   9.469 -                <testng classfilesetref="test.set" failureProperty="tests.failed" methods="${testng.methods.arg}" mode="${testng.mode}" outputdir="${build.test.results.dir}" suitename="codeinjection" testname="TestNG tests" workingDir="${work.dir}">
   9.470 +                <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="codeinjection" testname="TestNG tests" workingDir="${work.dir}">
   9.471                      <xmlfileset dir="${build.test.classes.dir}" includes="@{testincludes}"/>
   9.472                      <propertyset>
   9.473                          <propertyref prefix="test-sys-prop."/>
   9.474                          <mapper from="test-sys-prop.*" to="*" type="glob"/>
   9.475                      </propertyset>
   9.476 +                    <classpath>
   9.477 +                        <path path="${run.test.classpath}"/>
   9.478 +                    </classpath>
   9.479 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   9.480                      <customize/>
   9.481                  </testng>
   9.482              </sequential>
   9.483 @@ -498,10 +683,6 @@
   9.484              <sequential>
   9.485                  <j2seproject3:test-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
   9.486                      <customize>
   9.487 -                        <classpath>
   9.488 -                            <path path="${run.test.classpath}"/>
   9.489 -                        </classpath>
   9.490 -                        <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   9.491                          <jvmarg line="${run.jvmargs}"/>
   9.492                          <jvmarg line="${run.jvmargs.ide}"/>
   9.493                      </customize>
   9.494 @@ -509,71 +690,20 @@
   9.495              </sequential>
   9.496          </macrodef>
   9.497      </target>
   9.498 -    <target if="${junit.available}" name="-init-macrodef-junit-debug" unless="${nb.junit.batch}">
   9.499 -        <macrodef name="junit-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
   9.500 -            <attribute default="${includes}" name="includes"/>
   9.501 -            <attribute default="${excludes}" name="excludes"/>
   9.502 -            <attribute default="**" name="testincludes"/>
   9.503 -            <attribute default="" name="testmethods"/>
   9.504 -            <element name="customize" optional="true"/>
   9.505 -            <sequential>
   9.506 -                <property name="junit.forkmode" value="perTest"/>
   9.507 -                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
   9.508 -                    <test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/>
   9.509 -                    <syspropertyset>
   9.510 -                        <propertyref prefix="test-sys-prop."/>
   9.511 -                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
   9.512 -                    </syspropertyset>
   9.513 -                    <formatter type="brief" usefile="false"/>
   9.514 -                    <formatter type="xml"/>
   9.515 -                    <jvmarg value="-ea"/>
   9.516 -                    <jvmarg line="${debug-args-line}"/>
   9.517 -                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
   9.518 -                    <customize/>
   9.519 -                </junit>
   9.520 -            </sequential>
   9.521 -        </macrodef>
   9.522 -    </target>
   9.523 -    <target if="${nb.junit.batch}" name="-init-macrodef-junit-debug-batch">
   9.524 -        <macrodef name="junit-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
   9.525 -            <attribute default="${includes}" name="includes"/>
   9.526 -            <attribute default="${excludes}" name="excludes"/>
   9.527 -            <attribute default="**" name="testincludes"/>
   9.528 -            <attribute default="" name="testmethods"/>
   9.529 -            <element name="customize" optional="true"/>
   9.530 -            <sequential>
   9.531 -                <property name="junit.forkmode" value="perTest"/>
   9.532 -                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
   9.533 -                    <batchtest todir="${build.test.results.dir}">
   9.534 -                        <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
   9.535 -                            <filename name="@{testincludes}"/>
   9.536 -                        </fileset>
   9.537 -                    </batchtest>
   9.538 -                    <syspropertyset>
   9.539 -                        <propertyref prefix="test-sys-prop."/>
   9.540 -                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
   9.541 -                    </syspropertyset>
   9.542 -                    <formatter type="brief" usefile="false"/>
   9.543 -                    <formatter type="xml"/>
   9.544 -                    <jvmarg value="-ea"/>
   9.545 -                    <jvmarg line="${debug-args-line}"/>
   9.546 -                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
   9.547 -                    <customize/>
   9.548 -                </junit>
   9.549 -            </sequential>
   9.550 -        </macrodef>
   9.551 -    </target>
   9.552 -    <target depends="-init-macrodef-junit-debug,-init-macrodef-junit-debug-batch" if="${junit.available}" name="-init-macrodef-junit-debug-impl">
   9.553 +    <target depends="-init-macrodef-junit" if="${junit.available}" name="-init-macrodef-junit-debug-impl">
   9.554          <macrodef name="test-debug-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
   9.555              <attribute default="${includes}" name="includes"/>
   9.556              <attribute default="${excludes}" name="excludes"/>
   9.557              <attribute default="**" name="testincludes"/>
   9.558              <attribute default="" name="testmethods"/>
   9.559 -            <element implicit="true" name="customize" optional="true"/>
   9.560 +            <element name="customizeDebuggee" optional="true"/>
   9.561              <sequential>
   9.562 -                <j2seproject3:junit-debug excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
   9.563 -                    <customize/>
   9.564 -                </j2seproject3:junit-debug>
   9.565 +                <j2seproject3:junit excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
   9.566 +                    <customize>
   9.567 +                        <jvmarg value="-agentlib:jdwp=transport=${debug-transport},address=${jpda.address}"/>
   9.568 +                        <customizeDebuggee/>
   9.569 +                    </customize>
   9.570 +                </j2seproject3:junit>
   9.571              </sequential>
   9.572          </macrodef>
   9.573      </target>
   9.574 @@ -592,14 +722,14 @@
   9.575                  <delete dir="${build.test.results.dir}" quiet="true"/>
   9.576                  <mkdir dir="${build.test.results.dir}"/>
   9.577                  <j2seproject3:debug classname="org.testng.TestNG" classpath="${debug.test.classpath}">
   9.578 -                    <customize>
   9.579 +                    <customizeDebuggee>
   9.580                          <customize2/>
   9.581                          <jvmarg value="-ea"/>
   9.582                          <arg line="${testng.debug.mode}"/>
   9.583                          <arg line="-d ${build.test.results.dir}"/>
   9.584                          <arg line="-listener org.testng.reporters.VerboseReporter"/>
   9.585                          <arg line="${testng.cmd.args}"/>
   9.586 -                    </customize>
   9.587 +                    </customizeDebuggee>
   9.588                  </j2seproject3:debug>
   9.589              </sequential>
   9.590          </macrodef>
   9.591 @@ -626,14 +756,10 @@
   9.592              <attribute default="" name="testMethod"/>
   9.593              <sequential>
   9.594                  <j2seproject3:test-debug-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
   9.595 -                    <customize>
   9.596 -                        <classpath>
   9.597 -                            <path path="${run.test.classpath}"/>
   9.598 -                        </classpath>
   9.599 -                        <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   9.600 +                    <customizeDebuggee>
   9.601                          <jvmarg line="${run.jvmargs}"/>
   9.602                          <jvmarg line="${run.jvmargs.ide}"/>
   9.603 -                    </customize>
   9.604 +                    </customizeDebuggee>
   9.605                  </j2seproject3:test-debug-impl>
   9.606              </sequential>
   9.607          </macrodef>
   9.608 @@ -685,7 +811,7 @@
   9.609              <sequential>
   9.610                  <property environment="env"/>
   9.611                  <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
   9.612 -                <java classname="@{classname}" dir="${profiler.info.dir}" fork="true" jvm="${profiler.info.jvm}">
   9.613 +                <java classname="@{classname}" dir="${profiler.info.dir}" failonerror="${java.failonerror}" fork="true" jvm="${profiler.info.jvm}">
   9.614                      <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   9.615                      <jvmarg value="${profiler.info.jvmargs.agent}"/>
   9.616                      <jvmarg line="${profiler.info.jvmargs}"/>
   9.617 @@ -713,10 +839,14 @@
   9.618      <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
   9.619          <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
   9.620              <attribute default="${main.class}" name="name"/>
   9.621 +            <attribute default="${debug.modulepath}" name="modulepath"/>
   9.622              <attribute default="${debug.classpath}" name="classpath"/>
   9.623              <attribute default="" name="stopclassname"/>
   9.624              <sequential>
   9.625                  <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport}">
   9.626 +                    <modulepath>
   9.627 +                        <path path="@{modulepath}"/>
   9.628 +                    </modulepath>
   9.629                      <classpath>
   9.630                          <path path="@{classpath}"/>
   9.631                      </classpath>
   9.632 @@ -735,18 +865,6 @@
   9.633          </macrodef>
   9.634      </target>
   9.635      <target name="-init-debug-args">
   9.636 -        <property name="version-output" value="java version &quot;${ant.java.version}"/>
   9.637 -        <condition property="have-jdk-older-than-1.4">
   9.638 -            <or>
   9.639 -                <contains string="${version-output}" substring="java version &quot;1.0"/>
   9.640 -                <contains string="${version-output}" substring="java version &quot;1.1"/>
   9.641 -                <contains string="${version-output}" substring="java version &quot;1.2"/>
   9.642 -                <contains string="${version-output}" substring="java version &quot;1.3"/>
   9.643 -            </or>
   9.644 -        </condition>
   9.645 -        <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
   9.646 -            <istrue value="${have-jdk-older-than-1.4}"/>
   9.647 -        </condition>
   9.648          <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
   9.649              <os family="windows"/>
   9.650          </condition>
   9.651 @@ -756,21 +874,46 @@
   9.652      </target>
   9.653      <target depends="-init-debug-args" name="-init-macrodef-debug">
   9.654          <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
   9.655 +            <attribute default="${module.name}" name="modulename"/>
   9.656              <attribute default="${main.class}" name="classname"/>
   9.657 +            <attribute default="${debug.modulepath}" name="modulepath"/>
   9.658              <attribute default="${debug.classpath}" name="classpath"/>
   9.659 +            <element name="customizeDebuggee" optional="true"/>
   9.660 +            <sequential>
   9.661 +                <j2seproject1:java classname="@{classname}" classpath="@{classpath}" modulename="@{modulename}" modulepath="@{modulepath}">
   9.662 +                    <customize>
   9.663 +                        <jvmarg value="-agentlib:jdwp=transport=${debug-transport},address=${jpda.address}"/>
   9.664 +                        <customizeDebuggee/>
   9.665 +                    </customize>
   9.666 +                </j2seproject1:java>
   9.667 +            </sequential>
   9.668 +        </macrodef>
   9.669 +    </target>
   9.670 +    <target depends="-init-source-module-properties" if="named.module.internal" name="-init-macrodef-java-with-module">
   9.671 +        <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
   9.672 +            <attribute default="${module.name}" name="modulename"/>
   9.673 +            <attribute default="${main.class}" name="classname"/>
   9.674 +            <attribute default="${run.modulepath}" name="modulepath"/>
   9.675 +            <attribute default="${run.upgrademodulepath}" name="upgrademodulepath"/>
   9.676 +            <attribute default="${run.classpath}" name="classpath"/>
   9.677 +            <attribute default="jvm" name="jvm"/>
   9.678              <element name="customize" optional="true"/>
   9.679              <sequential>
   9.680 -                <java classname="@{classname}" dir="${work.dir}" fork="true">
   9.681 -                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   9.682 -                    <jvmarg line="${debug-args-line}"/>
   9.683 -                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
   9.684 +                <java classname="@{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true" module="@{modulename}">
   9.685 +                    <classpath>
   9.686 +                        <path path="@{classpath}"/>
   9.687 +                    </classpath>
   9.688 +                    <modulepath>
   9.689 +                        <pathelement path="@{modulepath}"/>
   9.690 +                        <pathelement location="${module.build.classes.dir}"/>
   9.691 +                    </modulepath>
   9.692 +                    <upgrademodulepath>
   9.693 +                        <path path="@{upgrademodulepath}"/>
   9.694 +                    </upgrademodulepath>
   9.695                      <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
   9.696                      <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
   9.697                      <jvmarg line="${run.jvmargs}"/>
   9.698                      <jvmarg line="${run.jvmargs.ide}"/>
   9.699 -                    <classpath>
   9.700 -                        <path path="@{classpath}"/>
   9.701 -                    </classpath>
   9.702                      <syspropertyset>
   9.703                          <propertyref prefix="run-sys-prop."/>
   9.704                          <mapper from="run-sys-prop.*" to="*" type="glob"/>
   9.705 @@ -780,14 +923,49 @@
   9.706              </sequential>
   9.707          </macrodef>
   9.708      </target>
   9.709 -    <target name="-init-macrodef-java">
   9.710 +    <target depends="-init-source-module-properties" if="unnamed.module.internal" name="-init-macrodef-java-with-unnamed-module">
   9.711          <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
   9.712 +            <attribute default="" name="modulename"/>
   9.713              <attribute default="${main.class}" name="classname"/>
   9.714 +            <attribute default="${run.modulepath}" name="modulepath"/>
   9.715 +            <attribute default="${run.upgrademodulepath}" name="upgrademodulepath"/>
   9.716              <attribute default="${run.classpath}" name="classpath"/>
   9.717              <attribute default="jvm" name="jvm"/>
   9.718              <element name="customize" optional="true"/>
   9.719              <sequential>
   9.720 -                <java classname="@{classname}" dir="${work.dir}" fork="true">
   9.721 +                <java classname="@{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true">
   9.722 +                    <classpath>
   9.723 +                        <path path="@{classpath}"/>
   9.724 +                    </classpath>
   9.725 +                    <modulepath>
   9.726 +                        <path path="@{modulepath}"/>
   9.727 +                    </modulepath>
   9.728 +                    <upgrademodulepath>
   9.729 +                        <path path="@{upgrademodulepath}"/>
   9.730 +                    </upgrademodulepath>
   9.731 +                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
   9.732 +                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
   9.733 +                    <jvmarg line="${run.jvmargs}"/>
   9.734 +                    <jvmarg line="${run.jvmargs.ide}"/>
   9.735 +                    <syspropertyset>
   9.736 +                        <propertyref prefix="run-sys-prop."/>
   9.737 +                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
   9.738 +                    </syspropertyset>
   9.739 +                    <customize/>
   9.740 +                </java>
   9.741 +            </sequential>
   9.742 +        </macrodef>
   9.743 +    </target>
   9.744 +    <target depends="-init-source-module-properties" name="-init-macrodef-java-without-module" unless="modules.supported.internal">
   9.745 +        <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
   9.746 +            <attribute default="" name="modulename"/>
   9.747 +            <attribute default="${main.class}" name="classname"/>
   9.748 +            <attribute default="" name="modulepath"/>
   9.749 +            <attribute default="${run.classpath}" name="classpath"/>
   9.750 +            <attribute default="jvm" name="jvm"/>
   9.751 +            <element name="customize" optional="true"/>
   9.752 +            <sequential>
   9.753 +                <java classname="@{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true">
   9.754                      <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   9.755                      <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
   9.756                      <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
   9.757 @@ -805,6 +983,7 @@
   9.758              </sequential>
   9.759          </macrodef>
   9.760      </target>
   9.761 +    <target depends="-init-macrodef-java-with-module, -init-macrodef-java-with-unnamed-module, -init-macrodef-java-without-module" name="-init-macrodef-java"/>
   9.762      <target name="-init-macrodef-copylibs">
   9.763          <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
   9.764              <attribute default="${manifest.file}" name="manifest"/>
   9.765 @@ -826,8 +1005,8 @@
   9.766                      </chainedmapper>
   9.767                  </pathconvert>
   9.768                  <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
   9.769 -                <copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" rebase="${copylibs.rebase}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
   9.770 -                    <fileset dir="${build.classes.dir}"/>
   9.771 +                <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}">
   9.772 +                    <fileset dir="${build.classes.dir}" excludes="${dist.archive.excludes}"/>
   9.773                      <manifest>
   9.774                          <attribute name="Class-Path" value="${jar.classpath}"/>
   9.775                          <customize/>
   9.776 @@ -838,8 +1017,8 @@
   9.777      </target>
   9.778      <target name="-init-presetdef-jar">
   9.779          <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
   9.780 -            <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}">
   9.781 -                <j2seproject1:fileset dir="${build.classes.dir}"/>
   9.782 +            <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}" manifestencoding="UTF-8">
   9.783 +                <j2seproject1:fileset dir="${build.classes.dir}" excludes="${dist.archive.excludes}"/>
   9.784              </jar>
   9.785          </presetdef>
   9.786      </target>
   9.787 @@ -894,7 +1073,9 @@
   9.788          <available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/>
   9.789      </target>
   9.790      <target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build">
   9.791 -        <antcall target="clean"/>
   9.792 +        <antcall target="clean">
   9.793 +            <param name="no.dependencies" value="true"/>
   9.794 +        </antcall>
   9.795      </target>
   9.796      <target depends="init,deps-jar" name="-pre-pre-compile">
   9.797          <mkdir dir="${build.classes.dir}"/>
   9.798 @@ -920,7 +1101,7 @@
   9.799      <target if="has.persistence.xml" name="-copy-persistence-xml">
   9.800          <mkdir dir="${build.classes.dir}/META-INF"/>
   9.801          <copy todir="${build.classes.dir}/META-INF">
   9.802 -            <fileset dir="${meta.inf.dir}" includes="persistence.xml"/>
   9.803 +            <fileset dir="${meta.inf.dir}" includes="persistence.xml orm.xml"/>
   9.804          </copy>
   9.805      </target>
   9.806      <target name="-post-compile">
   9.807 @@ -935,7 +1116,7 @@
   9.808      <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
   9.809          <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
   9.810          <j2seproject3:force-recompile/>
   9.811 -        <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.dir}"/>
   9.812 +        <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}, module-info.java" sourcepath="${src.dir}"/>
   9.813      </target>
   9.814      <target name="-post-compile-single">
   9.815          <!-- Empty placeholder for easier customization. -->
   9.816 @@ -955,65 +1136,191 @@
   9.817          <!-- Empty placeholder for easier customization. -->
   9.818          <!-- You can override this target in the ../build.xml file. -->
   9.819      </target>
   9.820 -    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive" name="-do-jar-without-manifest" unless="manifest.available-mkdist.available">
   9.821 -        <j2seproject1:jar/>
   9.822 +    <target depends="init,compile" name="-check-module-main-class">
   9.823 +        <pathconvert property="main.class.file">
   9.824 +            <string value="${main.class}"/>
   9.825 +            <unpackagemapper from="*" to="*.class"/>
   9.826 +        </pathconvert>
   9.827 +        <condition property="do.module.main.class">
   9.828 +            <and>
   9.829 +                <isset property="main.class.available"/>
   9.830 +                <available file="${build.classes.dir}/module-info.class"/>
   9.831 +                <available file="${build.classes.dir}/${main.class.file}"/>
   9.832 +                <isset property="libs.CopyLibs.classpath"/>
   9.833 +                <available classname="org.netbeans.modules.java.j2seproject.moduletask.ModuleMainClass" classpath="${libs.CopyLibs.classpath}"/>
   9.834 +            </and>
   9.835 +        </condition>
   9.836      </target>
   9.837 -    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class-mkdist.available">
   9.838 -        <j2seproject1:jar manifest="${manifest.file}"/>
   9.839 +    <target depends="-check-module-main-class" if="do.module.main.class" name="-set-module-main-class">
   9.840 +        <taskdef classname="org.netbeans.modules.java.j2seproject.moduletask.ModuleMainClass" classpath="${libs.CopyLibs.classpath}" name="modulemainclass"/>
   9.841 +        <modulemainclass failonerror="false" mainclass="${main.class}" moduleinfo="${build.classes.dir}/module-info.class"/>
   9.842      </target>
   9.843 -    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available+main.class" name="-do-jar-with-mainclass" unless="manifest.available+main.class+mkdist.available">
   9.844 -        <j2seproject1:jar manifest="${manifest.file}">
   9.845 -            <j2seproject1:manifest>
   9.846 -                <j2seproject1:attribute name="Main-Class" value="${main.class}"/>
   9.847 -            </j2seproject1:manifest>
   9.848 -        </j2seproject1:jar>
   9.849 -        <echo level="info">To run this application from the command line without Ant, try:</echo>
   9.850 -        <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
   9.851 -        <property location="${dist.jar}" name="dist.jar.resolved"/>
   9.852 -        <pathconvert property="run.classpath.with.dist.jar">
   9.853 -            <path path="${run.classpath}"/>
   9.854 -            <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
   9.855 -        </pathconvert>
   9.856 -        <echo level="info">java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
   9.857 -    </target>
   9.858 -    <target depends="init" if="do.archive" name="-do-jar-with-libraries-create-manifest" unless="manifest.available">
   9.859 +    <target depends="init" if="do.archive" name="-do-jar-create-manifest" unless="manifest.available">
   9.860          <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
   9.861          <touch file="${tmp.manifest.file}" verbose="false"/>
   9.862      </target>
   9.863 -    <target depends="init" if="do.archive+manifest.available" name="-do-jar-with-libraries-copy-manifest">
   9.864 +    <target depends="init" if="do.archive+manifest.available" name="-do-jar-copy-manifest">
   9.865          <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
   9.866 -        <copy file="${manifest.file}" tofile="${tmp.manifest.file}"/>
   9.867 +        <copy encoding="${manifest.encoding}" file="${manifest.file}" outputencoding="UTF-8" tofile="${tmp.manifest.file}"/>
   9.868      </target>
   9.869 -    <target depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest" if="do.archive+main.class.available" name="-do-jar-with-libraries-set-main">
   9.870 -        <manifest file="${tmp.manifest.file}" mode="update">
   9.871 +    <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+main.class.available" name="-do-jar-set-mainclass">
   9.872 +        <manifest encoding="UTF-8" file="${tmp.manifest.file}" mode="update">
   9.873              <attribute name="Main-Class" value="${main.class}"/>
   9.874          </manifest>
   9.875      </target>
   9.876 -    <target depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest" if="do.archive+splashscreen.available" name="-do-jar-with-libraries-set-splashscreen">
   9.877 +    <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+profile.available" name="-do-jar-set-profile">
   9.878 +        <manifest encoding="UTF-8" file="${tmp.manifest.file}" mode="update">
   9.879 +            <attribute name="Profile" value="${javac.profile}"/>
   9.880 +        </manifest>
   9.881 +    </target>
   9.882 +    <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+splashscreen.available" name="-do-jar-set-splashscreen">
   9.883          <basename file="${application.splash}" property="splashscreen.basename"/>
   9.884          <mkdir dir="${build.classes.dir}/META-INF"/>
   9.885          <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
   9.886 -        <manifest file="${tmp.manifest.file}" mode="update">
   9.887 +        <manifest encoding="UTF-8" file="${tmp.manifest.file}" mode="update">
   9.888              <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
   9.889          </manifest>
   9.890      </target>
   9.891 -    <target depends="init,-init-macrodef-copylibs,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen" if="do.mkdist" name="-do-jar-with-libraries-pack">
   9.892 +    <target depends="init,compile" name="-check-do-mkdist">
   9.893 +        <condition property="do.mkdist">
   9.894 +            <and>
   9.895 +                <isset property="do.archive"/>
   9.896 +                <isset property="libs.CopyLibs.classpath"/>
   9.897 +                <not>
   9.898 +                    <istrue value="${mkdist.disabled}"/>
   9.899 +                </not>
   9.900 +                <not>
   9.901 +                    <available file="${build.classes.dir}/module-info.class"/>
   9.902 +                </not>
   9.903 +            </and>
   9.904 +        </condition>
   9.905 +    </target>
   9.906 +    <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,-check-do-mkdist" if="do.mkdist" name="-do-jar-copylibs">
   9.907          <j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
   9.908          <echo level="info">To run this application from the command line without Ant, try:</echo>
   9.909          <property location="${dist.jar}" name="dist.jar.resolved"/>
   9.910          <echo level="info">java -jar "${dist.jar.resolved}"</echo>
   9.911      </target>
   9.912 -    <target depends="-do-jar-with-libraries-pack" if="do.archive" name="-do-jar-with-libraries-delete-manifest">
   9.913 +    <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,-check-do-mkdist" if="do.archive" name="-do-jar-jar" unless="do.mkdist">
   9.914 +        <j2seproject1:jar manifest="${tmp.manifest.file}"/>
   9.915 +        <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
   9.916 +        <property location="${dist.jar}" name="dist.jar.resolved"/>
   9.917 +        <condition else="${dist.jar.resolved}" property="jar.usage.message.class.path.replacement" value="">
   9.918 +            <isset property="named.module.internal"/>
   9.919 +        </condition>
   9.920 +        <pathconvert property="run.classpath.with.dist.jar">
   9.921 +            <path path="${run.classpath}"/>
   9.922 +            <map from="${build.classes.dir.resolved}" to="${jar.usage.message.class.path.replacement}"/>
   9.923 +        </pathconvert>
   9.924 +        <pathconvert property="run.modulepath.with.dist.jar">
   9.925 +            <path location="${dist.jar.resolved}"/>
   9.926 +            <path path="${run.modulepath}"/>
   9.927 +            <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
   9.928 +        </pathconvert>
   9.929 +        <condition else="${run.modulepath}" property="jar.usage.message.run.modulepath.with.dist.jar" value="${run.modulepath.with.dist.jar}">
   9.930 +            <isset property="named.module.internal"/>
   9.931 +        </condition>
   9.932 +        <condition else="" property="jar.usage.message.module.path" value=" -p ${jar.usage.message.run.modulepath.with.dist.jar}">
   9.933 +            <and>
   9.934 +                <isset property="modules.supported.internal"/>
   9.935 +                <length length="0" string="${jar.usage.message.run.modulepath.with.dist.jar}" when="greater"/>
   9.936 +            </and>
   9.937 +        </condition>
   9.938 +        <condition else="" property="jar.usage.message.class.path" value=" -cp ${run.classpath.with.dist.jar}">
   9.939 +            <length length="0" string="${run.classpath.with.dist.jar}" when="greater"/>
   9.940 +        </condition>
   9.941 +        <condition else="/${main.class}" property="jar.usage.message.main.class.class.selector" value="">
   9.942 +            <isset property="do.module.main.class"/>
   9.943 +        </condition>
   9.944 +        <condition else=" ${main.class}" property="jar.usage.message.main.class" value=" -m ${module.name}${jar.usage.message.main.class.class.selector}">
   9.945 +            <isset property="named.module.internal"/>
   9.946 +        </condition>
   9.947 +        <condition else="" property="jar.usage.message" value="To run this application from the command line without Ant, try:${line.separator}${platform.java}${jar.usage.message.module.path}${jar.usage.message.class.path}${jar.usage.message.main.class}">
   9.948 +            <isset property="main.class.available"/>
   9.949 +        </condition>
   9.950 +        <condition else="debug" property="jar.usage.level" value="info">
   9.951 +            <isset property="main.class.available"/>
   9.952 +        </condition>
   9.953 +        <echo level="${jar.usage.level}" message="${jar.usage.message}"/>
   9.954 +    </target>
   9.955 +    <target depends="-do-jar-copylibs" if="do.archive" name="-do-jar-delete-manifest">
   9.956          <delete>
   9.957              <fileset file="${tmp.manifest.file}"/>
   9.958          </delete>
   9.959      </target>
   9.960 -    <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen,-do-jar-with-libraries-pack,-do-jar-with-libraries-delete-manifest" name="-do-jar-with-libraries"/>
   9.961 +    <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"/>
   9.962 +    <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"/>
   9.963      <target name="-post-jar">
   9.964          <!-- Empty placeholder for easier customization. -->
   9.965          <!-- You can override this target in the ../build.xml file. -->
   9.966      </target>
   9.967 -    <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"/>
   9.968 +    <target depends="init,compile,-pre-jar,-set-module-main-class,-do-jar-without-libraries,-do-jar-with-libraries,-post-jar" name="-do-jar"/>
   9.969 +    <target depends="init,compile,-pre-jar,-do-jar,-post-jar,deploy" description="Build JAR." name="jar"/>
   9.970 +    <!--
   9.971 +                =================
   9.972 +                DEPLOY SECTION
   9.973 +                =================
   9.974 +            -->
   9.975 +    <target name="-pre-deploy">
   9.976 +        <!-- Empty placeholder for easier customization. -->
   9.977 +        <!-- You can override this target in the ../build.xml file. -->
   9.978 +    </target>
   9.979 +    <target depends="init" name="-check-jlink">
   9.980 +        <condition property="do.jlink.internal">
   9.981 +            <and>
   9.982 +                <istrue value="${do.jlink}"/>
   9.983 +                <isset property="do.archive"/>
   9.984 +                <isset property="named.module.internal"/>
   9.985 +            </and>
   9.986 +        </condition>
   9.987 +    </target>
   9.988 +    <target depends="init,-do-jar,-post-jar,-pre-deploy,-check-jlink" if="do.jlink.internal" name="-do-deploy">
   9.989 +        <delete dir="${dist.jlink.dir}" failonerror="false" quiet="true"/>
   9.990 +        <property name="jlink.launcher.name" value="${application.title}"/>
   9.991 +        <condition else="${module.name}" property="jlink.add.modules" value="${module.name},${jlink.additionalmodules}">
   9.992 +            <and>
   9.993 +                <isset property="jlink.additionalmodules"/>
   9.994 +                <length length="0" string="${jlink.additionalmodules}" when="greater"/>
   9.995 +            </and>
   9.996 +        </condition>
   9.997 +        <condition property="jlink.do.strip.internal">
   9.998 +            <and>
   9.999 +                <isset property="jlink.strip"/>
  9.1000 +                <istrue value="${jlink.strip}"/>
  9.1001 +            </and>
  9.1002 +        </condition>
  9.1003 +        <condition property="jlink.do.additionalparam.internal">
  9.1004 +            <and>
  9.1005 +                <isset property="jlink.additionalparam"/>
  9.1006 +                <length length="0" string="${jlink.additionalparam}" when="greater"/>
  9.1007 +            </and>
  9.1008 +        </condition>
  9.1009 +        <condition property="jlink.do.launcher.internal">
  9.1010 +            <and>
  9.1011 +                <istrue value="${jlink.launcher}"/>
  9.1012 +                <isset property="main.class.available"/>
  9.1013 +            </and>
  9.1014 +        </condition>
  9.1015 +        <property name="platform.jlink" value="${jdk.home}/bin/jlink"/>
  9.1016 +        <property name="jlink.systemmodules.internal" value="${jdk.home}/jmods"/>
  9.1017 +        <exec executable="${platform.jlink}">
  9.1018 +            <arg value="--module-path"/>
  9.1019 +            <arg path="${jlink.systemmodules.internal}:${run.modulepath}:${dist.jar}"/>
  9.1020 +            <arg value="--add-modules"/>
  9.1021 +            <arg value="${jlink.add.modules}"/>
  9.1022 +            <arg if:set="jlink.do.strip.internal" value="--strip-debug"/>
  9.1023 +            <arg if:set="jlink.do.launcher.internal" value="--launcher"/>
  9.1024 +            <arg if:set="jlink.do.launcher.internal" value="${jlink.launcher.name}=${module.name}/${main.class}"/>
  9.1025 +            <arg if:set="jlink.do.additionalparam.internal" line="${jlink.additionalparam}"/>
  9.1026 +            <arg value="--output"/>
  9.1027 +            <arg value="${dist.jlink.output}"/>
  9.1028 +        </exec>
  9.1029 +    </target>
  9.1030 +    <target name="-post-deploy">
  9.1031 +        <!-- Empty placeholder for easier customization. -->
  9.1032 +        <!-- You can override this target in the ../build.xml file. -->
  9.1033 +    </target>
  9.1034 +    <target depends="-do-jar,-post-jar,-pre-deploy,-do-deploy,-post-deploy" name="deploy"/>
  9.1035      <!--
  9.1036                  =================
  9.1037                  EXECUTION SECTION
  9.1038 @@ -1050,9 +1357,9 @@
  9.1039      </target>
  9.1040      <target depends="init,compile" name="-debug-start-debuggee">
  9.1041          <j2seproject3:debug>
  9.1042 -            <customize>
  9.1043 +            <customizeDebuggee>
  9.1044                  <arg line="${application.args}"/>
  9.1045 -            </customize>
  9.1046 +            </customizeDebuggee>
  9.1047          </j2seproject3:debug>
  9.1048      </target>
  9.1049      <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/>
  9.1050 @@ -1118,28 +1425,24 @@
  9.1051              </customize>
  9.1052          </profile>
  9.1053      </target>
  9.1054 -    <target depends="profile-init,compile-test-single" if="profiler.info.jvmargs.agent" name="-profile-test-single-pre72">
  9.1055 +    <target depends="-init-macrodef-junit,profile-init,compile-test-single" if="profiler.info.jvmargs.agent" name="-profile-test-single-pre72">
  9.1056          <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
  9.1057          <nbprofiledirect>
  9.1058              <classpath>
  9.1059                  <path path="${run.test.classpath}"/>
  9.1060              </classpath>
  9.1061          </nbprofiledirect>
  9.1062 -        <junit dir="${profiler.info.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" jvm="${profiler.info.jvm}" showoutput="true">
  9.1063 -            <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
  9.1064 -            <jvmarg value="${profiler.info.jvmargs.agent}"/>
  9.1065 -            <jvmarg line="${profiler.info.jvmargs}"/>
  9.1066 -            <test name="${profile.class}"/>
  9.1067 -            <classpath>
  9.1068 -                <path path="${run.test.classpath}"/>
  9.1069 -            </classpath>
  9.1070 -            <syspropertyset>
  9.1071 -                <propertyref prefix="test-sys-prop."/>
  9.1072 -                <mapper from="test-sys-prop.*" to="*" type="glob"/>
  9.1073 -            </syspropertyset>
  9.1074 -            <formatter type="brief" usefile="false"/>
  9.1075 -            <formatter type="xml"/>
  9.1076 -        </junit>
  9.1077 +        <j2seproject3:junit excludes="${excludes}" includes="${includes}" testincludes="${profile.class}" testmethods="">
  9.1078 +            <customize>
  9.1079 +                <jvmarg value="-agentlib:jdwp=transport=${debug-transport},address=${jpda.address}"/>
  9.1080 +                <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
  9.1081 +                <jvmarg value="${profiler.info.jvmargs.agent}"/>
  9.1082 +                <jvmarg line="${profiler.info.jvmargs}"/>
  9.1083 +                <classpath>
  9.1084 +                    <path path="${run.test.classpath}"/>
  9.1085 +                </classpath>
  9.1086 +            </customize>
  9.1087 +        </j2seproject3:junit>
  9.1088      </target>
  9.1089      <!--
  9.1090                  end of pre NB72 profiling section
  9.1091 @@ -1170,7 +1473,7 @@
  9.1092      <target depends="-profile-check" description="Profile a selected class in the IDE." if="profiler.configured" name="profile-test-with-main">
  9.1093          <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
  9.1094          <startprofiler/>
  9.1095 -        <antcal target="run-test-with-main"/>
  9.1096 +        <antcall target="run-test-with-main"/>
  9.1097      </target>
  9.1098      <target depends="-profile-check,-profile-applet-pre72" if="profiler.configured" name="profile-applet" unless="profiler.info.jvmargs.agent">
  9.1099          <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
  9.1100 @@ -1192,11 +1495,20 @@
  9.1101                  </not>
  9.1102              </and>
  9.1103          </condition>
  9.1104 -        <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}">
  9.1105 +        <condition else="" property="bug5101868workaround" value="*.java">
  9.1106 +            <matches pattern="1\.[56](\..*)?" string="${java.version}"/>
  9.1107 +        </condition>
  9.1108 +        <condition else="" property="javadoc.html5.cmd.line.arg" value="-html5">
  9.1109 +            <and>
  9.1110 +                <isset property="javadoc.html5"/>
  9.1111 +                <available file="${jdk.home}${file.separator}lib${file.separator}jrt-fs.jar"/>
  9.1112 +            </and>
  9.1113 +        </condition>
  9.1114 +        <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}">
  9.1115              <classpath>
  9.1116                  <path path="${javac.classpath}"/>
  9.1117              </classpath>
  9.1118 -            <fileset dir="${src.dir}" excludes="*.java,${excludes}" includes="${includes}">
  9.1119 +            <fileset dir="${src.dir}" excludes="${bug5101868workaround},${excludes}" includes="${includes}">
  9.1120                  <filename name="**/*.java"/>
  9.1121              </fileset>
  9.1122              <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
  9.1123 @@ -1204,6 +1516,7 @@
  9.1124                  <exclude name="*.java"/>
  9.1125              </fileset>
  9.1126              <arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/>
  9.1127 +            <arg line="${javadoc.html5.cmd.line.arg}"/>
  9.1128          </javadoc>
  9.1129          <copy todir="${dist.javadoc.dir}">
  9.1130              <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
  9.1131 @@ -1230,11 +1543,63 @@
  9.1132          <!-- Empty placeholder for easier customization. -->
  9.1133          <!-- You can override this target in the ../build.xml file. -->
  9.1134      </target>
  9.1135 +    <target depends="-init-source-module-properties" if="named.module.internal" name="-init-test-javac-module-properties-with-module">
  9.1136 +        <j2seproject3:modulename property="test.module.name" sourcepath="${test.src.dir}"/>
  9.1137 +        <condition else="${empty.dir}" property="javac.test.sourcepath" value="${test.src.dir}">
  9.1138 +            <and>
  9.1139 +                <isset property="test.module.name"/>
  9.1140 +                <length length="0" string="${test.module.name}" when="greater"/>
  9.1141 +            </and>
  9.1142 +        </condition>
  9.1143 +        <condition else="--patch-module ${module.name}=${test.src.dir} --add-reads ${module.name}=ALL-UNNAMED" property="javac.test.compilerargs" value="--add-reads ${test.module.name}=ALL-UNNAMED">
  9.1144 +            <and>
  9.1145 +                <isset property="test.module.name"/>
  9.1146 +                <length length="0" string="${test.module.name}" when="greater"/>
  9.1147 +            </and>
  9.1148 +        </condition>
  9.1149 +    </target>
  9.1150 +    <target depends="-init-source-module-properties" if="named.module.internal" name="-init-test-run-module-properties">
  9.1151 +        <condition else="${module.name}" property="run.test.addexport.source.module.internal" value="${test.module.name}">
  9.1152 +            <and>
  9.1153 +                <isset property="test.module.name"/>
  9.1154 +                <length length="0" string="${test.module.name}" when="greater"/>
  9.1155 +            </and>
  9.1156 +        </condition>
  9.1157 +        <fileset dir="${build.test.classes.dir}" id="run.test.packages.internal" includes="**/*.class"/>
  9.1158 +        <property location="${build.test.classes.dir}" name="build.test.classes.dir.abs.internal"/>
  9.1159 +        <pathconvert pathsep=" " property="run.test.addexports.internal" refid="run.test.packages.internal">
  9.1160 +            <chainedmapper>
  9.1161 +                <regexpmapper from="^(.*)\Q${file.separator}\E.*\.class$$" to="\1"/>
  9.1162 +                <filtermapper>
  9.1163 +                    <uniqfilter/>
  9.1164 +                    <replacestring from="${build.test.classes.dir.abs.internal}" to=""/>
  9.1165 +                </filtermapper>
  9.1166 +                <cutdirsmapper dirs="1"/>
  9.1167 +                <packagemapper from="*" to="--add-exports ${run.test.addexport.source.module.internal}/*=ALL-UNNAMED"/>
  9.1168 +            </chainedmapper>
  9.1169 +        </pathconvert>
  9.1170 +        <condition else="--patch-module ${module.name}=${build.test.classes.dir} --add-modules ${module.name} --add-reads ${module.name}=ALL-UNNAMED ${run.test.addexports.internal}" property="run.test.jvmargs" value="--add-modules ${test.module.name} --add-reads ${test.module.name}=ALL-UNNAMED ${run.test.addexports.internal}">
  9.1171 +            <and>
  9.1172 +                <isset property="test.module.name"/>
  9.1173 +                <length length="0" string="${test.module.name}" when="greater"/>
  9.1174 +            </and>
  9.1175 +        </condition>
  9.1176 +    </target>
  9.1177 +    <target depends="-init-source-module-properties" name="-init-test-module-properties-without-module" unless="named.module.internal">
  9.1178 +        <property name="javac.test.sourcepath" value="${empty.dir}"/>
  9.1179 +        <property name="javac.test.compilerargs" value=""/>
  9.1180 +        <property name="run.test.jvmargs" value=""/>
  9.1181 +    </target>
  9.1182 +    <target depends="-init-test-javac-module-properties-with-module,-init-test-module-properties-without-module" name="-init-test-module-properties"/>
  9.1183      <target if="do.depend.true" name="-compile-test-depend">
  9.1184          <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
  9.1185      </target>
  9.1186 -    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
  9.1187 -        <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}"/>
  9.1188 +    <target depends="init,deps-jar,compile,-init-test-module-properties,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
  9.1189 +        <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" modulepath="${javac.test.modulepath}" processorpath="${javac.test.processorpath}" sourcepath="${javac.test.sourcepath}" srcdir="${test.src.dir}">
  9.1190 +            <customize>
  9.1191 +                <compilerarg line="${javac.test.compilerargs}"/>
  9.1192 +            </customize>
  9.1193 +        </j2seproject3:javac>
  9.1194          <copy todir="${build.test.classes.dir}">
  9.1195              <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
  9.1196          </copy>
  9.1197 @@ -1248,10 +1613,14 @@
  9.1198          <!-- Empty placeholder for easier customization. -->
  9.1199          <!-- You can override this target in the ../build.xml file. -->
  9.1200      </target>
  9.1201 -    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
  9.1202 +    <target depends="init,deps-jar,compile,-init-test-module-properties,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
  9.1203          <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
  9.1204          <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
  9.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}"/>
  9.1206 +        <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}, module-info.java" modulepath="${javac.test.modulepath}" processorpath="${javac.test.processorpath}" sourcepath="${test.src.dir}" srcdir="${test.src.dir}">
  9.1207 +            <customize>
  9.1208 +                <compilerarg line="${javac.test.compilerargs}"/>
  9.1209 +            </customize>
  9.1210 +        </j2seproject3:javac>
  9.1211          <copy todir="${build.test.classes.dir}">
  9.1212              <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
  9.1213          </copy>
  9.1214 @@ -1269,8 +1638,8 @@
  9.1215      <target depends="init" if="have.tests" name="-pre-test-run">
  9.1216          <mkdir dir="${build.test.results.dir}"/>
  9.1217      </target>
  9.1218 -    <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
  9.1219 -        <j2seproject3:test testincludes="**/*Test.java"/>
  9.1220 +    <target depends="init,compile-test,-init-test-run-module-properties,-pre-test-run" if="have.tests" name="-do-test-run">
  9.1221 +        <j2seproject3:test includes="${includes}" testincludes="**/*Test.java"/>
  9.1222      </target>
  9.1223      <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
  9.1224          <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
  9.1225 @@ -1281,14 +1650,14 @@
  9.1226      <target depends="init" if="have.tests" name="-pre-test-run-single">
  9.1227          <mkdir dir="${build.test.results.dir}"/>
  9.1228      </target>
  9.1229 -    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
  9.1230 +    <target depends="init,compile-test-single,-init-test-run-module-properties,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
  9.1231          <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
  9.1232          <j2seproject3:test excludes="" includes="${test.includes}" testincludes="${test.includes}"/>
  9.1233      </target>
  9.1234      <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
  9.1235          <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
  9.1236      </target>
  9.1237 -    <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"/>
  9.1238 +    <target depends="init,compile-test-single,-init-test-run-module-properties,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/>
  9.1239      <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single-method">
  9.1240          <fail unless="test.class">Must select some files in the IDE or set test.class</fail>
  9.1241          <fail unless="test.method">Must select some method in the IDE or set test.method</fail>
  9.1242 @@ -1297,7 +1666,7 @@
  9.1243      <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single-method" if="have.tests" name="-post-test-run-single-method">
  9.1244          <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
  9.1245      </target>
  9.1246 -    <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"/>
  9.1247 +    <target depends="init,compile-test-single,-init-test-run-module-properties,-pre-test-run-single,-do-test-run-single-method,-post-test-run-single-method" description="Run single unit test." name="test-single-method"/>
  9.1248      <!--
  9.1249                  =======================
  9.1250                  TEST DEBUGGING SECTION
  9.1251 @@ -1315,8 +1684,8 @@
  9.1252      <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
  9.1253          <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
  9.1254      </target>
  9.1255 -    <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
  9.1256 -    <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test-method" name="debug-test-method"/>
  9.1257 +    <target depends="init,compile-test-single,-init-test-run-module-properties,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
  9.1258 +    <target depends="init,compile-test-single,-init-test-run-module-properties,-debug-start-debugger-test,-debug-start-debuggee-test-method" name="debug-test-method"/>
  9.1259      <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
  9.1260          <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
  9.1261      </target>
  9.1262 @@ -1342,9 +1711,9 @@
  9.1263      <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet">
  9.1264          <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
  9.1265          <j2seproject3:debug classname="sun.applet.AppletViewer">
  9.1266 -            <customize>
  9.1267 +            <customizeDebuggee>
  9.1268                  <arg value="${applet.url}"/>
  9.1269 -            </customize>
  9.1270 +            </customizeDebuggee>
  9.1271          </j2seproject3:debug>
  9.1272      </target>
  9.1273      <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/>
  9.1274 @@ -1371,6 +1740,7 @@
  9.1275      </target>
  9.1276      <target depends="init" name="-do-clean">
  9.1277          <delete dir="${build.dir}"/>
  9.1278 +        <delete dir="${dist.jlink.output}"/>
  9.1279          <delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/>
  9.1280      </target>
  9.1281      <target name="-post-clean">
    10.1 --- a/samples/codeinjection/nbproject/genfiles.properties	Mon Nov 11 05:47:32 2019 +0100
    10.2 +++ b/samples/codeinjection/nbproject/genfiles.properties	Mon Nov 11 13:17:34 2019 +0100
    10.3 @@ -1,8 +1,8 @@
    10.4  build.xml.data.CRC32=4a8b5abf
    10.5 -build.xml.script.CRC32=83b773e3
    10.6 -build.xml.stylesheet.CRC32=28e38971@1.54.0.46
    10.7 +build.xml.script.CRC32=952f48c5
    10.8 +build.xml.stylesheet.CRC32=f85dc8f2@1.93.0.48
    10.9  # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
   10.10  # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
   10.11  nbproject/build-impl.xml.data.CRC32=4a8b5abf
   10.12 -nbproject/build-impl.xml.script.CRC32=6a821ef7
   10.13 -nbproject/build-impl.xml.stylesheet.CRC32=6ddba6b6@1.54.0.46
   10.14 +nbproject/build-impl.xml.script.CRC32=c5948233
   10.15 +nbproject/build-impl.xml.stylesheet.CRC32=f89f7d21@1.93.0.48
    11.1 --- a/samples/codeinjection/nbproject/project.properties	Mon Nov 11 05:47:32 2019 +0100
    11.2 +++ b/samples/codeinjection/nbproject/project.properties	Mon Nov 11 13:17:34 2019 +0100
    11.3 @@ -12,8 +12,12 @@
    11.4  #debug.transport=dt_socket
    11.5  debug.classpath=\
    11.6      ${run.classpath}
    11.7 +debug.modulepath=\
    11.8 +    ${run.modulepath}
    11.9  debug.test.classpath=\
   11.10      ${run.test.classpath}
   11.11 +debug.test.modulepath=\
   11.12 +    ${run.test.modulepath}
   11.13  # This directory is removed when the project is cleaned:
   11.14  dist.dir=dist
   11.15  dist.jar=${dist.dir}/codeinjection.jar
   11.16 @@ -28,14 +32,18 @@
   11.17  # Space-separated list of extra javac options
   11.18  javac.compilerargs=
   11.19  javac.deprecation=false
   11.20 -javac.source=1.5
   11.21 -javac.target=1.5
   11.22 +javac.modulepath=
   11.23 +javac.processormodulepath=
   11.24 +javac.source=1.6
   11.25 +javac.target=1.6
   11.26  javac.test.classpath=\
   11.27      ${javac.classpath}:\
   11.28      ${build.classes.dir}:\
   11.29      ${file.reference.junit-4.4.jar}:\
   11.30      ${file.reference.org-netbeans-insane.jar}:\
   11.31      ${file.reference.org-netbeans-modules-nbjunit.jar}
   11.32 +javac.test.modulepath=\
   11.33 +    ${javac.modulepath}
   11.34  javadoc.additionalparam=
   11.35  javadoc.author=false
   11.36  javadoc.encoding=${source.encoding}
   11.37 @@ -58,9 +66,13 @@
   11.38  # (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
   11.39  # or test-sys-prop.name=value to set system properties for unit tests):
   11.40  run.jvmargs=
   11.41 +run.modulepath=\
   11.42 +    ${javac.modulepath}
   11.43  run.test.classpath=\
   11.44      ${javac.test.classpath}:\
   11.45      ${build.test.classes.dir}
   11.46 +run.test.modulepath=\
   11.47 +    ${javac.test.modulepath}
   11.48  source.encoding=UTF-8
   11.49  src.dir=src
   11.50  test.src.dir=test
    12.1 --- a/samples/conditionaluseofapi/nbproject/build-impl.xml	Mon Nov 11 05:47:32 2019 +0100
    12.2 +++ b/samples/conditionaluseofapi/nbproject/build-impl.xml	Mon Nov 11 13:17:34 2019 +0100
    12.3 @@ -12,14 +12,21 @@
    12.4    - execution
    12.5    - debugging
    12.6    - javadoc
    12.7 -  - junit compilation
    12.8 -  - junit execution
    12.9 -  - junit debugging
   12.10 +  - test compilation
   12.11 +  - test execution
   12.12 +  - test debugging
   12.13    - applet
   12.14    - cleanup
   12.15  
   12.16          -->
   12.17 -<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject2="http://www.netbeans.org/ns/j2se-project/2" 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="conditionaluseofapi-impl">
   12.18 +<project xmlns:if="ant:if" 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" xmlns:unless="ant:unless" basedir=".." default="default" name="conditionaluseofapi-impl">
   12.19 +    <fail message="Please build using Ant 1.8.0 or higher.">
   12.20 +        <condition>
   12.21 +            <not>
   12.22 +                <antversion atleast="1.8.0"/>
   12.23 +            </not>
   12.24 +        </condition>
   12.25 +    </fail>
   12.26      <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
   12.27      <!-- 
   12.28                  ======================
   12.29 @@ -39,28 +46,136 @@
   12.30          <property file="${user.properties.file}"/>
   12.31          <!-- The two properties below are usually overridden -->
   12.32          <!-- by the active platform. Just a fallback. -->
   12.33 -        <property name="default.javac.source" value="1.4"/>
   12.34 -        <property name="default.javac.target" value="1.4"/>
   12.35 +        <property name="default.javac.source" value="1.6"/>
   12.36 +        <property name="default.javac.target" value="1.6"/>
   12.37      </target>
   12.38      <target depends="-pre-init,-init-private,-init-user" name="-init-project">
   12.39          <property file="nbproject/configs/${config}.properties"/>
   12.40          <property file="nbproject/project.properties"/>
   12.41      </target>
   12.42 -    <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init">
   12.43 +    <target name="-init-modules-supported">
   12.44 +        <condition property="modules.supported.internal" value="true">
   12.45 +            <not>
   12.46 +                <matches pattern="1\.[0-8](\..*)?" string="${javac.source}"/>
   12.47 +            </not>
   12.48 +        </condition>
   12.49 +    </target>
   12.50 +    <target depends="-init-modules-supported" if="modules.supported.internal" name="-init-macrodef-modulename">
   12.51 +        <macrodef name="modulename" uri="http://www.netbeans.org/ns/j2se-project/3">
   12.52 +            <attribute name="property"/>
   12.53 +            <attribute name="sourcepath"/>
   12.54 +            <sequential>
   12.55 +                <loadresource property="@{property}" quiet="true">
   12.56 +                    <javaresource classpath="@{sourcepath}" name="module-info.java" parentFirst="false"/>
   12.57 +                    <filterchain>
   12.58 +                        <stripjavacomments/>
   12.59 +                        <linecontainsregexp>
   12.60 +                            <regexp pattern="module .* \{"/>
   12.61 +                        </linecontainsregexp>
   12.62 +                        <tokenfilter>
   12.63 +                            <linetokenizer/>
   12.64 +                            <replaceregex flags="s" pattern="(\s*module\s+)(\S*)(\s*\{.*)" replace="\2"/>
   12.65 +                        </tokenfilter>
   12.66 +                        <striplinebreaks/>
   12.67 +                    </filterchain>
   12.68 +                </loadresource>
   12.69 +            </sequential>
   12.70 +        </macrodef>
   12.71 +    </target>
   12.72 +    <target depends="-init-modules-supported,-init-macrodef-modulename" if="modules.supported.internal" name="-init-source-module-properties">
   12.73 +        <fail message="Java 9 support requires Ant 1.10.0 or higher.">
   12.74 +            <condition>
   12.75 +                <not>
   12.76 +                    <antversion atleast="1.10.0"/>
   12.77 +                </not>
   12.78 +            </condition>
   12.79 +        </fail>
   12.80 +        <j2seproject3:modulename property="module.name" sourcepath="${src.dir}"/>
   12.81 +        <condition property="named.module.internal">
   12.82 +            <and>
   12.83 +                <isset property="module.name"/>
   12.84 +                <length length="0" string="${module.name}" when="greater"/>
   12.85 +            </and>
   12.86 +        </condition>
   12.87 +        <condition property="unnamed.module.internal">
   12.88 +            <not>
   12.89 +                <isset property="named.module.internal"/>
   12.90 +            </not>
   12.91 +        </condition>
   12.92 +        <property name="javac.modulepath" value=""/>
   12.93 +        <property name="run.modulepath" value="${javac.modulepath}"/>
   12.94 +        <property name="module.build.classes.dir" value="${build.classes.dir}"/>
   12.95 +        <property name="debug.modulepath" value="${run.modulepath}"/>
   12.96 +        <property name="javac.upgrademodulepath" value=""/>
   12.97 +        <property name="run.upgrademodulepath" value="${javac.upgrademodulepath}"/>
   12.98 +        <condition else="" property="javac.systemmodulepath.cmd.line.arg" value="--system '${javac.systemmodulepath}'">
   12.99 +            <and>
  12.100 +                <isset property="javac.systemmodulepath"/>
  12.101 +                <length length="0" string="${javac.systemmodulepath}" when="greater"/>
  12.102 +            </and>
  12.103 +        </condition>
  12.104 +        <property name="dist.jlink.dir" value="${dist.dir}/jlink"/>
  12.105 +        <property name="dist.jlink.output" value="${dist.jlink.dir}/${application.title}"/>
  12.106 +        <property name="module.name" value=""/>
  12.107 +    </target>
  12.108 +    <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property,-init-modules-supported" name="-do-init">
  12.109 +        <property name="platform.java" value="${java.home}/bin/java"/>
  12.110          <available file="${manifest.file}" property="manifest.available"/>
  12.111 -        <condition property="manifest.available+main.class">
  12.112 +        <condition property="splashscreen.available">
  12.113              <and>
  12.114 -                <isset property="manifest.available"/>
  12.115 +                <not>
  12.116 +                    <equals arg1="${application.splash}" arg2="" trim="true"/>
  12.117 +                </not>
  12.118 +                <available file="${application.splash}"/>
  12.119 +            </and>
  12.120 +        </condition>
  12.121 +        <condition property="main.class.available">
  12.122 +            <and>
  12.123                  <isset property="main.class"/>
  12.124                  <not>
  12.125                      <equals arg1="${main.class}" arg2="" trim="true"/>
  12.126                  </not>
  12.127              </and>
  12.128          </condition>
  12.129 -        <condition property="manifest.available+main.class+mkdist.available">
  12.130 +        <condition property="profile.available">
  12.131              <and>
  12.132 -                <istrue value="${manifest.available+main.class}"/>
  12.133 -                <isset property="libs.CopyLibs.classpath"/>
  12.134 +                <isset property="javac.profile"/>
  12.135 +                <length length="0" string="${javac.profile}" when="greater"/>
  12.136 +                <not>
  12.137 +                    <matches pattern="1\.[0-7](\..*)?" string="${javac.source}"/>
  12.138 +                </not>
  12.139 +            </and>
  12.140 +        </condition>
  12.141 +        <condition property="do.archive">
  12.142 +            <or>
  12.143 +                <not>
  12.144 +                    <istrue value="${jar.archive.disabled}"/>
  12.145 +                </not>
  12.146 +                <istrue value="${not.archive.disabled}"/>
  12.147 +            </or>
  12.148 +        </condition>
  12.149 +        <condition property="do.archive+manifest.available">
  12.150 +            <and>
  12.151 +                <isset property="manifest.available"/>
  12.152 +                <istrue value="${do.archive}"/>
  12.153 +            </and>
  12.154 +        </condition>
  12.155 +        <condition property="do.archive+main.class.available">
  12.156 +            <and>
  12.157 +                <isset property="main.class.available"/>
  12.158 +                <istrue value="${do.archive}"/>
  12.159 +            </and>
  12.160 +        </condition>
  12.161 +        <condition property="do.archive+splashscreen.available">
  12.162 +            <and>
  12.163 +                <isset property="splashscreen.available"/>
  12.164 +                <istrue value="${do.archive}"/>
  12.165 +            </and>
  12.166 +        </condition>
  12.167 +        <condition property="do.archive+profile.available">
  12.168 +            <and>
  12.169 +                <isset property="profile.available"/>
  12.170 +                <istrue value="${do.archive}"/>
  12.171              </and>
  12.172          </condition>
  12.173          <condition property="have.tests">
  12.174 @@ -86,6 +201,7 @@
  12.175              </and>
  12.176          </condition>
  12.177          <property name="run.jvmargs" value=""/>
  12.178 +        <property name="run.jvmargs.ide" value=""/>
  12.179          <property name="javac.compilerargs" value=""/>
  12.180          <property name="work.dir" value="${basedir}"/>
  12.181          <condition property="no.deps">
  12.182 @@ -97,6 +213,8 @@
  12.183          <property name="javadoc.preview" value="true"/>
  12.184          <property name="application.args" value=""/>
  12.185          <property name="source.encoding" value="${file.encoding}"/>
  12.186 +        <property name="runtime.encoding" value="${source.encoding}"/>
  12.187 +        <property name="manifest.encoding" value="${source.encoding}"/>
  12.188          <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
  12.189              <and>
  12.190                  <isset property="javadoc.encoding"/>
  12.191 @@ -112,12 +230,58 @@
  12.192          <condition property="do.depend.true">
  12.193              <istrue value="${do.depend}"/>
  12.194          </condition>
  12.195 -        <condition else="" property="javac.compilerargs.jaxws" value="-Djava.endorsed.dirs='${jaxws.endorsed.dir}'">
  12.196 +        <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
  12.197 +        <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
  12.198              <and>
  12.199 -                <isset property="jaxws.endorsed.dir"/>
  12.200 -                <available file="nbproject/jaxws-build.xml"/>
  12.201 +                <isset property="endorsed.classpath"/>
  12.202 +                <not>
  12.203 +                    <equals arg1="${endorsed.classpath}" arg2="" trim="true"/>
  12.204 +                </not>
  12.205              </and>
  12.206          </condition>
  12.207 +        <condition else="" property="javac.profile.cmd.line.arg" value="-profile ${javac.profile}">
  12.208 +            <isset property="profile.available"/>
  12.209 +        </condition>
  12.210 +        <condition else="false" property="jdkBug6558476">
  12.211 +            <and>
  12.212 +                <matches pattern="1\.[56]" string="${java.specification.version}"/>
  12.213 +                <not>
  12.214 +                    <os family="unix"/>
  12.215 +                </not>
  12.216 +            </and>
  12.217 +        </condition>
  12.218 +        <condition else="false" property="javac.fork">
  12.219 +            <or>
  12.220 +                <istrue value="${jdkBug6558476}"/>
  12.221 +                <istrue value="${javac.external.vm}"/>
  12.222 +            </or>
  12.223 +        </condition>
  12.224 +        <property name="jar.index" value="false"/>
  12.225 +        <property name="jar.index.metainf" value="${jar.index}"/>
  12.226 +        <property name="copylibs.rebase" value="true"/>
  12.227 +        <available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
  12.228 +        <condition property="junit.available">
  12.229 +            <or>
  12.230 +                <available classname="org.junit.Test" classpath="${run.test.classpath}"/>
  12.231 +                <available classname="junit.framework.Test" classpath="${run.test.classpath}"/>
  12.232 +            </or>
  12.233 +        </condition>
  12.234 +        <condition property="testng.available">
  12.235 +            <available classname="org.testng.annotations.Test" classpath="${run.test.classpath}"/>
  12.236 +        </condition>
  12.237 +        <condition property="junit+testng.available">
  12.238 +            <and>
  12.239 +                <istrue value="${junit.available}"/>
  12.240 +                <istrue value="${testng.available}"/>
  12.241 +            </and>
  12.242 +        </condition>
  12.243 +        <condition else="testng" property="testng.mode" value="mixed">
  12.244 +            <istrue value="${junit+testng.available}"/>
  12.245 +        </condition>
  12.246 +        <condition else="" property="testng.debug.mode" value="-mixed">
  12.247 +            <istrue value="${junit+testng.available}"/>
  12.248 +        </condition>
  12.249 +        <property name="java.failonerror" value="true"/>
  12.250      </target>
  12.251      <target name="-post-init">
  12.252          <!-- Empty placeholder for easier customization. -->
  12.253 @@ -144,26 +308,152 @@
  12.254              </sequential>
  12.255          </macrodef>
  12.256      </target>
  12.257 -    <target name="-init-macrodef-javac">
  12.258 +    <target depends="-init-ap-cmdline-properties,-init-source-module-properties" if="modules.supported.internal" name="-init-macrodef-javac-with-module">
  12.259          <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
  12.260              <attribute default="${src.dir}" name="srcdir"/>
  12.261              <attribute default="${build.classes.dir}" name="destdir"/>
  12.262              <attribute default="${javac.classpath}" name="classpath"/>
  12.263 +            <attribute default="${javac.modulepath}" name="modulepath"/>
  12.264 +            <attribute default="${javac.upgrademodulepath}" name="upgrademodulepath"/>
  12.265 +            <attribute default="${javac.processorpath}" name="processorpath"/>
  12.266 +            <attribute default="${javac.processormodulepath}" name="processormodulepath"/>
  12.267 +            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
  12.268              <attribute default="${includes}" name="includes"/>
  12.269              <attribute default="${excludes}" name="excludes"/>
  12.270              <attribute default="${javac.debug}" name="debug"/>
  12.271 -            <attribute default="" name="sourcepath"/>
  12.272 +            <attribute default="${empty.dir}" name="sourcepath" unless:set="named.module.internal"/>
  12.273 +            <attribute default="${src.dir}" if:set="named.module.internal" name="sourcepath"/>
  12.274 +            <attribute default="${empty.dir}" name="gensrcdir"/>
  12.275              <element name="customize" optional="true"/>
  12.276              <sequential>
  12.277 -                <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}">
  12.278 +                <condition property="warn.excludes.internal">
  12.279 +                    <and>
  12.280 +                        <isset property="named.module.internal"/>
  12.281 +                        <length length="0" string="@{excludes}" trim="true" when="greater"/>
  12.282 +                    </and>
  12.283 +                </condition>
  12.284 +                <echo if:set="warn.excludes.internal" level="warning" message="The javac excludes are not supported in the JDK 9 Named Module."/>
  12.285 +                <property location="${build.dir}/empty" name="empty.dir"/>
  12.286 +                <mkdir dir="${empty.dir}"/>
  12.287 +                <mkdir dir="@{apgeneratedsrcdir}"/>
  12.288 +                <condition property="processormodulepath.set">
  12.289 +                    <resourcecount count="0" when="greater">
  12.290 +                        <path>
  12.291 +                            <pathelement path="@{processormodulepath}"/>
  12.292 +                        </path>
  12.293 +                    </resourcecount>
  12.294 +                </condition>
  12.295 +                <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}">
  12.296 +                    <src>
  12.297 +                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
  12.298 +                            <include name="*"/>
  12.299 +                        </dirset>
  12.300 +                    </src>
  12.301                      <classpath>
  12.302                          <path path="@{classpath}"/>
  12.303                      </classpath>
  12.304 -                    <compilerarg line="${javac.compilerargs} ${javac.compilerargs.jaxws}"/>
  12.305 +                    <modulepath>
  12.306 +                        <path path="@{modulepath}"/>
  12.307 +                    </modulepath>
  12.308 +                    <upgrademodulepath>
  12.309 +                        <path path="@{upgrademodulepath}"/>
  12.310 +                    </upgrademodulepath>
  12.311 +                    <compilerarg line="${javac.systemmodulepath.cmd.line.arg}"/>
  12.312 +                    <compilerarg line="${javac.profile.cmd.line.arg}"/>
  12.313 +                    <compilerarg line="${javac.compilerargs}"/>
  12.314 +                    <compilerarg if:set="processormodulepath.set" value="--processor-module-path"/>
  12.315 +                    <compilerarg if:set="processormodulepath.set" path="@{processormodulepath}"/>
  12.316 +                    <compilerarg unless:set="processormodulepath.set" value="-processorpath"/>
  12.317 +                    <compilerarg path="@{processorpath}:${empty.dir}" unless:set="processormodulepath.set"/>
  12.318 +                    <compilerarg line="${ap.processors.internal}"/>
  12.319 +                    <compilerarg line="${annotation.processing.processor.options}"/>
  12.320 +                    <compilerarg value="-s"/>
  12.321 +                    <compilerarg path="@{apgeneratedsrcdir}"/>
  12.322 +                    <compilerarg line="${ap.proc.none.internal}"/>
  12.323                      <customize/>
  12.324                  </javac>
  12.325              </sequential>
  12.326          </macrodef>
  12.327 +    </target>
  12.328 +    <target depends="-init-ap-cmdline-properties,-init-source-module-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors" unless="modules.supported.internal">
  12.329 +        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
  12.330 +            <attribute default="${src.dir}" name="srcdir"/>
  12.331 +            <attribute default="${build.classes.dir}" name="destdir"/>
  12.332 +            <attribute default="${javac.classpath}" name="classpath"/>
  12.333 +            <attribute default="${javac.modulepath}" name="modulepath"/>
  12.334 +            <attribute default="${javac.upgrademodulepath}" name="upgrademodulepath"/>
  12.335 +            <attribute default="${javac.processorpath}" name="processorpath"/>
  12.336 +            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
  12.337 +            <attribute default="${includes}" name="includes"/>
  12.338 +            <attribute default="${excludes}" name="excludes"/>
  12.339 +            <attribute default="${javac.debug}" name="debug"/>
  12.340 +            <attribute default="${empty.dir}" name="sourcepath"/>
  12.341 +            <attribute default="${empty.dir}" name="gensrcdir"/>
  12.342 +            <element name="customize" optional="true"/>
  12.343 +            <sequential>
  12.344 +                <property location="${build.dir}/empty" name="empty.dir"/>
  12.345 +                <mkdir dir="${empty.dir}"/>
  12.346 +                <mkdir dir="@{apgeneratedsrcdir}"/>
  12.347 +                <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}">
  12.348 +                    <src>
  12.349 +                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
  12.350 +                            <include name="*"/>
  12.351 +                        </dirset>
  12.352 +                    </src>
  12.353 +                    <classpath>
  12.354 +                        <path path="@{classpath}"/>
  12.355 +                    </classpath>
  12.356 +                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
  12.357 +                    <compilerarg line="${javac.profile.cmd.line.arg}"/>
  12.358 +                    <compilerarg line="${javac.compilerargs}"/>
  12.359 +                    <compilerarg value="-processorpath"/>
  12.360 +                    <compilerarg path="@{processorpath}:${empty.dir}"/>
  12.361 +                    <compilerarg line="${ap.processors.internal}"/>
  12.362 +                    <compilerarg line="${annotation.processing.processor.options}"/>
  12.363 +                    <compilerarg value="-s"/>
  12.364 +                    <compilerarg path="@{apgeneratedsrcdir}"/>
  12.365 +                    <compilerarg line="${ap.proc.none.internal}"/>
  12.366 +                    <customize/>
  12.367 +                </javac>
  12.368 +            </sequential>
  12.369 +        </macrodef>
  12.370 +    </target>
  12.371 +    <target depends="-init-ap-cmdline-properties,-init-source-module-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
  12.372 +        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
  12.373 +            <attribute default="${src.dir}" name="srcdir"/>
  12.374 +            <attribute default="${build.classes.dir}" name="destdir"/>
  12.375 +            <attribute default="${javac.classpath}" name="classpath"/>
  12.376 +            <attribute default="${javac.modulepath}" name="modulepath"/>
  12.377 +            <attribute default="${javac.upgrademodulepath}" name="upgrademodulepath"/>
  12.378 +            <attribute default="${javac.processorpath}" name="processorpath"/>
  12.379 +            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
  12.380 +            <attribute default="${includes}" name="includes"/>
  12.381 +            <attribute default="${excludes}" name="excludes"/>
  12.382 +            <attribute default="${javac.debug}" name="debug"/>
  12.383 +            <attribute default="${empty.dir}" name="sourcepath"/>
  12.384 +            <attribute default="${empty.dir}" name="gensrcdir"/>
  12.385 +            <element name="customize" optional="true"/>
  12.386 +            <sequential>
  12.387 +                <property location="${build.dir}/empty" name="empty.dir"/>
  12.388 +                <mkdir dir="${empty.dir}"/>
  12.389 +                <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}">
  12.390 +                    <src>
  12.391 +                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
  12.392 +                            <include name="*"/>
  12.393 +                        </dirset>
  12.394 +                    </src>
  12.395 +                    <classpath>
  12.396 +                        <path path="@{classpath}"/>
  12.397 +                    </classpath>
  12.398 +                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
  12.399 +                    <compilerarg line="${javac.profile.cmd.line.arg}"/>
  12.400 +                    <compilerarg line="${javac.compilerargs}"/>
  12.401 +                    <customize/>
  12.402 +                </javac>
  12.403 +            </sequential>
  12.404 +        </macrodef>
  12.405 +    </target>
  12.406 +    <target depends="-init-macrodef-javac-with-module,-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
  12.407          <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
  12.408              <attribute default="${src.dir}" name="srcdir"/>
  12.409              <attribute default="${build.classes.dir}" name="destdir"/>
  12.410 @@ -180,51 +470,383 @@
  12.411              <attribute default="${build.classes.dir}" name="destdir"/>
  12.412              <sequential>
  12.413                  <fail unless="javac.includes">Must set javac.includes</fail>
  12.414 -                <pathconvert pathsep="," property="javac.includes.binary">
  12.415 +                <pathconvert pathsep="${line.separator}" property="javac.includes.binary">
  12.416                      <path>
  12.417                          <filelist dir="@{destdir}" files="${javac.includes}"/>
  12.418                      </path>
  12.419                      <globmapper from="*.java" to="*.class"/>
  12.420                  </pathconvert>
  12.421 +                <tempfile deleteonexit="true" property="javac.includesfile.binary"/>
  12.422 +                <echo file="${javac.includesfile.binary}" message="${javac.includes.binary}"/>
  12.423                  <delete>
  12.424 -                    <files includes="${javac.includes.binary}"/>
  12.425 +                    <files includesfile="${javac.includesfile.binary}"/>
  12.426 +                </delete>
  12.427 +                <delete>
  12.428 +                    <fileset file="${javac.includesfile.binary}"/>
  12.429                  </delete>
  12.430              </sequential>
  12.431          </macrodef>
  12.432      </target>
  12.433 -    <target name="-init-macrodef-junit">
  12.434 +    <target if="${junit.available}" name="-init-macrodef-junit-init">
  12.435 +        <condition else="false" property="nb.junit.batch" value="true">
  12.436 +            <and>
  12.437 +                <istrue value="${junit.available}"/>
  12.438 +                <not>
  12.439 +                    <isset property="test.method"/>
  12.440 +                </not>
  12.441 +            </and>
  12.442 +        </condition>
  12.443 +        <condition else="false" property="nb.junit.single" value="true">
  12.444 +            <and>
  12.445 +                <istrue value="${junit.available}"/>
  12.446 +                <isset property="test.method"/>
  12.447 +            </and>
  12.448 +        </condition>
  12.449 +    </target>
  12.450 +    <target name="-init-test-properties">
  12.451 +        <property name="test.binaryincludes" value="&lt;nothing&gt;"/>
  12.452 +        <property name="test.binarytestincludes" value=""/>
  12.453 +        <property name="test.binaryexcludes" value=""/>
  12.454 +    </target>
  12.455 +    <target depends="-init-modules-supported" if="modules.supported.internal" name="-init-macrodef-junit-prototype-with-module">
  12.456 +        <macrodef name="junit-prototype" uri="http://www.netbeans.org/ns/j2se-project/3">
  12.457 +            <attribute default="${includes}" name="includes"/>
  12.458 +            <attribute default="${excludes}" name="excludes"/>
  12.459 +            <element name="customizePrototype" optional="true"/>
  12.460 +            <sequential>
  12.461 +                <property name="junit.forkmode" value="perTest"/>
  12.462 +                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
  12.463 +                    <syspropertyset>
  12.464 +                        <propertyref prefix="test-sys-prop."/>
  12.465 +                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
  12.466 +                    </syspropertyset>
  12.467 +                    <classpath>
  12.468 +                        <path path="${run.test.classpath}"/>
  12.469 +                    </classpath>
  12.470 +                    <modulepath>
  12.471 +                        <path path="${run.test.modulepath}"/>
  12.472 +                    </modulepath>
  12.473 +                    <formatter type="brief" usefile="false"/>
  12.474 +                    <formatter type="xml"/>
  12.475 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
  12.476 +                    <jvmarg value="-ea"/>
  12.477 +                    <jvmarg line="${run.test.jvmargs}"/>
  12.478 +                    <customizePrototype/>
  12.479 +                </junit>
  12.480 +            </sequential>
  12.481 +        </macrodef>
  12.482 +    </target>
  12.483 +    <target depends="-init-modules-supported" name="-init-macrodef-junit-prototype-without-module" unless="modules.supported.internal">
  12.484 +        <macrodef name="junit-prototype" uri="http://www.netbeans.org/ns/j2se-project/3">
  12.485 +            <attribute default="${includes}" name="includes"/>
  12.486 +            <attribute default="${excludes}" name="excludes"/>
  12.487 +            <element name="customizePrototype" optional="true"/>
  12.488 +            <sequential>
  12.489 +                <property name="junit.forkmode" value="perTest"/>
  12.490 +                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
  12.491 +                    <syspropertyset>
  12.492 +                        <propertyref prefix="test-sys-prop."/>
  12.493 +                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
  12.494 +                    </syspropertyset>
  12.495 +                    <classpath>
  12.496 +                        <path path="${run.test.classpath}"/>
  12.497 +                    </classpath>
  12.498 +                    <formatter type="brief" usefile="false"/>
  12.499 +                    <formatter type="xml"/>
  12.500 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
  12.501 +                    <jvmarg value="-ea"/>
  12.502 +                    <customizePrototype/>
  12.503 +                </junit>
  12.504 +            </sequential>
  12.505 +        </macrodef>
  12.506 +    </target>
  12.507 +    <target depends="-init-test-properties,-init-macrodef-junit-prototype-with-module,-init-macrodef-junit-prototype-without-module" if="${nb.junit.single}" name="-init-macrodef-junit-single" unless="${nb.junit.batch}">
  12.508          <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
  12.509              <attribute default="${includes}" name="includes"/>
  12.510              <attribute default="${excludes}" name="excludes"/>
  12.511              <attribute default="**" name="testincludes"/>
  12.512 +            <attribute default="" name="testmethods"/>
  12.513 +            <element name="customize" optional="true"/>
  12.514              <sequential>
  12.515 -                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true">
  12.516 -                    <batchtest todir="${build.test.results.dir}">
  12.517 -                        <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
  12.518 -                            <filename name="@{testincludes}"/>
  12.519 -                        </fileset>
  12.520 -                    </batchtest>
  12.521 +                <j2seproject3:junit-prototype>
  12.522 +                    <customizePrototype>
  12.523 +                        <test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/>
  12.524 +                        <customize/>
  12.525 +                    </customizePrototype>
  12.526 +                </j2seproject3:junit-prototype>
  12.527 +            </sequential>
  12.528 +        </macrodef>
  12.529 +    </target>
  12.530 +    <target depends="-init-test-properties,-init-macrodef-junit-prototype-with-module,-init-macrodef-junit-prototype-without-module" if="${nb.junit.batch}" name="-init-macrodef-junit-batch" unless="${nb.junit.single}">
  12.531 +        <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
  12.532 +            <attribute default="${includes}" name="includes"/>
  12.533 +            <attribute default="${excludes}" name="excludes"/>
  12.534 +            <attribute default="**" name="testincludes"/>
  12.535 +            <attribute default="" name="testmethods"/>
  12.536 +            <element name="customize" optional="true"/>
  12.537 +            <sequential>
  12.538 +                <j2seproject3:junit-prototype>
  12.539 +                    <customizePrototype>
  12.540 +                        <batchtest todir="${build.test.results.dir}">
  12.541 +                            <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
  12.542 +                                <filename name="@{testincludes}"/>
  12.543 +                            </fileset>
  12.544 +                            <fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}">
  12.545 +                                <filename name="${test.binarytestincludes}"/>
  12.546 +                            </fileset>
  12.547 +                        </batchtest>
  12.548 +                        <customize/>
  12.549 +                    </customizePrototype>
  12.550 +                </j2seproject3:junit-prototype>
  12.551 +            </sequential>
  12.552 +        </macrodef>
  12.553 +    </target>
  12.554 +    <target depends="-init-macrodef-junit-init,-init-macrodef-junit-single, -init-macrodef-junit-batch" if="${junit.available}" name="-init-macrodef-junit"/>
  12.555 +    <target if="${testng.available}" name="-init-macrodef-testng">
  12.556 +        <macrodef name="testng" uri="http://www.netbeans.org/ns/j2se-project/3">
  12.557 +            <attribute default="${includes}" name="includes"/>
  12.558 +            <attribute default="${excludes}" name="excludes"/>
  12.559 +            <attribute default="**" name="testincludes"/>
  12.560 +            <attribute default="" name="testmethods"/>
  12.561 +            <element name="customize" optional="true"/>
  12.562 +            <sequential>
  12.563 +                <condition else="" property="testng.methods.arg" value="@{testincludes}.@{testmethods}">
  12.564 +                    <isset property="test.method"/>
  12.565 +                </condition>
  12.566 +                <union id="test.set">
  12.567 +                    <fileset dir="${test.src.dir}" excludes="@{excludes},**/*.xml,${excludes}" includes="@{includes}">
  12.568 +                        <filename name="@{testincludes}"/>
  12.569 +                    </fileset>
  12.570 +                </union>
  12.571 +                <taskdef classname="org.testng.TestNGAntTask" classpath="${run.test.classpath}" name="testng"/>
  12.572 +                <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="conditionaluseofapi" testname="TestNG tests" workingDir="${work.dir}">
  12.573 +                    <xmlfileset dir="${build.test.classes.dir}" includes="@{testincludes}"/>
  12.574 +                    <propertyset>
  12.575 +                        <propertyref prefix="test-sys-prop."/>
  12.576 +                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
  12.577 +                    </propertyset>
  12.578                      <classpath>
  12.579                          <path path="${run.test.classpath}"/>
  12.580                      </classpath>
  12.581 -                    <syspropertyset>
  12.582 -                        <propertyref prefix="test-sys-prop."/>
  12.583 -                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
  12.584 -                    </syspropertyset>
  12.585 -                    <formatter type="brief" usefile="false"/>
  12.586 -                    <formatter type="xml"/>
  12.587 -                    <jvmarg line="${run.jvmargs}"/>
  12.588 -                </junit>
  12.589 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
  12.590 +                    <customize/>
  12.591 +                </testng>
  12.592              </sequential>
  12.593          </macrodef>
  12.594      </target>
  12.595 -    <target name="-init-macrodef-nbjpda">
  12.596 +    <target name="-init-macrodef-test-impl">
  12.597 +        <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
  12.598 +            <attribute default="${includes}" name="includes"/>
  12.599 +            <attribute default="${excludes}" name="excludes"/>
  12.600 +            <attribute default="**" name="testincludes"/>
  12.601 +            <attribute default="" name="testmethods"/>
  12.602 +            <element implicit="true" name="customize" optional="true"/>
  12.603 +            <sequential>
  12.604 +                <echo>No tests executed.</echo>
  12.605 +            </sequential>
  12.606 +        </macrodef>
  12.607 +    </target>
  12.608 +    <target depends="-init-macrodef-junit" if="${junit.available}" name="-init-macrodef-junit-impl">
  12.609 +        <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
  12.610 +            <attribute default="${includes}" name="includes"/>
  12.611 +            <attribute default="${excludes}" name="excludes"/>
  12.612 +            <attribute default="**" name="testincludes"/>
  12.613 +            <attribute default="" name="testmethods"/>
  12.614 +            <element implicit="true" name="customize" optional="true"/>
  12.615 +            <sequential>
  12.616 +                <j2seproject3:junit excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
  12.617 +                    <customize/>
  12.618 +                </j2seproject3:junit>
  12.619 +            </sequential>
  12.620 +        </macrodef>
  12.621 +    </target>
  12.622 +    <target depends="-init-macrodef-testng" if="${testng.available}" name="-init-macrodef-testng-impl">
  12.623 +        <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
  12.624 +            <attribute default="${includes}" name="includes"/>
  12.625 +            <attribute default="${excludes}" name="excludes"/>
  12.626 +            <attribute default="**" name="testincludes"/>
  12.627 +            <attribute default="" name="testmethods"/>
  12.628 +            <element implicit="true" name="customize" optional="true"/>
  12.629 +            <sequential>
  12.630 +                <j2seproject3:testng excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
  12.631 +                    <customize/>
  12.632 +                </j2seproject3:testng>
  12.633 +            </sequential>
  12.634 +        </macrodef>
  12.635 +    </target>
  12.636 +    <target depends="-init-macrodef-test-impl,-init-macrodef-junit-impl,-init-macrodef-testng-impl" name="-init-macrodef-test">
  12.637 +        <macrodef name="test" uri="http://www.netbeans.org/ns/j2se-project/3">
  12.638 +            <attribute default="${includes}" name="includes"/>
  12.639 +            <attribute default="${excludes}" name="excludes"/>
  12.640 +            <attribute default="**" name="testincludes"/>
  12.641 +            <attribute default="" name="testmethods"/>
  12.642 +            <sequential>
  12.643 +                <j2seproject3:test-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
  12.644 +                    <customize>
  12.645 +                        <jvmarg line="${run.jvmargs}"/>
  12.646 +                        <jvmarg line="${run.jvmargs.ide}"/>
  12.647 +                    </customize>
  12.648 +                </j2seproject3:test-impl>
  12.649 +            </sequential>
  12.650 +        </macrodef>
  12.651 +    </target>
  12.652 +    <target depends="-init-macrodef-junit" if="${junit.available}" name="-init-macrodef-junit-debug-impl">
  12.653 +        <macrodef name="test-debug-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
  12.654 +            <attribute default="${includes}" name="includes"/>
  12.655 +            <attribute default="${excludes}" name="excludes"/>
  12.656 +            <attribute default="**" name="testincludes"/>
  12.657 +            <attribute default="" name="testmethods"/>
  12.658 +            <element name="customizeDebuggee" optional="true"/>
  12.659 +            <sequential>
  12.660 +                <j2seproject3:junit excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
  12.661 +                    <customize>
  12.662 +                        <jvmarg value="-agentlib:jdwp=transport=${debug-transport},address=${jpda.address}"/>
  12.663 +                        <customizeDebuggee/>
  12.664 +                    </customize>
  12.665 +                </j2seproject3:junit>
  12.666 +            </sequential>
  12.667 +        </macrodef>
  12.668 +    </target>
  12.669 +    <target if="${testng.available}" name="-init-macrodef-testng-debug">
  12.670 +        <macrodef name="testng-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
  12.671 +            <attribute default="${main.class}" name="testClass"/>
  12.672 +            <attribute default="" name="testMethod"/>
  12.673 +            <element name="customize2" optional="true"/>
  12.674 +            <sequential>
  12.675 +                <condition else="-testclass @{testClass}" property="test.class.or.method" value="-methods @{testClass}.@{testMethod}">
  12.676 +                    <isset property="test.method"/>
  12.677 +                </condition>
  12.678 +                <condition else="-suitename conditionaluseofapi -testname @{testClass} ${test.class.or.method}" property="testng.cmd.args" value="@{testClass}">
  12.679 +                    <matches pattern=".*\.xml" string="@{testClass}"/>
  12.680 +                </condition>
  12.681 +                <delete dir="${build.test.results.dir}" quiet="true"/>
  12.682 +                <mkdir dir="${build.test.results.dir}"/>
  12.683 +                <j2seproject3:debug classname="org.testng.TestNG" classpath="${debug.test.classpath}">
  12.684 +                    <customizeDebuggee>
  12.685 +                        <customize2/>
  12.686 +                        <jvmarg value="-ea"/>
  12.687 +                        <arg line="${testng.debug.mode}"/>
  12.688 +                        <arg line="-d ${build.test.results.dir}"/>
  12.689 +                        <arg line="-listener org.testng.reporters.VerboseReporter"/>
  12.690 +                        <arg line="${testng.cmd.args}"/>
  12.691 +                    </customizeDebuggee>
  12.692 +                </j2seproject3:debug>
  12.693 +            </sequential>
  12.694 +        </macrodef>
  12.695 +    </target>
  12.696 +    <target depends="-init-macrodef-testng-debug" if="${testng.available}" name="-init-macrodef-testng-debug-impl">
  12.697 +        <macrodef name="testng-debug-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
  12.698 +            <attribute default="${main.class}" name="testClass"/>
  12.699 +            <attribute default="" name="testMethod"/>
  12.700 +            <element implicit="true" name="customize2" optional="true"/>
  12.701 +            <sequential>
  12.702 +                <j2seproject3:testng-debug testClass="@{testClass}" testMethod="@{testMethod}">
  12.703 +                    <customize2/>
  12.704 +                </j2seproject3:testng-debug>
  12.705 +            </sequential>
  12.706 +        </macrodef>
  12.707 +    </target>
  12.708 +    <target depends="-init-macrodef-junit-debug-impl" if="${junit.available}" name="-init-macrodef-test-debug-junit">
  12.709 +        <macrodef name="test-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
  12.710 +            <attribute default="${includes}" name="includes"/>
  12.711 +            <attribute default="${excludes}" name="excludes"/>
  12.712 +            <attribute default="**" name="testincludes"/>
  12.713 +            <attribute default="" name="testmethods"/>
  12.714 +            <attribute default="${main.class}" name="testClass"/>
  12.715 +            <attribute default="" name="testMethod"/>
  12.716 +            <sequential>
  12.717 +                <j2seproject3:test-debug-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
  12.718 +                    <customizeDebuggee>
  12.719 +                        <jvmarg line="${run.jvmargs}"/>
  12.720 +                        <jvmarg line="${run.jvmargs.ide}"/>
  12.721 +                    </customizeDebuggee>
  12.722 +                </j2seproject3:test-debug-impl>
  12.723 +            </sequential>
  12.724 +        </macrodef>
  12.725 +    </target>
  12.726 +    <target depends="-init-macrodef-testng-debug-impl" if="${testng.available}" name="-init-macrodef-test-debug-testng">
  12.727 +        <macrodef name="test-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
  12.728 +            <attribute default="${includes}" name="includes"/>
  12.729 +            <attribute default="${excludes}" name="excludes"/>
  12.730 +            <attribute default="**" name="testincludes"/>
  12.731 +            <attribute default="" name="testmethods"/>
  12.732 +            <attribute default="${main.class}" name="testClass"/>
  12.733 +            <attribute default="" name="testMethod"/>
  12.734 +            <sequential>
  12.735 +                <j2seproject3:testng-debug-impl testClass="@{testClass}" testMethod="@{testMethod}">
  12.736 +                    <customize2>
  12.737 +                        <syspropertyset>
  12.738 +                            <propertyref prefix="test-sys-prop."/>
  12.739 +                            <mapper from="test-sys-prop.*" to="*" type="glob"/>
  12.740 +                        </syspropertyset>
  12.741 +                    </customize2>
  12.742 +                </j2seproject3:testng-debug-impl>
  12.743 +            </sequential>
  12.744 +        </macrodef>
  12.745 +    </target>
  12.746 +    <target depends="-init-macrodef-test-debug-junit,-init-macrodef-test-debug-testng" name="-init-macrodef-test-debug"/>
  12.747 +    <!--
  12.748 +                pre NB7.2 profiling section; consider it deprecated
  12.749 +            -->
  12.750 +    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check" if="profiler.info.jvmargs.agent" name="profile-init"/>
  12.751 +    <target if="profiler.info.jvmargs.agent" name="-profile-pre-init">
  12.752 +        <!-- Empty placeholder for easier customization. -->
  12.753 +        <!-- You can override this target in the ../build.xml file. -->
  12.754 +    </target>
  12.755 +    <target if="profiler.info.jvmargs.agent" name="-profile-post-init">
  12.756 +        <!-- Empty placeholder for easier customization. -->
  12.757 +        <!-- You can override this target in the ../build.xml file. -->
  12.758 +    </target>
  12.759 +    <target if="profiler.info.jvmargs.agent" name="-profile-init-macrodef-profile">
  12.760 +        <macrodef name="resolve">
  12.761 +            <attribute name="name"/>
  12.762 +            <attribute name="value"/>
  12.763 +            <sequential>
  12.764 +                <property name="@{name}" value="${env.@{value}}"/>
  12.765 +            </sequential>
  12.766 +        </macrodef>
  12.767 +        <macrodef name="profile">
  12.768 +            <attribute default="${main.class}" name="classname"/>
  12.769 +            <element name="customize" optional="true"/>
  12.770 +            <sequential>
  12.771 +                <property environment="env"/>
  12.772 +                <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
  12.773 +                <java classname="@{classname}" dir="${profiler.info.dir}" failonerror="${java.failonerror}" fork="true" jvm="${profiler.info.jvm}">
  12.774 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
  12.775 +                    <jvmarg value="${profiler.info.jvmargs.agent}"/>
  12.776 +                    <jvmarg line="${profiler.info.jvmargs}"/>
  12.777 +                    <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
  12.778 +                    <arg line="${application.args}"/>
  12.779 +                    <classpath>
  12.780 +                        <path path="${run.classpath}"/>
  12.781 +                    </classpath>
  12.782 +                    <syspropertyset>
  12.783 +                        <propertyref prefix="run-sys-prop."/>
  12.784 +                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
  12.785 +                    </syspropertyset>
  12.786 +                    <customize/>
  12.787 +                </java>
  12.788 +            </sequential>
  12.789 +        </macrodef>
  12.790 +    </target>
  12.791 +    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile" if="profiler.info.jvmargs.agent" name="-profile-init-check">
  12.792 +        <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail>
  12.793 +        <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
  12.794 +    </target>
  12.795 +    <!--
  12.796 +                end of pre NB7.2 profiling section
  12.797 +            -->
  12.798 +    <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
  12.799          <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
  12.800              <attribute default="${main.class}" name="name"/>
  12.801 +            <attribute default="${debug.modulepath}" name="modulepath"/>
  12.802              <attribute default="${debug.classpath}" name="classpath"/>
  12.803              <attribute default="" name="stopclassname"/>
  12.804              <sequential>
  12.805 -                <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="dt_socket">
  12.806 +                <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport}">
  12.807 +                    <modulepath>
  12.808 +                        <path path="@{modulepath}"/>
  12.809 +                    </modulepath>
  12.810                      <classpath>
  12.811                          <path path="@{classpath}"/>
  12.812                      </classpath>
  12.813 @@ -235,35 +857,120 @@
  12.814              <attribute default="${build.classes.dir}" name="dir"/>
  12.815              <sequential>
  12.816                  <nbjpdareload>
  12.817 -                    <fileset dir="@{dir}" includes="${fix.includes}*.class"/>
  12.818 +                    <fileset dir="@{dir}" includes="${fix.classes}">
  12.819 +                        <include name="${fix.includes}*.class"/>
  12.820 +                    </fileset>
  12.821                  </nbjpdareload>
  12.822              </sequential>
  12.823          </macrodef>
  12.824      </target>
  12.825      <target name="-init-debug-args">
  12.826 -        <property name="version-output" value="java version &quot;${ant.java.version}"/>
  12.827 -        <condition property="have-jdk-older-than-1.4">
  12.828 -            <or>
  12.829 -                <contains string="${version-output}" substring="java version &quot;1.0"/>
  12.830 -                <contains string="${version-output}" substring="java version &quot;1.1"/>
  12.831 -                <contains string="${version-output}" substring="java version &quot;1.2"/>
  12.832 -                <contains string="${version-output}" substring="java version &quot;1.3"/>
  12.833 -            </or>
  12.834 +        <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
  12.835 +            <os family="windows"/>
  12.836          </condition>
  12.837 -        <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
  12.838 -            <istrue value="${have-jdk-older-than-1.4}"/>
  12.839 +        <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}">
  12.840 +            <isset property="debug.transport"/>
  12.841          </condition>
  12.842      </target>
  12.843      <target depends="-init-debug-args" name="-init-macrodef-debug">
  12.844          <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
  12.845 +            <attribute default="${module.name}" name="modulename"/>
  12.846              <attribute default="${main.class}" name="classname"/>
  12.847 +            <attribute default="${debug.modulepath}" name="modulepath"/>
  12.848              <attribute default="${debug.classpath}" name="classpath"/>
  12.849 +            <element name="customizeDebuggee" optional="true"/>
  12.850 +            <sequential>
  12.851 +                <j2seproject1:java classname="@{classname}" classpath="@{classpath}" modulename="@{modulename}" modulepath="@{modulepath}">
  12.852 +                    <customize>
  12.853 +                        <jvmarg value="-agentlib:jdwp=transport=${debug-transport},address=${jpda.address}"/>
  12.854 +                        <customizeDebuggee/>
  12.855 +                    </customize>
  12.856 +                </j2seproject1:java>
  12.857 +            </sequential>
  12.858 +        </macrodef>
  12.859 +    </target>
  12.860 +    <target depends="-init-source-module-properties" if="named.module.internal" name="-init-macrodef-java-with-module">
  12.861 +        <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
  12.862 +            <attribute default="${module.name}" name="modulename"/>
  12.863 +            <attribute default="${main.class}" name="classname"/>
  12.864 +            <attribute default="${run.modulepath}" name="modulepath"/>
  12.865 +            <attribute default="${run.upgrademodulepath}" name="upgrademodulepath"/>
  12.866 +            <attribute default="${run.classpath}" name="classpath"/>
  12.867 +            <attribute default="jvm" name="jvm"/>
  12.868              <element name="customize" optional="true"/>
  12.869              <sequential>
  12.870 -                <java classname="@{classname}" dir="${work.dir}" fork="true">
  12.871 -                    <jvmarg line="${debug-args-line}"/>
  12.872 -                    <jvmarg value="-Xrunjdwp:transport=dt_socket,address=${jpda.address}"/>
  12.873 +                <java classname="@{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true" module="@{modulename}">
  12.874 +                    <classpath>
  12.875 +                        <path path="@{classpath}"/>
  12.876 +                    </classpath>
  12.877 +                    <modulepath>
  12.878 +                        <pathelement path="@{modulepath}"/>
  12.879 +                        <pathelement location="${module.build.classes.dir}"/>
  12.880 +                    </modulepath>
  12.881 +                    <upgrademodulepath>
  12.882 +                        <path path="@{upgrademodulepath}"/>
  12.883 +                    </upgrademodulepath>
  12.884 +                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
  12.885 +                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
  12.886                      <jvmarg line="${run.jvmargs}"/>
  12.887 +                    <jvmarg line="${run.jvmargs.ide}"/>
  12.888 +                    <syspropertyset>
  12.889 +                        <propertyref prefix="run-sys-prop."/>
  12.890 +                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
  12.891 +                    </syspropertyset>
  12.892 +                    <customize/>
  12.893 +                </java>
  12.894 +            </sequential>
  12.895 +        </macrodef>
  12.896 +    </target>
  12.897 +    <target depends="-init-source-module-properties" if="unnamed.module.internal" name="-init-macrodef-java-with-unnamed-module">
  12.898 +        <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
  12.899 +            <attribute default="" name="modulename"/>
  12.900 +            <attribute default="${main.class}" name="classname"/>
  12.901 +            <attribute default="${run.modulepath}" name="modulepath"/>
  12.902 +            <attribute default="${run.upgrademodulepath}" name="upgrademodulepath"/>
  12.903 +            <attribute default="${run.classpath}" name="classpath"/>
  12.904 +            <attribute default="jvm" name="jvm"/>
  12.905 +            <element name="customize" optional="true"/>
  12.906 +            <sequential>
  12.907 +                <java classname="@{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true">
  12.908 +                    <classpath>
  12.909 +                        <path path="@{classpath}"/>
  12.910 +                    </classpath>
  12.911 +                    <modulepath>
  12.912 +                        <path path="@{modulepath}"/>
  12.913 +                    </modulepath>
  12.914 +                    <upgrademodulepath>
  12.915 +                        <path path="@{upgrademodulepath}"/>
  12.916 +                    </upgrademodulepath>
  12.917 +                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
  12.918 +                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
  12.919 +                    <jvmarg line="${run.jvmargs}"/>
  12.920 +                    <jvmarg line="${run.jvmargs.ide}"/>
  12.921 +                    <syspropertyset>
  12.922 +                        <propertyref prefix="run-sys-prop."/>
  12.923 +                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
  12.924 +                    </syspropertyset>
  12.925 +                    <customize/>
  12.926 +                </java>
  12.927 +            </sequential>
  12.928 +        </macrodef>
  12.929 +    </target>
  12.930 +    <target depends="-init-source-module-properties" name="-init-macrodef-java-without-module" unless="modules.supported.internal">
  12.931 +        <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
  12.932 +            <attribute default="" name="modulename"/>
  12.933 +            <attribute default="${main.class}" name="classname"/>
  12.934 +            <attribute default="" name="modulepath"/>
  12.935 +            <attribute default="${run.classpath}" name="classpath"/>
  12.936 +            <attribute default="jvm" name="jvm"/>
  12.937 +            <element name="customize" optional="true"/>
  12.938 +            <sequential>
  12.939 +                <java classname="@{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true">
  12.940 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
  12.941 +                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
  12.942 +                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
  12.943 +                    <jvmarg line="${run.jvmargs}"/>
  12.944 +                    <jvmarg line="${run.jvmargs.ide}"/>
  12.945                      <classpath>
  12.946                          <path path="@{classpath}"/>
  12.947                      </classpath>
  12.948 @@ -276,39 +983,100 @@
  12.949              </sequential>
  12.950          </macrodef>
  12.951      </target>
  12.952 -    <target name="-init-macrodef-java">
  12.953 -        <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
  12.954 -            <attribute default="${main.class}" name="classname"/>
  12.955 +    <target depends="-init-macrodef-java-with-module, -init-macrodef-java-with-unnamed-module, -init-macrodef-java-without-module" name="-init-macrodef-java"/>
  12.956 +    <target name="-init-macrodef-copylibs">
  12.957 +        <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
  12.958 +            <attribute default="${manifest.file}" name="manifest"/>
  12.959              <element name="customize" optional="true"/>
  12.960              <sequential>
  12.961 -                <java classname="@{classname}" dir="${work.dir}" fork="true">
  12.962 -                    <jvmarg line="${run.jvmargs}"/>
  12.963 -                    <classpath>
  12.964 -                        <path path="${run.classpath}"/>
  12.965 -                    </classpath>
  12.966 -                    <syspropertyset>
  12.967 -                        <propertyref prefix="run-sys-prop."/>
  12.968 -                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
  12.969 -                    </syspropertyset>
  12.970 -                    <customize/>
  12.971 -                </java>
  12.972 +                <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
  12.973 +                <pathconvert property="run.classpath.without.build.classes.dir">
  12.974 +                    <path path="${run.classpath}"/>
  12.975 +                    <map from="${build.classes.dir.resolved}" to=""/>
  12.976 +                </pathconvert>
  12.977 +                <pathconvert pathsep=" " property="jar.classpath">
  12.978 +                    <path path="${run.classpath.without.build.classes.dir}"/>
  12.979 +                    <chainedmapper>
  12.980 +                        <flattenmapper/>
  12.981 +                        <filtermapper>
  12.982 +                            <replacestring from=" " to="%20"/>
  12.983 +                        </filtermapper>
  12.984 +                        <globmapper from="*" to="lib/*"/>
  12.985 +                    </chainedmapper>
  12.986 +                </pathconvert>
  12.987 +                <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
  12.988 +                <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}">
  12.989 +                    <fileset dir="${build.classes.dir}" excludes="${dist.archive.excludes}"/>
  12.990 +                    <manifest>
  12.991 +                        <attribute name="Class-Path" value="${jar.classpath}"/>
  12.992 +                        <customize/>
  12.993 +                    </manifest>
  12.994 +                </copylibs>
  12.995              </sequential>
  12.996          </macrodef>
  12.997      </target>
  12.998      <target name="-init-presetdef-jar">
  12.999          <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
 12.1000 -            <jar compress="${jar.compress}" jarfile="${dist.jar}">
 12.1001 -                <j2seproject1:fileset dir="${build.classes.dir}"/>
 12.1002 +            <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}" manifestencoding="UTF-8">
 12.1003 +                <j2seproject1:fileset dir="${build.classes.dir}" excludes="${dist.archive.excludes}"/>
 12.1004              </jar>
 12.1005          </presetdef>
 12.1006      </target>
 12.1007 -    <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"/>
 12.1008 +    <target name="-init-ap-cmdline-properties">
 12.1009 +        <property name="annotation.processing.enabled" value="true"/>
 12.1010 +        <property name="annotation.processing.processors.list" value=""/>
 12.1011 +        <property name="annotation.processing.processor.options" value=""/>
 12.1012 +        <property name="annotation.processing.run.all.processors" value="true"/>
 12.1013 +        <property name="javac.processorpath" value="${javac.classpath}"/>
 12.1014 +        <property name="javac.test.processorpath" value="${javac.test.classpath}"/>
 12.1015 +        <condition property="ap.supported.internal" value="true">
 12.1016 +            <not>
 12.1017 +                <matches pattern="1\.[0-5](\..*)?" string="${javac.source}"/>
 12.1018 +            </not>
 12.1019 +        </condition>
 12.1020 +    </target>
 12.1021 +    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-ap-cmdline-supported">
 12.1022 +        <condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}">
 12.1023 +            <isfalse value="${annotation.processing.run.all.processors}"/>
 12.1024 +        </condition>
 12.1025 +        <condition else="" property="ap.proc.none.internal" value="-proc:none">
 12.1026 +            <isfalse value="${annotation.processing.enabled}"/>
 12.1027 +        </condition>
 12.1028 +    </target>
 12.1029 +    <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline">
 12.1030 +        <property name="ap.cmd.line.internal" value=""/>
 12.1031 +    </target>
 12.1032 +    <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"/>
 12.1033      <!--
 12.1034                  ===================
 12.1035                  COMPILATION SECTION
 12.1036                  ===================
 12.1037              -->
 12.1038 -    <target depends="init" name="deps-jar" unless="no.deps"/>
 12.1039 +    <target name="-deps-jar-init" unless="built-jar.properties">
 12.1040 +        <property location="${build.dir}/built-jar.properties" name="built-jar.properties"/>
 12.1041 +        <delete file="${built-jar.properties}" quiet="true"/>
 12.1042 +    </target>
 12.1043 +    <target if="already.built.jar.${basedir}" name="-warn-already-built-jar">
 12.1044 +        <echo level="warn" message="Cycle detected: conditionaluseofapi was already built"/>
 12.1045 +    </target>
 12.1046 +    <target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps">
 12.1047 +        <mkdir dir="${build.dir}"/>
 12.1048 +        <touch file="${built-jar.properties}" verbose="false"/>
 12.1049 +        <property file="${built-jar.properties}" prefix="already.built.jar."/>
 12.1050 +        <antcall target="-warn-already-built-jar"/>
 12.1051 +        <propertyfile file="${built-jar.properties}">
 12.1052 +            <entry key="${basedir}" value=""/>
 12.1053 +        </propertyfile>
 12.1054 +    </target>
 12.1055 +    <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
 12.1056 +    <target depends="init" name="-check-automatic-build">
 12.1057 +        <available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/>
 12.1058 +    </target>
 12.1059 +    <target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build">
 12.1060 +        <antcall target="clean">
 12.1061 +            <param name="no.dependencies" value="true"/>
 12.1062 +        </antcall>
 12.1063 +    </target>
 12.1064      <target depends="init,deps-jar" name="-pre-pre-compile">
 12.1065          <mkdir dir="${build.classes.dir}"/>
 12.1066      </target>
 12.1067 @@ -317,19 +1085,30 @@
 12.1068          <!-- You can override this target in the ../build.xml file. -->
 12.1069      </target>
 12.1070      <target if="do.depend.true" name="-compile-depend">
 12.1071 -        <j2seproject3:depend/>
 12.1072 +        <pathconvert property="build.generated.subdirs">
 12.1073 +            <dirset dir="${build.generated.sources.dir}" erroronmissingdir="false">
 12.1074 +                <include name="*"/>
 12.1075 +            </dirset>
 12.1076 +        </pathconvert>
 12.1077 +        <j2seproject3:depend srcdir="${src.dir}:${build.generated.subdirs}"/>
 12.1078      </target>
 12.1079 -    <target depends="init,deps-jar,-pre-pre-compile,-pre-compile,-compile-depend" if="have.sources" name="-do-compile">
 12.1080 -        <j2seproject3:javac/>
 12.1081 +    <target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile">
 12.1082 +        <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
 12.1083          <copy todir="${build.classes.dir}">
 12.1084              <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
 12.1085          </copy>
 12.1086      </target>
 12.1087 +    <target if="has.persistence.xml" name="-copy-persistence-xml">
 12.1088 +        <mkdir dir="${build.classes.dir}/META-INF"/>
 12.1089 +        <copy todir="${build.classes.dir}/META-INF">
 12.1090 +            <fileset dir="${meta.inf.dir}" includes="persistence.xml orm.xml"/>
 12.1091 +        </copy>
 12.1092 +    </target>
 12.1093      <target name="-post-compile">
 12.1094          <!-- Empty placeholder for easier customization. -->
 12.1095          <!-- You can override this target in the ../build.xml file. -->
 12.1096      </target>
 12.1097 -    <target depends="init,deps-jar,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
 12.1098 +    <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
 12.1099      <target name="-pre-compile-single">
 12.1100          <!-- Empty placeholder for easier customization. -->
 12.1101          <!-- You can override this target in the ../build.xml file. -->
 12.1102 @@ -337,13 +1116,13 @@
 12.1103      <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
 12.1104          <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
 12.1105          <j2seproject3:force-recompile/>
 12.1106 -        <j2seproject3:javac excludes="" includes="${javac.includes}" sourcepath="${src.dir}"/>
 12.1107 +        <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}, module-info.java" sourcepath="${src.dir}"/>
 12.1108      </target>
 12.1109      <target name="-post-compile-single">
 12.1110          <!-- Empty placeholder for easier customization. -->
 12.1111          <!-- You can override this target in the ../build.xml file. -->
 12.1112      </target>
 12.1113 -    <target depends="init,deps-jar,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
 12.1114 +    <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
 12.1115      <!--
 12.1116                  ====================
 12.1117                  JAR BUILDING SECTION
 12.1118 @@ -357,57 +1136,191 @@
 12.1119          <!-- Empty placeholder for easier customization. -->
 12.1120          <!-- You can override this target in the ../build.xml file. -->
 12.1121      </target>
 12.1122 -    <target depends="init,compile,-pre-pre-jar,-pre-jar" name="-do-jar-without-manifest" unless="manifest.available">
 12.1123 -        <j2seproject1:jar/>
 12.1124 +    <target depends="init,compile" name="-check-module-main-class">
 12.1125 +        <pathconvert property="main.class.file">
 12.1126 +            <string value="${main.class}"/>
 12.1127 +            <unpackagemapper from="*" to="*.class"/>
 12.1128 +        </pathconvert>
 12.1129 +        <condition property="do.module.main.class">
 12.1130 +            <and>
 12.1131 +                <isset property="main.class.available"/>
 12.1132 +                <available file="${build.classes.dir}/module-info.class"/>
 12.1133 +                <available file="${build.classes.dir}/${main.class.file}"/>
 12.1134 +                <isset property="libs.CopyLibs.classpath"/>
 12.1135 +                <available classname="org.netbeans.modules.java.j2seproject.moduletask.ModuleMainClass" classpath="${libs.CopyLibs.classpath}"/>
 12.1136 +            </and>
 12.1137 +        </condition>
 12.1138      </target>
 12.1139 -    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class">
 12.1140 -        <j2seproject1:jar manifest="${manifest.file}"/>
 12.1141 +    <target depends="-check-module-main-class" if="do.module.main.class" name="-set-module-main-class">
 12.1142 +        <taskdef classname="org.netbeans.modules.java.j2seproject.moduletask.ModuleMainClass" classpath="${libs.CopyLibs.classpath}" name="modulemainclass"/>
 12.1143 +        <modulemainclass failonerror="false" mainclass="${main.class}" moduleinfo="${build.classes.dir}/module-info.class"/>
 12.1144      </target>
 12.1145 -    <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">
 12.1146 -        <j2seproject1:jar manifest="${manifest.file}">
 12.1147 -            <j2seproject1:manifest>
 12.1148 -                <j2seproject1:attribute name="Main-Class" value="${main.class}"/>
 12.1149 -            </j2seproject1:manifest>
 12.1150 -        </j2seproject1:jar>
 12.1151 -        <echo>To run this application from the command line without Ant, try:</echo>
 12.1152 +    <target depends="init" if="do.archive" name="-do-jar-create-manifest" unless="manifest.available">
 12.1153 +        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
 12.1154 +        <touch file="${tmp.manifest.file}" verbose="false"/>
 12.1155 +    </target>
 12.1156 +    <target depends="init" if="do.archive+manifest.available" name="-do-jar-copy-manifest">
 12.1157 +        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
 12.1158 +        <copy encoding="${manifest.encoding}" file="${manifest.file}" outputencoding="UTF-8" tofile="${tmp.manifest.file}"/>
 12.1159 +    </target>
 12.1160 +    <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+main.class.available" name="-do-jar-set-mainclass">
 12.1161 +        <manifest encoding="UTF-8" file="${tmp.manifest.file}" mode="update">
 12.1162 +            <attribute name="Main-Class" value="${main.class}"/>
 12.1163 +        </manifest>
 12.1164 +    </target>
 12.1165 +    <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+profile.available" name="-do-jar-set-profile">
 12.1166 +        <manifest encoding="UTF-8" file="${tmp.manifest.file}" mode="update">
 12.1167 +            <attribute name="Profile" value="${javac.profile}"/>
 12.1168 +        </manifest>
 12.1169 +    </target>
 12.1170 +    <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+splashscreen.available" name="-do-jar-set-splashscreen">
 12.1171 +        <basename file="${application.splash}" property="splashscreen.basename"/>
 12.1172 +        <mkdir dir="${build.classes.dir}/META-INF"/>
 12.1173 +        <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
 12.1174 +        <manifest encoding="UTF-8" file="${tmp.manifest.file}" mode="update">
 12.1175 +            <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
 12.1176 +        </manifest>
 12.1177 +    </target>
 12.1178 +    <target depends="init,compile" name="-check-do-mkdist">
 12.1179 +        <condition property="do.mkdist">
 12.1180 +            <and>
 12.1181 +                <isset property="do.archive"/>
 12.1182 +                <isset property="libs.CopyLibs.classpath"/>
 12.1183 +                <not>
 12.1184 +                    <istrue value="${mkdist.disabled}"/>
 12.1185 +                </not>
 12.1186 +                <not>
 12.1187 +                    <available file="${build.classes.dir}/module-info.class"/>
 12.1188 +                </not>
 12.1189 +            </and>
 12.1190 +        </condition>
 12.1191 +    </target>
 12.1192 +    <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,-check-do-mkdist" if="do.mkdist" name="-do-jar-copylibs">
 12.1193 +        <j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
 12.1194 +        <echo level="info">To run this application from the command line without Ant, try:</echo>
 12.1195 +        <property location="${dist.jar}" name="dist.jar.resolved"/>
 12.1196 +        <echo level="info">java -jar "${dist.jar.resolved}"</echo>
 12.1197 +    </target>
 12.1198 +    <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,-check-do-mkdist" if="do.archive" name="-do-jar-jar" unless="do.mkdist">
 12.1199 +        <j2seproject1:jar manifest="${tmp.manifest.file}"/>
 12.1200          <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
 12.1201          <property location="${dist.jar}" name="dist.jar.resolved"/>
 12.1202 +        <condition else="${dist.jar.resolved}" property="jar.usage.message.class.path.replacement" value="">
 12.1203 +            <isset property="named.module.internal"/>
 12.1204 +        </condition>
 12.1205          <pathconvert property="run.classpath.with.dist.jar">
 12.1206              <path path="${run.classpath}"/>
 12.1207 +            <map from="${build.classes.dir.resolved}" to="${jar.usage.message.class.path.replacement}"/>
 12.1208 +        </pathconvert>
 12.1209 +        <pathconvert property="run.modulepath.with.dist.jar">
 12.1210 +            <path location="${dist.jar.resolved}"/>
 12.1211 +            <path path="${run.modulepath}"/>
 12.1212              <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
 12.1213          </pathconvert>
 12.1214 -        <echo>java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
 12.1215 +        <condition else="${run.modulepath}" property="jar.usage.message.run.modulepath.with.dist.jar" value="${run.modulepath.with.dist.jar}">
 12.1216 +            <isset property="named.module.internal"/>
 12.1217 +        </condition>
 12.1218 +        <condition else="" property="jar.usage.message.module.path" value=" -p ${jar.usage.message.run.modulepath.with.dist.jar}">
 12.1219 +            <and>
 12.1220 +                <isset property="modules.supported.internal"/>
 12.1221 +                <length length="0" string="${jar.usage.message.run.modulepath.with.dist.jar}" when="greater"/>
 12.1222 +            </and>
 12.1223 +        </condition>
 12.1224 +        <condition else="" property="jar.usage.message.class.path" value=" -cp ${run.classpath.with.dist.jar}">
 12.1225 +            <length length="0" string="${run.classpath.with.dist.jar}" when="greater"/>
 12.1226 +        </condition>
 12.1227 +        <condition else="/${main.class}" property="jar.usage.message.main.class.class.selector" value="">
 12.1228 +            <isset property="do.module.main.class"/>
 12.1229 +        </condition>
 12.1230 +        <condition else=" ${main.class}" property="jar.usage.message.main.class" value=" -m ${module.name}${jar.usage.message.main.class.class.selector}">
 12.1231 +            <isset property="named.module.internal"/>
 12.1232 +        </condition>
 12.1233 +        <condition else="" property="jar.usage.message" value="To run this application from the command line without Ant, try:${line.separator}${platform.java}${jar.usage.message.module.path}${jar.usage.message.class.path}${jar.usage.message.main.class}">
 12.1234 +            <isset property="main.class.available"/>
 12.1235 +        </condition>
 12.1236 +        <condition else="debug" property="jar.usage.level" value="info">
 12.1237 +            <isset property="main.class.available"/>
 12.1238 +        </condition>
 12.1239 +        <echo level="${jar.usage.level}" message="${jar.usage.message}"/>
 12.1240      </target>
 12.1241 -    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class+mkdist.available" name="-do-jar-with-libraries">
 12.1242 -        <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
 12.1243 -        <pathconvert property="run.classpath.without.build.classes.dir">
 12.1244 -            <path path="${run.classpath}"/>
 12.1245 -            <map from="${build.classes.dir.resolved}" to=""/>
 12.1246 -        </pathconvert>
 12.1247 -        <pathconvert pathsep=" " property="jar.classpath">
 12.1248 -            <path path="${run.classpath.without.build.classes.dir}"/>
 12.1249 -            <chainedmapper>
 12.1250 -                <flattenmapper/>
 12.1251 -                <globmapper from="*" to="lib/*"/>
 12.1252 -            </chainedmapper>
 12.1253 -        </pathconvert>
 12.1254 -        <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
 12.1255 -        <copylibs compress="${jar.compress}" jarfile="${dist.jar}" manifest="${manifest.file}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
 12.1256 -            <fileset dir="${build.classes.dir}"/>
 12.1257 -            <manifest>
 12.1258 -                <attribute name="Main-Class" value="${main.class}"/>
 12.1259 -                <attribute name="Class-Path" value="${jar.classpath}"/>
 12.1260 -            </manifest>
 12.1261 -        </copylibs>
 12.1262 -        <echo>To run this application from the command line without Ant, try:</echo>
 12.1263 -        <property location="${dist.jar}" name="dist.jar.resolved"/>
 12.1264 -        <echo>java -jar "${dist.jar.resolved}"</echo>
 12.1265 +    <target depends="-do-jar-copylibs" if="do.archive" name="-do-jar-delete-manifest">
 12.1266 +        <delete>
 12.1267 +            <fileset file="${tmp.manifest.file}"/>
 12.1268 +        </delete>
 12.1269      </target>
 12.1270 +    <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"/>
 12.1271 +    <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"/>
 12.1272      <target name="-post-jar">
 12.1273          <!-- Empty placeholder for easier customization. -->
 12.1274          <!-- You can override this target in the ../build.xml file. -->
 12.1275      </target>
 12.1276 -    <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"/>
 12.1277 +    <target depends="init,compile,-pre-jar,-set-module-main-class,-do-jar-without-libraries,-do-jar-with-libraries,-post-jar" name="-do-jar"/>
 12.1278 +    <target depends="init,compile,-pre-jar,-do-jar,-post-jar,deploy" description="Build JAR." name="jar"/>
 12.1279 +    <!--
 12.1280 +                =================
 12.1281 +                DEPLOY SECTION
 12.1282 +                =================
 12.1283 +            -->
 12.1284 +    <target name="-pre-deploy">
 12.1285 +        <!-- Empty placeholder for easier customization. -->
 12.1286 +        <!-- You can override this target in the ../build.xml file. -->
 12.1287 +    </target>
 12.1288 +    <target depends="init" name="-check-jlink">
 12.1289 +        <condition property="do.jlink.internal">
 12.1290 +            <and>
 12.1291 +                <istrue value="${do.jlink}"/>
 12.1292 +                <isset property="do.archive"/>
 12.1293 +                <isset property="named.module.internal"/>
 12.1294 +            </and>
 12.1295 +        </condition>
 12.1296 +    </target>
 12.1297 +    <target depends="init,-do-jar,-post-jar,-pre-deploy,-check-jlink" if="do.jlink.internal" name="-do-deploy">
 12.1298 +        <delete dir="${dist.jlink.dir}" failonerror="false" quiet="true"/>
 12.1299 +        <property name="jlink.launcher.name" value="${application.title}"/>
 12.1300 +        <condition else="${module.name}" property="jlink.add.modules" value="${module.name},${jlink.additionalmodules}">
 12.1301 +            <and>
 12.1302 +                <isset property="jlink.additionalmodules"/>
 12.1303 +                <length length="0" string="${jlink.additionalmodules}" when="greater"/>
 12.1304 +            </and>
 12.1305 +        </condition>
 12.1306 +        <condition property="jlink.do.strip.internal">
 12.1307 +            <and>
 12.1308 +                <isset property="jlink.strip"/>
 12.1309 +                <istrue value="${jlink.strip}"/>
 12.1310 +            </and>
 12.1311 +        </condition>
 12.1312 +        <condition property="jlink.do.additionalparam.internal">
 12.1313 +            <and>
 12.1314 +                <isset property="jlink.additionalparam"/>
 12.1315 +                <length length="0" string="${jlink.additionalparam}" when="greater"/>
 12.1316 +            </and>
 12.1317 +        </condition>
 12.1318 +        <condition property="jlink.do.launcher.internal">
 12.1319 +            <and>
 12.1320 +                <istrue value="${jlink.launcher}"/>
 12.1321 +                <isset property="main.class.available"/>
 12.1322 +            </and>
 12.1323 +        </condition>
 12.1324 +        <property name="platform.jlink" value="${jdk.home}/bin/jlink"/>
 12.1325 +        <property name="jlink.systemmodules.internal" value="${jdk.home}/jmods"/>
 12.1326 +        <exec executable="${platform.jlink}">
 12.1327 +            <arg value="--module-path"/>
 12.1328 +            <arg path="${jlink.systemmodules.internal}:${run.modulepath}:${dist.jar}"/>
 12.1329 +            <arg value="--add-modules"/>
 12.1330 +            <arg value="${jlink.add.modules}"/>
 12.1331 +            <arg if:set="jlink.do.strip.internal" value="--strip-debug"/>
 12.1332 +            <arg if:set="jlink.do.launcher.internal" value="--launcher"/>
 12.1333 +            <arg if:set="jlink.do.launcher.internal" value="${jlink.launcher.name}=${module.name}/${main.class}"/>
 12.1334 +            <arg if:set="jlink.do.additionalparam.internal" line="${jlink.additionalparam}"/>
 12.1335 +            <arg value="--output"/>
 12.1336 +            <arg value="${dist.jlink.output}"/>
 12.1337 +        </exec>
 12.1338 +    </target>
 12.1339 +    <target name="-post-deploy">
 12.1340 +        <!-- Empty placeholder for easier customization. -->
 12.1341 +        <!-- You can override this target in the ../build.xml file. -->
 12.1342 +    </target>
 12.1343 +    <target depends="-do-jar,-post-jar,-pre-deploy,-do-deploy,-post-deploy" name="deploy"/>
 12.1344      <!--
 12.1345                  =================
 12.1346                  EXECUTION SECTION
 12.1347 @@ -423,10 +1336,14 @@
 12.1348      <target name="-do-not-recompile">
 12.1349          <property name="javac.includes.binary" value=""/>
 12.1350      </target>
 12.1351 -    <target depends="init,-do-not-recompile,compile-single" name="run-single">
 12.1352 +    <target depends="init,compile-single" name="run-single">
 12.1353          <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
 12.1354          <j2seproject1:java classname="${run.class}"/>
 12.1355      </target>
 12.1356 +    <target depends="init,compile-test-single" name="run-test-with-main">
 12.1357 +        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
 12.1358 +        <j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
 12.1359 +    </target>
 12.1360      <!--
 12.1361                  =================
 12.1362                  DEBUGGING SECTION
 12.1363 @@ -435,11 +1352,14 @@
 12.1364      <target depends="init" if="netbeans.home" name="-debug-start-debugger">
 12.1365          <j2seproject1:nbjpdastart name="${debug.class}"/>
 12.1366      </target>
 12.1367 +    <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">
 12.1368 +        <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/>
 12.1369 +    </target>
 12.1370      <target depends="init,compile" name="-debug-start-debuggee">
 12.1371          <j2seproject3:debug>
 12.1372 -            <customize>
 12.1373 +            <customizeDebuggee>
 12.1374                  <arg line="${application.args}"/>
 12.1375 -            </customize>
 12.1376 +            </customizeDebuggee>
 12.1377          </j2seproject3:debug>
 12.1378      </target>
 12.1379      <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/>
 12.1380 @@ -451,7 +1371,12 @@
 12.1381          <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
 12.1382          <j2seproject3:debug classname="${debug.class}"/>
 12.1383      </target>
 12.1384 -    <target depends="init,-do-not-recompile,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
 12.1385 +    <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
 12.1386 +    <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
 12.1387 +        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
 12.1388 +        <j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
 12.1389 +    </target>
 12.1390 +    <target depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/>
 12.1391      <target depends="init" name="-pre-debug-fix">
 12.1392          <fail unless="fix.includes">Must set fix.includes</fail>
 12.1393          <property name="javac.includes" value="${fix.includes}.java"/>
 12.1394 @@ -461,20 +1386,146 @@
 12.1395      </target>
 12.1396      <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
 12.1397      <!--
 12.1398 +                =================
 12.1399 +                PROFILING SECTION
 12.1400 +                =================
 12.1401 +            -->
 12.1402 +    <!--
 12.1403 +                pre NB7.2 profiler integration
 12.1404 +            -->
 12.1405 +    <target depends="profile-init,compile" description="Profile a project in the IDE." if="profiler.info.jvmargs.agent" name="-profile-pre72">
 12.1406 +        <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
 12.1407 +        <nbprofiledirect>
 12.1408 +            <classpath>
 12.1409 +                <path path="${run.classpath}"/>
 12.1410 +            </classpath>
 12.1411 +        </nbprofiledirect>
 12.1412 +        <profile/>
 12.1413 +    </target>
 12.1414 +    <target depends="profile-init,compile-single" description="Profile a selected class in the IDE." if="profiler.info.jvmargs.agent" name="-profile-single-pre72">
 12.1415 +        <fail unless="profile.class">Must select one file in the IDE or set profile.class</fail>
 12.1416 +        <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
 12.1417 +        <nbprofiledirect>
 12.1418 +            <classpath>
 12.1419 +                <path path="${run.classpath}"/>
 12.1420 +            </classpath>
 12.1421 +        </nbprofiledirect>
 12.1422 +        <profile classname="${profile.class}"/>
 12.1423 +    </target>
 12.1424 +    <target depends="profile-init,compile-single" if="profiler.info.jvmargs.agent" name="-profile-applet-pre72">
 12.1425 +        <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
 12.1426 +        <nbprofiledirect>
 12.1427 +            <classpath>
 12.1428 +                <path path="${run.classpath}"/>
 12.1429 +            </classpath>
 12.1430 +        </nbprofiledirect>
 12.1431 +        <profile classname="sun.applet.AppletViewer">
 12.1432 +            <customize>
 12.1433 +                <arg value="${applet.url}"/>
 12.1434 +            </customize>
 12.1435 +        </profile>
 12.1436 +    </target>
 12.1437 +    <target depends="-init-macrodef-junit,profile-init,compile-test-single" if="profiler.info.jvmargs.agent" name="-profile-test-single-pre72">
 12.1438 +        <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
 12.1439 +        <nbprofiledirect>
 12.1440 +            <classpath>
 12.1441 +                <path path="${run.test.classpath}"/>
 12.1442 +            </classpath>
 12.1443 +        </nbprofiledirect>
 12.1444 +        <j2seproject3:junit excludes="${excludes}" includes="${includes}" testincludes="${profile.class}" testmethods="">
 12.1445 +            <customize>
 12.1446 +                <jvmarg value="-agentlib:jdwp=transport=${debug-transport},address=${jpda.address}"/>
 12.1447 +                <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
 12.1448 +                <jvmarg value="${profiler.info.jvmargs.agent}"/>
 12.1449 +                <jvmarg line="${profiler.info.jvmargs}"/>
 12.1450 +                <classpath>
 12.1451 +                    <path path="${run.test.classpath}"/>
 12.1452 +                </classpath>
 12.1453 +            </customize>
 12.1454 +        </j2seproject3:junit>
 12.1455 +    </target>
 12.1456 +    <!--
 12.1457 +                end of pre NB72 profiling section
 12.1458 +            -->
 12.1459 +    <target if="netbeans.home" name="-profile-check">
 12.1460 +        <condition property="profiler.configured">
 12.1461 +            <or>
 12.1462 +                <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-agentpath:"/>
 12.1463 +                <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-javaagent:"/>
 12.1464 +            </or>
 12.1465 +        </condition>
 12.1466 +    </target>
 12.1467 +    <target depends="-profile-check,-profile-pre72" description="Profile a project in the IDE." if="profiler.configured" name="profile" unless="profiler.info.jvmargs.agent">
 12.1468 +        <startprofiler/>
 12.1469 +        <antcall target="run"/>
 12.1470 +    </target>
 12.1471 +    <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">
 12.1472 +        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
 12.1473 +        <startprofiler/>
 12.1474 +        <antcall target="run-single"/>
 12.1475 +    </target>
 12.1476 +    <target depends="-profile-test-single-pre72" description="Profile a selected test in the IDE." name="profile-test-single"/>
 12.1477 +    <target depends="-profile-check" description="Profile a selected test in the IDE." if="profiler.configured" name="profile-test" unless="profiler.info.jvmargs">
 12.1478 +        <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
 12.1479 +        <startprofiler/>
 12.1480 +        <antcall target="test-single"/>
 12.1481 +    </target>
 12.1482 +    <target depends="-profile-check" description="Profile a selected class in the IDE." if="profiler.configured" name="profile-test-with-main">
 12.1483 +        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
 12.1484 +        <startprofiler/>
 12.1485 +        <antcall target="run-test-with-main"/>
 12.1486 +    </target>
 12.1487 +    <target depends="-profile-check,-profile-applet-pre72" if="profiler.configured" name="profile-applet" unless="profiler.info.jvmargs.agent">
 12.1488 +        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
 12.1489 +        <startprofiler/>
 12.1490 +        <antcall target="run-applet"/>
 12.1491 +    </target>
 12.1492 +    <!--
 12.1493                  ===============
 12.1494                  JAVADOC SECTION
 12.1495                  ===============
 12.1496              -->
 12.1497 -    <target depends="init" name="-javadoc-build">
 12.1498 +    <target depends="init" if="have.sources" name="-javadoc-build">
 12.1499          <mkdir dir="${dist.javadoc.dir}"/>
 12.1500 -        <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}">
 12.1501 +        <condition else="" property="javadoc.endorsed.classpath.cmd.line.arg" value="-J${endorsed.classpath.cmd.line.arg}">
 12.1502 +            <and>
 12.1503 +                <isset property="endorsed.classpath.cmd.line.arg"/>
 12.1504 +                <not>
 12.1505 +                    <equals arg1="${endorsed.classpath.cmd.line.arg}" arg2=""/>
 12.1506 +                </not>
 12.1507 +            </and>
 12.1508 +        </condition>
 12.1509 +        <condition else="" property="bug5101868workaround" value="*.java">
 12.1510 +            <matches pattern="1\.[56](\..*)?" string="${java.version}"/>
 12.1511 +        </condition>
 12.1512 +        <condition else="" property="javadoc.html5.cmd.line.arg" value="-html5">
 12.1513 +            <and>
 12.1514 +                <isset property="javadoc.html5"/>
 12.1515 +                <available file="${jdk.home}${file.separator}lib${file.separator}jrt-fs.jar"/>
 12.1516 +            </and>
 12.1517 +        </condition>
 12.1518 +        <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}">
 12.1519              <classpath>
 12.1520                  <path path="${javac.classpath}"/>
 12.1521              </classpath>
 12.1522 -            <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
 12.1523 +            <fileset dir="${src.dir}" excludes="${bug5101868workaround},${excludes}" includes="${includes}">
 12.1524                  <filename name="**/*.java"/>
 12.1525              </fileset>
 12.1526 +            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
 12.1527 +                <include name="**/*.java"/>
 12.1528 +                <exclude name="*.java"/>
 12.1529 +            </fileset>
 12.1530 +            <arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/>
 12.1531 +            <arg line="${javadoc.html5.cmd.line.arg}"/>
 12.1532          </javadoc>
 12.1533 +        <copy todir="${dist.javadoc.dir}">
 12.1534 +            <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
 12.1535 +                <filename name="**/doc-files/**"/>
 12.1536 +            </fileset>
 12.1537 +            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
 12.1538 +                <include name="**/doc-files/**"/>
 12.1539 +            </fileset>
 12.1540 +        </copy>
 12.1541      </target>
 12.1542      <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
 12.1543          <nbbrowse file="${dist.javadoc.dir}/index.html"/>
 12.1544 @@ -482,7 +1533,7 @@
 12.1545      <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
 12.1546      <!--
 12.1547                  =========================
 12.1548 -                JUNIT COMPILATION SECTION
 12.1549 +                TEST COMPILATION SECTION
 12.1550                  =========================
 12.1551              -->
 12.1552      <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
 12.1553 @@ -492,11 +1543,63 @@
 12.1554          <!-- Empty placeholder for easier customization. -->
 12.1555          <!-- You can override this target in the ../build.xml file. -->
 12.1556      </target>
 12.1557 +    <target depends="-init-source-module-properties" if="named.module.internal" name="-init-test-javac-module-properties-with-module">
 12.1558 +        <j2seproject3:modulename property="test.module.name" sourcepath="${test.src.dir}"/>
 12.1559 +        <condition else="${empty.dir}" property="javac.test.sourcepath" value="${test.src.dir}">
 12.1560 +            <and>
 12.1561 +                <isset property="test.module.name"/>
 12.1562 +                <length length="0" string="${test.module.name}" when="greater"/>
 12.1563 +            </and>
 12.1564 +        </condition>
 12.1565 +        <condition else="--patch-module ${module.name}=${test.src.dir} --add-reads ${module.name}=ALL-UNNAMED" property="javac.test.compilerargs" value="--add-reads ${test.module.name}=ALL-UNNAMED">
 12.1566 +            <and>
 12.1567 +                <isset property="test.module.name"/>
 12.1568 +                <length length="0" string="${test.module.name}" when="greater"/>
 12.1569 +            </and>
 12.1570 +        </condition>
 12.1571 +    </target>
 12.1572 +    <target depends="-init-source-module-properties" if="named.module.internal" name="-init-test-run-module-properties">
 12.1573 +        <condition else="${module.name}" property="run.test.addexport.source.module.internal" value="${test.module.name}">
 12.1574 +            <and>
 12.1575 +                <isset property="test.module.name"/>
 12.1576 +                <length length="0" string="${test.module.name}" when="greater"/>
 12.1577 +            </and>
 12.1578 +        </condition>
 12.1579 +        <fileset dir="${build.test.classes.dir}" id="run.test.packages.internal" includes="**/*.class"/>
 12.1580 +        <property location="${build.test.classes.dir}" name="build.test.classes.dir.abs.internal"/>
 12.1581 +        <pathconvert pathsep=" " property="run.test.addexports.internal" refid="run.test.packages.internal">
 12.1582 +            <chainedmapper>
 12.1583 +                <regexpmapper from="^(.*)\Q${file.separator}\E.*\.class$$" to="\1"/>
 12.1584 +                <filtermapper>
 12.1585 +                    <uniqfilter/>
 12.1586 +                    <replacestring from="${build.test.classes.dir.abs.internal}" to=""/>
 12.1587 +                </filtermapper>
 12.1588 +                <cutdirsmapper dirs="1"/>
 12.1589 +                <packagemapper from="*" to="--add-exports ${run.test.addexport.source.module.internal}/*=ALL-UNNAMED"/>
 12.1590 +            </chainedmapper>
 12.1591 +        </pathconvert>
 12.1592 +        <condition else="--patch-module ${module.name}=${build.test.classes.dir} --add-modules ${module.name} --add-reads ${module.name}=ALL-UNNAMED ${run.test.addexports.internal}" property="run.test.jvmargs" value="--add-modules ${test.module.name} --add-reads ${test.module.name}=ALL-UNNAMED ${run.test.addexports.internal}">
 12.1593 +            <and>
 12.1594 +                <isset property="test.module.name"/>
 12.1595 +                <length length="0" string="${test.module.name}" when="greater"/>
 12.1596 +            </and>
 12.1597 +        </condition>
 12.1598 +    </target>
 12.1599 +    <target depends="-init-source-module-properties" name="-init-test-module-properties-without-module" unless="named.module.internal">
 12.1600 +        <property name="javac.test.sourcepath" value="${empty.dir}"/>
 12.1601 +        <property name="javac.test.compilerargs" value=""/>
 12.1602 +        <property name="run.test.jvmargs" value=""/>
 12.1603 +    </target>
 12.1604 +    <target depends="-init-test-javac-module-properties-with-module,-init-test-module-properties-without-module" name="-init-test-module-properties"/>
 12.1605      <target if="do.depend.true" name="-compile-test-depend">
 12.1606          <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
 12.1607      </target>
 12.1608 -    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
 12.1609 -        <j2seproject3:javac classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
 12.1610 +    <target depends="init,deps-jar,compile,-init-test-module-properties,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
 12.1611 +        <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" modulepath="${javac.test.modulepath}" processorpath="${javac.test.processorpath}" sourcepath="${javac.test.sourcepath}" srcdir="${test.src.dir}">
 12.1612 +            <customize>
 12.1613 +                <compilerarg line="${javac.test.compilerargs}"/>
 12.1614 +            </customize>
 12.1615 +        </j2seproject3:javac>
 12.1616          <copy todir="${build.test.classes.dir}">
 12.1617              <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
 12.1618          </copy>
 12.1619 @@ -510,10 +1613,14 @@
 12.1620          <!-- Empty placeholder for easier customization. -->
 12.1621          <!-- You can override this target in the ../build.xml file. -->
 12.1622      </target>
 12.1623 -    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
 12.1624 +    <target depends="init,deps-jar,compile,-init-test-module-properties,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
 12.1625          <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
 12.1626          <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
 12.1627 -        <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}"/>
 12.1628 +        <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}, module-info.java" modulepath="${javac.test.modulepath}" processorpath="${javac.test.processorpath}" sourcepath="${test.src.dir}" srcdir="${test.src.dir}">
 12.1629 +            <customize>
 12.1630 +                <compilerarg line="${javac.test.compilerargs}"/>
 12.1631 +            </customize>
 12.1632 +        </j2seproject3:javac>
 12.1633          <copy todir="${build.test.classes.dir}">
 12.1634              <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
 12.1635          </copy>
 12.1636 @@ -525,17 +1632,17 @@
 12.1637      <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
 12.1638      <!--
 12.1639                  =======================
 12.1640 -                JUNIT EXECUTION SECTION
 12.1641 +                TEST EXECUTION SECTION
 12.1642                  =======================
 12.1643              -->
 12.1644      <target depends="init" if="have.tests" name="-pre-test-run">
 12.1645          <mkdir dir="${build.test.results.dir}"/>
 12.1646      </target>
 12.1647 -    <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
 12.1648 -        <j2seproject3:junit testincludes="**/*Test.java"/>
 12.1649 +    <target depends="init,compile-test,-init-test-run-module-properties,-pre-test-run" if="have.tests" name="-do-test-run">
 12.1650 +        <j2seproject3:test includes="${includes}" testincludes="**/*Test.java"/>
 12.1651      </target>
 12.1652      <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
 12.1653 -        <fail if="tests.failed">Some tests failed; see details above.</fail>
 12.1654 +        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
 12.1655      </target>
 12.1656      <target depends="init" if="have.tests" name="test-report"/>
 12.1657      <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
 12.1658 @@ -543,41 +1650,42 @@
 12.1659      <target depends="init" if="have.tests" name="-pre-test-run-single">
 12.1660          <mkdir dir="${build.test.results.dir}"/>
 12.1661      </target>
 12.1662 -    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
 12.1663 +    <target depends="init,compile-test-single,-init-test-run-module-properties,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
 12.1664          <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
 12.1665 -        <j2seproject3:junit excludes="" includes="${test.includes}"/>
 12.1666 +        <j2seproject3:test excludes="" includes="${test.includes}" testincludes="${test.includes}"/>
 12.1667      </target>
 12.1668      <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
 12.1669 -        <fail if="tests.failed">Some tests failed; see details above.</fail>
 12.1670 +        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
 12.1671      </target>
 12.1672 -    <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"/>
 12.1673 +    <target depends="init,compile-test-single,-init-test-run-module-properties,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/>
 12.1674 +    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single-method">
 12.1675 +        <fail unless="test.class">Must select some files in the IDE or set test.class</fail>
 12.1676 +        <fail unless="test.method">Must select some method in the IDE or set test.method</fail>
 12.1677 +        <j2seproject3:test excludes="" includes="${javac.includes}" testincludes="${test.class}" testmethods="${test.method}"/>
 12.1678 +    </target>
 12.1679 +    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single-method" if="have.tests" name="-post-test-run-single-method">
 12.1680 +        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
 12.1681 +    </target>
 12.1682 +    <target depends="init,compile-test-single,-init-test-run-module-properties,-pre-test-run-single,-do-test-run-single-method,-post-test-run-single-method" description="Run single unit test." name="test-single-method"/>
 12.1683      <!--
 12.1684                  =======================
 12.1685 -                JUNIT DEBUGGING SECTION
 12.1686 +                TEST DEBUGGING SECTION
 12.1687                  =======================
 12.1688              -->
 12.1689 -    <target depends="init,compile-test" if="have.tests" name="-debug-start-debuggee-test">
 12.1690 +    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test">
 12.1691          <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
 12.1692 -        <property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/>
 12.1693 -        <delete file="${test.report.file}"/>
 12.1694 -        <mkdir dir="${build.test.results.dir}"/>
 12.1695 -        <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}">
 12.1696 -            <customize>
 12.1697 -                <syspropertyset>
 12.1698 -                    <propertyref prefix="test-sys-prop."/>
 12.1699 -                    <mapper from="test-sys-prop.*" to="*" type="glob"/>
 12.1700 -                </syspropertyset>
 12.1701 -                <arg value="${test.class}"/>
 12.1702 -                <arg value="showoutput=true"/>
 12.1703 -                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/>
 12.1704 -                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/>
 12.1705 -            </customize>
 12.1706 -        </j2seproject3:debug>
 12.1707 +        <j2seproject3:test-debug excludes="" includes="${javac.includes}" testClass="${test.class}" testincludes="${javac.includes}"/>
 12.1708 +    </target>
 12.1709 +    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test-method">
 12.1710 +        <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
 12.1711 +        <fail unless="test.method">Must select some method in the IDE or set test.method</fail>
 12.1712 +        <j2seproject3:test-debug excludes="" includes="${javac.includes}" testClass="${test.class}" testMethod="${test.method}" testincludes=&q