samples/javabeans/nbproject/build-impl.xml
changeset 413 f11943a373a7
parent 102 461397695234
     1.1 --- a/samples/javabeans/nbproject/build-impl.xml	Sat Jun 14 09:54:22 2008 +0200
     1.2 +++ b/samples/javabeans/nbproject/build-impl.xml	Mon Nov 11 13:17:34 2019 +0100
     1.3 @@ -12,14 +12,21 @@
     1.4    - execution
     1.5    - debugging
     1.6    - javadoc
     1.7 -  - junit compilation
     1.8 -  - junit execution
     1.9 -  - junit debugging
    1.10 +  - test compilation
    1.11 +  - test execution
    1.12 +  - test debugging
    1.13    - applet
    1.14    - cleanup
    1.15  
    1.16          -->
    1.17 -<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns: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="javabeans-impl">
    1.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="javabeans-impl">
    1.19 +    <fail message="Please build using Ant 1.8.0 or higher.">
    1.20 +        <condition>
    1.21 +            <not>
    1.22 +                <antversion atleast="1.8.0"/>
    1.23 +            </not>
    1.24 +        </condition>
    1.25 +    </fail>
    1.26      <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
    1.27      <!-- 
    1.28                  ======================
    1.29 @@ -39,28 +46,136 @@
    1.30          <property file="${user.properties.file}"/>
    1.31          <!-- The two properties below are usually overridden -->
    1.32          <!-- by the active platform. Just a fallback. -->
    1.33 -        <property name="default.javac.source" value="1.4"/>
    1.34 -        <property name="default.javac.target" value="1.4"/>
    1.35 +        <property name="default.javac.source" value="1.6"/>
    1.36 +        <property name="default.javac.target" value="1.6"/>
    1.37      </target>
    1.38      <target depends="-pre-init,-init-private,-init-user" name="-init-project">
    1.39          <property file="nbproject/configs/${config}.properties"/>
    1.40          <property file="nbproject/project.properties"/>
    1.41      </target>
    1.42 -    <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init">
    1.43 +    <target name="-init-modules-supported">
    1.44 +        <condition property="modules.supported.internal" value="true">
    1.45 +            <not>
    1.46 +                <matches pattern="1\.[0-8](\..*)?" string="${javac.source}"/>
    1.47 +            </not>
    1.48 +        </condition>
    1.49 +    </target>
    1.50 +    <target depends="-init-modules-supported" if="modules.supported.internal" name="-init-macrodef-modulename">
    1.51 +        <macrodef name="modulename" uri="http://www.netbeans.org/ns/j2se-project/3">
    1.52 +            <attribute name="property"/>
    1.53 +            <attribute name="sourcepath"/>
    1.54 +            <sequential>
    1.55 +                <loadresource property="@{property}" quiet="true">
    1.56 +                    <javaresource classpath="@{sourcepath}" name="module-info.java" parentFirst="false"/>
    1.57 +                    <filterchain>
    1.58 +                        <stripjavacomments/>
    1.59 +                        <linecontainsregexp>
    1.60 +                            <regexp pattern="module .* \{"/>
    1.61 +                        </linecontainsregexp>
    1.62 +                        <tokenfilter>
    1.63 +                            <linetokenizer/>
    1.64 +                            <replaceregex flags="s" pattern="(\s*module\s+)(\S*)(\s*\{.*)" replace="\2"/>
    1.65 +                        </tokenfilter>
    1.66 +                        <striplinebreaks/>
    1.67 +                    </filterchain>
    1.68 +                </loadresource>
    1.69 +            </sequential>
    1.70 +        </macrodef>
    1.71 +    </target>
    1.72 +    <target depends="-init-modules-supported,-init-macrodef-modulename" if="modules.supported.internal" name="-init-source-module-properties">
    1.73 +        <fail message="Java 9 support requires Ant 1.10.0 or higher.">
    1.74 +            <condition>
    1.75 +                <not>
    1.76 +                    <antversion atleast="1.10.0"/>
    1.77 +                </not>
    1.78 +            </condition>
    1.79 +        </fail>
    1.80 +        <j2seproject3:modulename property="module.name" sourcepath="${src.dir}"/>
    1.81 +        <condition property="named.module.internal">
    1.82 +            <and>
    1.83 +                <isset property="module.name"/>
    1.84 +                <length length="0" string="${module.name}" when="greater"/>
    1.85 +            </and>
    1.86 +        </condition>
    1.87 +        <condition property="unnamed.module.internal">
    1.88 +            <not>
    1.89 +                <isset property="named.module.internal"/>
    1.90 +            </not>
    1.91 +        </condition>
    1.92 +        <property name="javac.modulepath" value=""/>
    1.93 +        <property name="run.modulepath" value="${javac.modulepath}"/>
    1.94 +        <property name="module.build.classes.dir" value="${build.classes.dir}"/>
    1.95 +        <property name="debug.modulepath" value="${run.modulepath}"/>
    1.96 +        <property name="javac.upgrademodulepath" value=""/>
    1.97 +        <property name="run.upgrademodulepath" value="${javac.upgrademodulepath}"/>
    1.98 +        <condition else="" property="javac.systemmodulepath.cmd.line.arg" value="--system '${javac.systemmodulepath}'">
    1.99 +            <and>
   1.100 +                <isset property="javac.systemmodulepath"/>
   1.101 +                <length length="0" string="${javac.systemmodulepath}" when="greater"/>
   1.102 +            </and>
   1.103 +        </condition>
   1.104 +        <property name="dist.jlink.dir" value="${dist.dir}/jlink"/>
   1.105 +        <property name="dist.jlink.output" value="${dist.jlink.dir}/${application.title}"/>
   1.106 +        <property name="module.name" value=""/>
   1.107 +    </target>
   1.108 +    <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property,-init-modules-supported" name="-do-init">
   1.109 +        <property name="platform.java" value="${java.home}/bin/java"/>
   1.110          <available file="${manifest.file}" property="manifest.available"/>
   1.111 -        <condition property="manifest.available+main.class">
   1.112 +        <condition property="splashscreen.available">
   1.113              <and>
   1.114 -                <isset property="manifest.available"/>
   1.115 +                <not>
   1.116 +                    <equals arg1="${application.splash}" arg2="" trim="true"/>
   1.117 +                </not>
   1.118 +                <available file="${application.splash}"/>
   1.119 +            </and>
   1.120 +        </condition>
   1.121 +        <condition property="main.class.available">
   1.122 +            <and>
   1.123                  <isset property="main.class"/>
   1.124                  <not>
   1.125                      <equals arg1="${main.class}" arg2="" trim="true"/>
   1.126                  </not>
   1.127              </and>
   1.128          </condition>
   1.129 -        <condition property="manifest.available+main.class+mkdist.available">
   1.130 +        <condition property="profile.available">
   1.131              <and>
   1.132 -                <istrue value="${manifest.available+main.class}"/>
   1.133 -                <isset property="libs.CopyLibs.classpath"/>
   1.134 +                <isset property="javac.profile"/>
   1.135 +                <length length="0" string="${javac.profile}" when="greater"/>
   1.136 +                <not>
   1.137 +                    <matches pattern="1\.[0-7](\..*)?" string="${javac.source}"/>
   1.138 +                </not>
   1.139 +            </and>
   1.140 +        </condition>
   1.141 +        <condition property="do.archive">
   1.142 +            <or>
   1.143 +                <not>
   1.144 +                    <istrue value="${jar.archive.disabled}"/>
   1.145 +                </not>
   1.146 +                <istrue value="${not.archive.disabled}"/>
   1.147 +            </or>
   1.148 +        </condition>
   1.149 +        <condition property="do.archive+manifest.available">
   1.150 +            <and>
   1.151 +                <isset property="manifest.available"/>
   1.152 +                <istrue value="${do.archive}"/>
   1.153 +            </and>
   1.154 +        </condition>
   1.155 +        <condition property="do.archive+main.class.available">
   1.156 +            <and>
   1.157 +                <isset property="main.class.available"/>
   1.158 +                <istrue value="${do.archive}"/>
   1.159 +            </and>
   1.160 +        </condition>
   1.161 +        <condition property="do.archive+splashscreen.available">
   1.162 +            <and>
   1.163 +                <isset property="splashscreen.available"/>
   1.164 +                <istrue value="${do.archive}"/>
   1.165 +            </and>
   1.166 +        </condition>
   1.167 +        <condition property="do.archive+profile.available">
   1.168 +            <and>
   1.169 +                <isset property="profile.available"/>
   1.170 +                <istrue value="${do.archive}"/>
   1.171              </and>
   1.172          </condition>
   1.173          <condition property="have.tests">
   1.174 @@ -86,6 +201,7 @@
   1.175              </and>
   1.176          </condition>
   1.177          <property name="run.jvmargs" value=""/>
   1.178 +        <property name="run.jvmargs.ide" value=""/>
   1.179          <property name="javac.compilerargs" value=""/>
   1.180          <property name="work.dir" value="${basedir}"/>
   1.181          <condition property="no.deps">
   1.182 @@ -97,6 +213,8 @@
   1.183          <property name="javadoc.preview" value="true"/>
   1.184          <property name="application.args" value=""/>
   1.185          <property name="source.encoding" value="${file.encoding}"/>
   1.186 +        <property name="runtime.encoding" value="${source.encoding}"/>
   1.187 +        <property name="manifest.encoding" value="${source.encoding}"/>
   1.188          <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
   1.189              <and>
   1.190                  <isset property="javadoc.encoding"/>
   1.191 @@ -112,12 +230,58 @@
   1.192          <condition property="do.depend.true">
   1.193              <istrue value="${do.depend}"/>
   1.194          </condition>
   1.195 -        <condition else="" property="javac.compilerargs.jaxws" value="-Djava.endorsed.dirs='${jaxws.endorsed.dir}'">
   1.196 +        <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
   1.197 +        <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
   1.198              <and>
   1.199 -                <isset property="jaxws.endorsed.dir"/>
   1.200 -                <available file="nbproject/jaxws-build.xml"/>
   1.201 +                <isset property="endorsed.classpath"/>
   1.202 +                <not>
   1.203 +                    <equals arg1="${endorsed.classpath}" arg2="" trim="true"/>
   1.204 +                </not>
   1.205              </and>
   1.206          </condition>
   1.207 +        <condition else="" property="javac.profile.cmd.line.arg" value="-profile ${javac.profile}">
   1.208 +            <isset property="profile.available"/>
   1.209 +        </condition>
   1.210 +        <condition else="false" property="jdkBug6558476">
   1.211 +            <and>
   1.212 +                <matches pattern="1\.[56]" string="${java.specification.version}"/>
   1.213 +                <not>
   1.214 +                    <os family="unix"/>
   1.215 +                </not>
   1.216 +            </and>
   1.217 +        </condition>
   1.218 +        <condition else="false" property="javac.fork">
   1.219 +            <or>
   1.220 +                <istrue value="${jdkBug6558476}"/>
   1.221 +                <istrue value="${javac.external.vm}"/>
   1.222 +            </or>
   1.223 +        </condition>
   1.224 +        <property name="jar.index" value="false"/>
   1.225 +        <property name="jar.index.metainf" value="${jar.index}"/>
   1.226 +        <property name="copylibs.rebase" value="true"/>
   1.227 +        <available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
   1.228 +        <condition property="junit.available">
   1.229 +            <or>
   1.230 +                <available classname="org.junit.Test" classpath="${run.test.classpath}"/>
   1.231 +                <available classname="junit.framework.Test" classpath="${run.test.classpath}"/>
   1.232 +            </or>
   1.233 +        </condition>
   1.234 +        <condition property="testng.available">
   1.235 +            <available classname="org.testng.annotations.Test" classpath="${run.test.classpath}"/>
   1.236 +        </condition>
   1.237 +        <condition property="junit+testng.available">
   1.238 +            <and>
   1.239 +                <istrue value="${junit.available}"/>
   1.240 +                <istrue value="${testng.available}"/>
   1.241 +            </and>
   1.242 +        </condition>
   1.243 +        <condition else="testng" property="testng.mode" value="mixed">
   1.244 +            <istrue value="${junit+testng.available}"/>
   1.245 +        </condition>
   1.246 +        <condition else="" property="testng.debug.mode" value="-mixed">
   1.247 +            <istrue value="${junit+testng.available}"/>
   1.248 +        </condition>
   1.249 +        <property name="java.failonerror" value="true"/>
   1.250      </target>
   1.251      <target name="-post-init">
   1.252          <!-- Empty placeholder for easier customization. -->
   1.253 @@ -144,26 +308,152 @@
   1.254              </sequential>
   1.255          </macrodef>
   1.256      </target>
   1.257 -    <target name="-init-macrodef-javac">
   1.258 +    <target depends="-init-ap-cmdline-properties,-init-source-module-properties" if="modules.supported.internal" name="-init-macrodef-javac-with-module">
   1.259          <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.260              <attribute default="${src.dir}" name="srcdir"/>
   1.261              <attribute default="${build.classes.dir}" name="destdir"/>
   1.262              <attribute default="${javac.classpath}" name="classpath"/>
   1.263 +            <attribute default="${javac.modulepath}" name="modulepath"/>
   1.264 +            <attribute default="${javac.upgrademodulepath}" name="upgrademodulepath"/>
   1.265 +            <attribute default="${javac.processorpath}" name="processorpath"/>
   1.266 +            <attribute default="${javac.processormodulepath}" name="processormodulepath"/>
   1.267 +            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
   1.268              <attribute default="${includes}" name="includes"/>
   1.269              <attribute default="${excludes}" name="excludes"/>
   1.270              <attribute default="${javac.debug}" name="debug"/>
   1.271 -            <attribute default="" name="sourcepath"/>
   1.272 +            <attribute default="${empty.dir}" name="sourcepath" unless:set="named.module.internal"/>
   1.273 +            <attribute default="${src.dir}" if:set="named.module.internal" name="sourcepath"/>
   1.274 +            <attribute default="${empty.dir}" name="gensrcdir"/>
   1.275              <element name="customize" optional="true"/>
   1.276              <sequential>
   1.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}">
   1.278 +                <condition property="warn.excludes.internal">
   1.279 +                    <and>
   1.280 +                        <isset property="named.module.internal"/>
   1.281 +                        <length length="0" string="@{excludes}" trim="true" when="greater"/>
   1.282 +                    </and>
   1.283 +                </condition>
   1.284 +                <echo if:set="warn.excludes.internal" level="warning" message="The javac excludes are not supported in the JDK 9 Named Module."/>
   1.285 +                <property location="${build.dir}/empty" name="empty.dir"/>
   1.286 +                <mkdir dir="${empty.dir}"/>
   1.287 +                <mkdir dir="@{apgeneratedsrcdir}"/>
   1.288 +                <condition property="processormodulepath.set">
   1.289 +                    <resourcecount count="0" when="greater">
   1.290 +                        <path>
   1.291 +                            <pathelement path="@{processormodulepath}"/>
   1.292 +                        </path>
   1.293 +                    </resourcecount>
   1.294 +                </condition>
   1.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}">
   1.296 +                    <src>
   1.297 +                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
   1.298 +                            <include name="*"/>
   1.299 +                        </dirset>
   1.300 +                    </src>
   1.301                      <classpath>
   1.302                          <path path="@{classpath}"/>
   1.303                      </classpath>
   1.304 -                    <compilerarg line="${javac.compilerargs} ${javac.compilerargs.jaxws}"/>
   1.305 +                    <modulepath>
   1.306 +                        <path path="@{modulepath}"/>
   1.307 +                    </modulepath>
   1.308 +                    <upgrademodulepath>
   1.309 +                        <path path="@{upgrademodulepath}"/>
   1.310 +                    </upgrademodulepath>
   1.311 +                    <compilerarg line="${javac.systemmodulepath.cmd.line.arg}"/>
   1.312 +                    <compilerarg line="${javac.profile.cmd.line.arg}"/>
   1.313 +                    <compilerarg line="${javac.compilerargs}"/>
   1.314 +                    <compilerarg if:set="processormodulepath.set" value="--processor-module-path"/>
   1.315 +                    <compilerarg if:set="processormodulepath.set" path="@{processormodulepath}"/>
   1.316 +                    <compilerarg unless:set="processormodulepath.set" value="-processorpath"/>
   1.317 +                    <compilerarg path="@{processorpath}:${empty.dir}" unless:set="processormodulepath.set"/>
   1.318 +                    <compilerarg line="${ap.processors.internal}"/>
   1.319 +                    <compilerarg line="${annotation.processing.processor.options}"/>
   1.320 +                    <compilerarg value="-s"/>
   1.321 +                    <compilerarg path="@{apgeneratedsrcdir}"/>
   1.322 +                    <compilerarg line="${ap.proc.none.internal}"/>
   1.323                      <customize/>
   1.324                  </javac>
   1.325              </sequential>
   1.326          </macrodef>
   1.327 +    </target>
   1.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">
   1.329 +        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.330 +            <attribute default="${src.dir}" name="srcdir"/>
   1.331 +            <attribute default="${build.classes.dir}" name="destdir"/>
   1.332 +            <attribute default="${javac.classpath}" name="classpath"/>
   1.333 +            <attribute default="${javac.modulepath}" name="modulepath"/>
   1.334 +            <attribute default="${javac.upgrademodulepath}" name="upgrademodulepath"/>
   1.335 +            <attribute default="${javac.processorpath}" name="processorpath"/>
   1.336 +            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
   1.337 +            <attribute default="${includes}" name="includes"/>
   1.338 +            <attribute default="${excludes}" name="excludes"/>
   1.339 +            <attribute default="${javac.debug}" name="debug"/>
   1.340 +            <attribute default="${empty.dir}" name="sourcepath"/>
   1.341 +            <attribute default="${empty.dir}" name="gensrcdir"/>
   1.342 +            <element name="customize" optional="true"/>
   1.343 +            <sequential>
   1.344 +                <property location="${build.dir}/empty" name="empty.dir"/>
   1.345 +                <mkdir dir="${empty.dir}"/>
   1.346 +                <mkdir dir="@{apgeneratedsrcdir}"/>
   1.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}">
   1.348 +                    <src>
   1.349 +                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
   1.350 +                            <include name="*"/>
   1.351 +                        </dirset>
   1.352 +                    </src>
   1.353 +                    <classpath>
   1.354 +                        <path path="@{classpath}"/>
   1.355 +                    </classpath>
   1.356 +                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
   1.357 +                    <compilerarg line="${javac.profile.cmd.line.arg}"/>
   1.358 +                    <compilerarg line="${javac.compilerargs}"/>
   1.359 +                    <compilerarg value="-processorpath"/>
   1.360 +                    <compilerarg path="@{processorpath}:${empty.dir}"/>
   1.361 +                    <compilerarg line="${ap.processors.internal}"/>
   1.362 +                    <compilerarg line="${annotation.processing.processor.options}"/>
   1.363 +                    <compilerarg value="-s"/>
   1.364 +                    <compilerarg path="@{apgeneratedsrcdir}"/>
   1.365 +                    <compilerarg line="${ap.proc.none.internal}"/>
   1.366 +                    <customize/>
   1.367 +                </javac>
   1.368 +            </sequential>
   1.369 +        </macrodef>
   1.370 +    </target>
   1.371 +    <target depends="-init-ap-cmdline-properties,-init-source-module-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
   1.372 +        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.373 +            <attribute default="${src.dir}" name="srcdir"/>
   1.374 +            <attribute default="${build.classes.dir}" name="destdir"/>
   1.375 +            <attribute default="${javac.classpath}" name="classpath"/>
   1.376 +            <attribute default="${javac.modulepath}" name="modulepath"/>
   1.377 +            <attribute default="${javac.upgrademodulepath}" name="upgrademodulepath"/>
   1.378 +            <attribute default="${javac.processorpath}" name="processorpath"/>
   1.379 +            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
   1.380 +            <attribute default="${includes}" name="includes"/>
   1.381 +            <attribute default="${excludes}" name="excludes"/>
   1.382 +            <attribute default="${javac.debug}" name="debug"/>
   1.383 +            <attribute default="${empty.dir}" name="sourcepath"/>
   1.384 +            <attribute default="${empty.dir}" name="gensrcdir"/>
   1.385 +            <element name="customize" optional="true"/>
   1.386 +            <sequential>
   1.387 +                <property location="${build.dir}/empty" name="empty.dir"/>
   1.388 +                <mkdir dir="${empty.dir}"/>
   1.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}">
   1.390 +                    <src>
   1.391 +                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
   1.392 +                            <include name="*"/>
   1.393 +                        </dirset>
   1.394 +                    </src>
   1.395 +                    <classpath>
   1.396 +                        <path path="@{classpath}"/>
   1.397 +                    </classpath>
   1.398 +                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
   1.399 +                    <compilerarg line="${javac.profile.cmd.line.arg}"/>
   1.400 +                    <compilerarg line="${javac.compilerargs}"/>
   1.401 +                    <customize/>
   1.402 +                </javac>
   1.403 +            </sequential>
   1.404 +        </macrodef>
   1.405 +    </target>
   1.406 +    <target depends="-init-macrodef-javac-with-module,-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
   1.407          <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.408              <attribute default="${src.dir}" name="srcdir"/>
   1.409              <attribute default="${build.classes.dir}" name="destdir"/>
   1.410 @@ -180,51 +470,383 @@
   1.411              <attribute default="${build.classes.dir}" name="destdir"/>
   1.412              <sequential>
   1.413                  <fail unless="javac.includes">Must set javac.includes</fail>
   1.414 -                <pathconvert pathsep="," property="javac.includes.binary">
   1.415 +                <pathconvert pathsep="${line.separator}" property="javac.includes.binary">
   1.416                      <path>
   1.417                          <filelist dir="@{destdir}" files="${javac.includes}"/>
   1.418                      </path>
   1.419                      <globmapper from="*.java" to="*.class"/>
   1.420                  </pathconvert>
   1.421 +                <tempfile deleteonexit="true" property="javac.includesfile.binary"/>
   1.422 +                <echo file="${javac.includesfile.binary}" message="${javac.includes.binary}"/>
   1.423                  <delete>
   1.424 -                    <files includes="${javac.includes.binary}"/>
   1.425 +                    <files includesfile="${javac.includesfile.binary}"/>
   1.426 +                </delete>
   1.427 +                <delete>
   1.428 +                    <fileset file="${javac.includesfile.binary}"/>
   1.429                  </delete>
   1.430              </sequential>
   1.431          </macrodef>
   1.432      </target>
   1.433 -    <target name="-init-macrodef-junit">
   1.434 +    <target if="${junit.available}" name="-init-macrodef-junit-init">
   1.435 +        <condition else="false" property="nb.junit.batch" value="true">
   1.436 +            <and>
   1.437 +                <istrue value="${junit.available}"/>
   1.438 +                <not>
   1.439 +                    <isset property="test.method"/>
   1.440 +                </not>
   1.441 +            </and>
   1.442 +        </condition>
   1.443 +        <condition else="false" property="nb.junit.single" value="true">
   1.444 +            <and>
   1.445 +                <istrue value="${junit.available}"/>
   1.446 +                <isset property="test.method"/>
   1.447 +            </and>
   1.448 +        </condition>
   1.449 +    </target>
   1.450 +    <target name="-init-test-properties">
   1.451 +        <property name="test.binaryincludes" value="&lt;nothing&gt;"/>
   1.452 +        <property name="test.binarytestincludes" value=""/>
   1.453 +        <property name="test.binaryexcludes" value=""/>
   1.454 +    </target>
   1.455 +    <target depends="-init-modules-supported" if="modules.supported.internal" name="-init-macrodef-junit-prototype-with-module">
   1.456 +        <macrodef name="junit-prototype" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.457 +            <attribute default="${includes}" name="includes"/>
   1.458 +            <attribute default="${excludes}" name="excludes"/>
   1.459 +            <element name="customizePrototype" optional="true"/>
   1.460 +            <sequential>
   1.461 +                <property name="junit.forkmode" value="perTest"/>
   1.462 +                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
   1.463 +                    <syspropertyset>
   1.464 +                        <propertyref prefix="test-sys-prop."/>
   1.465 +                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
   1.466 +                    </syspropertyset>
   1.467 +                    <classpath>
   1.468 +                        <path path="${run.test.classpath}"/>
   1.469 +                    </classpath>
   1.470 +                    <modulepath>
   1.471 +                        <path path="${run.test.modulepath}"/>
   1.472 +                    </modulepath>
   1.473 +                    <formatter type="brief" usefile="false"/>
   1.474 +                    <formatter type="xml"/>
   1.475 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   1.476 +                    <jvmarg value="-ea"/>
   1.477 +                    <jvmarg line="${run.test.jvmargs}"/>
   1.478 +                    <customizePrototype/>
   1.479 +                </junit>
   1.480 +            </sequential>
   1.481 +        </macrodef>
   1.482 +    </target>
   1.483 +    <target depends="-init-modules-supported" name="-init-macrodef-junit-prototype-without-module" unless="modules.supported.internal">
   1.484 +        <macrodef name="junit-prototype" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.485 +            <attribute default="${includes}" name="includes"/>
   1.486 +            <attribute default="${excludes}" name="excludes"/>
   1.487 +            <element name="customizePrototype" optional="true"/>
   1.488 +            <sequential>
   1.489 +                <property name="junit.forkmode" value="perTest"/>
   1.490 +                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
   1.491 +                    <syspropertyset>
   1.492 +                        <propertyref prefix="test-sys-prop."/>
   1.493 +                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
   1.494 +                    </syspropertyset>
   1.495 +                    <classpath>
   1.496 +                        <path path="${run.test.classpath}"/>
   1.497 +                    </classpath>
   1.498 +                    <formatter type="brief" usefile="false"/>
   1.499 +                    <formatter type="xml"/>
   1.500 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   1.501 +                    <jvmarg value="-ea"/>
   1.502 +                    <customizePrototype/>
   1.503 +                </junit>
   1.504 +            </sequential>
   1.505 +        </macrodef>
   1.506 +    </target>
   1.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}">
   1.508          <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.509              <attribute default="${includes}" name="includes"/>
   1.510              <attribute default="${excludes}" name="excludes"/>
   1.511              <attribute default="**" name="testincludes"/>
   1.512 +            <attribute default="" name="testmethods"/>
   1.513 +            <element name="customize" optional="true"/>
   1.514              <sequential>
   1.515 -                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true">
   1.516 -                    <batchtest todir="${build.test.results.dir}">
   1.517 -                        <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
   1.518 -                            <filename name="@{testincludes}"/>
   1.519 -                        </fileset>
   1.520 -                    </batchtest>
   1.521 +                <j2seproject3:junit-prototype>
   1.522 +                    <customizePrototype>
   1.523 +                        <test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/>
   1.524 +                        <customize/>
   1.525 +                    </customizePrototype>
   1.526 +                </j2seproject3:junit-prototype>
   1.527 +            </sequential>
   1.528 +        </macrodef>
   1.529 +    </target>
   1.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}">
   1.531 +        <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.532 +            <attribute default="${includes}" name="includes"/>
   1.533 +            <attribute default="${excludes}" name="excludes"/>
   1.534 +            <attribute default="**" name="testincludes"/>
   1.535 +            <attribute default="" name="testmethods"/>
   1.536 +            <element name="customize" optional="true"/>
   1.537 +            <sequential>
   1.538 +                <j2seproject3:junit-prototype>
   1.539 +                    <customizePrototype>
   1.540 +                        <batchtest todir="${build.test.results.dir}">
   1.541 +                            <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
   1.542 +                                <filename name="@{testincludes}"/>
   1.543 +                            </fileset>
   1.544 +                            <fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}">
   1.545 +                                <filename name="${test.binarytestincludes}"/>
   1.546 +                            </fileset>
   1.547 +                        </batchtest>
   1.548 +                        <customize/>
   1.549 +                    </customizePrototype>
   1.550 +                </j2seproject3:junit-prototype>
   1.551 +            </sequential>
   1.552 +        </macrodef>
   1.553 +    </target>
   1.554 +    <target depends="-init-macrodef-junit-init,-init-macrodef-junit-single, -init-macrodef-junit-batch" if="${junit.available}" name="-init-macrodef-junit"/>
   1.555 +    <target if="${testng.available}" name="-init-macrodef-testng">
   1.556 +        <macrodef name="testng" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.557 +            <attribute default="${includes}" name="includes"/>
   1.558 +            <attribute default="${excludes}" name="excludes"/>
   1.559 +            <attribute default="**" name="testincludes"/>
   1.560 +            <attribute default="" name="testmethods"/>
   1.561 +            <element name="customize" optional="true"/>
   1.562 +            <sequential>
   1.563 +                <condition else="" property="testng.methods.arg" value="@{testincludes}.@{testmethods}">
   1.564 +                    <isset property="test.method"/>
   1.565 +                </condition>
   1.566 +                <union id="test.set">
   1.567 +                    <fileset dir="${test.src.dir}" excludes="@{excludes},**/*.xml,${excludes}" includes="@{includes}">
   1.568 +                        <filename name="@{testincludes}"/>
   1.569 +                    </fileset>
   1.570 +                </union>
   1.571 +                <taskdef classname="org.testng.TestNGAntTask" classpath="${run.test.classpath}" name="testng"/>
   1.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="javabeans" testname="TestNG tests" workingDir="${work.dir}">
   1.573 +                    <xmlfileset dir="${build.test.classes.dir}" includes="@{testincludes}"/>
   1.574 +                    <propertyset>
   1.575 +                        <propertyref prefix="test-sys-prop."/>
   1.576 +                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
   1.577 +                    </propertyset>
   1.578                      <classpath>
   1.579                          <path path="${run.test.classpath}"/>
   1.580                      </classpath>
   1.581 -                    <syspropertyset>
   1.582 -                        <propertyref prefix="test-sys-prop."/>
   1.583 -                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
   1.584 -                    </syspropertyset>
   1.585 -                    <formatter type="brief" usefile="false"/>
   1.586 -                    <formatter type="xml"/>
   1.587 -                    <jvmarg line="${run.jvmargs}"/>
   1.588 -                </junit>
   1.589 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   1.590 +                    <customize/>
   1.591 +                </testng>
   1.592              </sequential>
   1.593          </macrodef>
   1.594      </target>
   1.595 -    <target name="-init-macrodef-nbjpda">
   1.596 +    <target name="-init-macrodef-test-impl">
   1.597 +        <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.598 +            <attribute default="${includes}" name="includes"/>
   1.599 +            <attribute default="${excludes}" name="excludes"/>
   1.600 +            <attribute default="**" name="testincludes"/>
   1.601 +            <attribute default="" name="testmethods"/>
   1.602 +            <element implicit="true" name="customize" optional="true"/>
   1.603 +            <sequential>
   1.604 +                <echo>No tests executed.</echo>
   1.605 +            </sequential>
   1.606 +        </macrodef>
   1.607 +    </target>
   1.608 +    <target depends="-init-macrodef-junit" if="${junit.available}" name="-init-macrodef-junit-impl">
   1.609 +        <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.610 +            <attribute default="${includes}" name="includes"/>
   1.611 +            <attribute default="${excludes}" name="excludes"/>
   1.612 +            <attribute default="**" name="testincludes"/>
   1.613 +            <attribute default="" name="testmethods"/>
   1.614 +            <element implicit="true" name="customize" optional="true"/>
   1.615 +            <sequential>
   1.616 +                <j2seproject3:junit excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
   1.617 +                    <customize/>
   1.618 +                </j2seproject3:junit>
   1.619 +            </sequential>
   1.620 +        </macrodef>
   1.621 +    </target>
   1.622 +    <target depends="-init-macrodef-testng" if="${testng.available}" name="-init-macrodef-testng-impl">
   1.623 +        <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.624 +            <attribute default="${includes}" name="includes"/>
   1.625 +            <attribute default="${excludes}" name="excludes"/>
   1.626 +            <attribute default="**" name="testincludes"/>
   1.627 +            <attribute default="" name="testmethods"/>
   1.628 +            <element implicit="true" name="customize" optional="true"/>
   1.629 +            <sequential>
   1.630 +                <j2seproject3:testng excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
   1.631 +                    <customize/>
   1.632 +                </j2seproject3:testng>
   1.633 +            </sequential>
   1.634 +        </macrodef>
   1.635 +    </target>
   1.636 +    <target depends="-init-macrodef-test-impl,-init-macrodef-junit-impl,-init-macrodef-testng-impl" name="-init-macrodef-test">
   1.637 +        <macrodef name="test" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.638 +            <attribute default="${includes}" name="includes"/>
   1.639 +            <attribute default="${excludes}" name="excludes"/>
   1.640 +            <attribute default="**" name="testincludes"/>
   1.641 +            <attribute default="" name="testmethods"/>
   1.642 +            <sequential>
   1.643 +                <j2seproject3:test-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
   1.644 +                    <customize>
   1.645 +                        <jvmarg line="${run.jvmargs}"/>
   1.646 +                        <jvmarg line="${run.jvmargs.ide}"/>
   1.647 +                    </customize>
   1.648 +                </j2seproject3:test-impl>
   1.649 +            </sequential>
   1.650 +        </macrodef>
   1.651 +    </target>
   1.652 +    <target depends="-init-macrodef-junit" if="${junit.available}" name="-init-macrodef-junit-debug-impl">
   1.653 +        <macrodef name="test-debug-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.654 +            <attribute default="${includes}" name="includes"/>
   1.655 +            <attribute default="${excludes}" name="excludes"/>
   1.656 +            <attribute default="**" name="testincludes"/>
   1.657 +            <attribute default="" name="testmethods"/>
   1.658 +            <element name="customizeDebuggee" optional="true"/>
   1.659 +            <sequential>
   1.660 +                <j2seproject3:junit excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
   1.661 +                    <customize>
   1.662 +                        <jvmarg value="-agentlib:jdwp=transport=${debug-transport},address=${jpda.address}"/>
   1.663 +                        <customizeDebuggee/>
   1.664 +                    </customize>
   1.665 +                </j2seproject3:junit>
   1.666 +            </sequential>
   1.667 +        </macrodef>
   1.668 +    </target>
   1.669 +    <target if="${testng.available}" name="-init-macrodef-testng-debug">
   1.670 +        <macrodef name="testng-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.671 +            <attribute default="${main.class}" name="testClass"/>
   1.672 +            <attribute default="" name="testMethod"/>
   1.673 +            <element name="customize2" optional="true"/>
   1.674 +            <sequential>
   1.675 +                <condition else="-testclass @{testClass}" property="test.class.or.method" value="-methods @{testClass}.@{testMethod}">
   1.676 +                    <isset property="test.method"/>
   1.677 +                </condition>
   1.678 +                <condition else="-suitename javabeans -testname @{testClass} ${test.class.or.method}" property="testng.cmd.args" value="@{testClass}">
   1.679 +                    <matches pattern=".*\.xml" string="@{testClass}"/>
   1.680 +                </condition>
   1.681 +                <delete dir="${build.test.results.dir}" quiet="true"/>
   1.682 +                <mkdir dir="${build.test.results.dir}"/>
   1.683 +                <j2seproject3:debug classname="org.testng.TestNG" classpath="${debug.test.classpath}">
   1.684 +                    <customizeDebuggee>
   1.685 +                        <customize2/>
   1.686 +                        <jvmarg value="-ea"/>
   1.687 +                        <arg line="${testng.debug.mode}"/>
   1.688 +                        <arg line="-d ${build.test.results.dir}"/>
   1.689 +                        <arg line="-listener org.testng.reporters.VerboseReporter"/>
   1.690 +                        <arg line="${testng.cmd.args}"/>
   1.691 +                    </customizeDebuggee>
   1.692 +                </j2seproject3:debug>
   1.693 +            </sequential>
   1.694 +        </macrodef>
   1.695 +    </target>
   1.696 +    <target depends="-init-macrodef-testng-debug" if="${testng.available}" name="-init-macrodef-testng-debug-impl">
   1.697 +        <macrodef name="testng-debug-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.698 +            <attribute default="${main.class}" name="testClass"/>
   1.699 +            <attribute default="" name="testMethod"/>
   1.700 +            <element implicit="true" name="customize2" optional="true"/>
   1.701 +            <sequential>
   1.702 +                <j2seproject3:testng-debug testClass="@{testClass}" testMethod="@{testMethod}">
   1.703 +                    <customize2/>
   1.704 +                </j2seproject3:testng-debug>
   1.705 +            </sequential>
   1.706 +        </macrodef>
   1.707 +    </target>
   1.708 +    <target depends="-init-macrodef-junit-debug-impl" if="${junit.available}" name="-init-macrodef-test-debug-junit">
   1.709 +        <macrodef name="test-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.710 +            <attribute default="${includes}" name="includes"/>
   1.711 +            <attribute default="${excludes}" name="excludes"/>
   1.712 +            <attribute default="**" name="testincludes"/>
   1.713 +            <attribute default="" name="testmethods"/>
   1.714 +            <attribute default="${main.class}" name="testClass"/>
   1.715 +            <attribute default="" name="testMethod"/>
   1.716 +            <sequential>
   1.717 +                <j2seproject3:test-debug-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
   1.718 +                    <customizeDebuggee>
   1.719 +                        <jvmarg line="${run.jvmargs}"/>
   1.720 +                        <jvmarg line="${run.jvmargs.ide}"/>
   1.721 +                    </customizeDebuggee>
   1.722 +                </j2seproject3:test-debug-impl>
   1.723 +            </sequential>
   1.724 +        </macrodef>
   1.725 +    </target>
   1.726 +    <target depends="-init-macrodef-testng-debug-impl" if="${testng.available}" name="-init-macrodef-test-debug-testng">
   1.727 +        <macrodef name="test-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.728 +            <attribute default="${includes}" name="includes"/>
   1.729 +            <attribute default="${excludes}" name="excludes"/>
   1.730 +            <attribute default="**" name="testincludes"/>
   1.731 +            <attribute default="" name="testmethods"/>
   1.732 +            <attribute default="${main.class}" name="testClass"/>
   1.733 +            <attribute default="" name="testMethod"/>
   1.734 +            <sequential>
   1.735 +                <j2seproject3:testng-debug-impl testClass="@{testClass}" testMethod="@{testMethod}">
   1.736 +                    <customize2>
   1.737 +                        <syspropertyset>
   1.738 +                            <propertyref prefix="test-sys-prop."/>
   1.739 +                            <mapper from="test-sys-prop.*" to="*" type="glob"/>
   1.740 +                        </syspropertyset>
   1.741 +                    </customize2>
   1.742 +                </j2seproject3:testng-debug-impl>
   1.743 +            </sequential>
   1.744 +        </macrodef>
   1.745 +    </target>
   1.746 +    <target depends="-init-macrodef-test-debug-junit,-init-macrodef-test-debug-testng" name="-init-macrodef-test-debug"/>
   1.747 +    <!--
   1.748 +                pre NB7.2 profiling section; consider it deprecated
   1.749 +            -->
   1.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"/>
   1.751 +    <target if="profiler.info.jvmargs.agent" name="-profile-pre-init">
   1.752 +        <!-- Empty placeholder for easier customization. -->
   1.753 +        <!-- You can override this target in the ../build.xml file. -->
   1.754 +    </target>
   1.755 +    <target if="profiler.info.jvmargs.agent" name="-profile-post-init">
   1.756 +        <!-- Empty placeholder for easier customization. -->
   1.757 +        <!-- You can override this target in the ../build.xml file. -->
   1.758 +    </target>
   1.759 +    <target if="profiler.info.jvmargs.agent" name="-profile-init-macrodef-profile">
   1.760 +        <macrodef name="resolve">
   1.761 +            <attribute name="name"/>
   1.762 +            <attribute name="value"/>
   1.763 +            <sequential>
   1.764 +                <property name="@{name}" value="${env.@{value}}"/>
   1.765 +            </sequential>
   1.766 +        </macrodef>
   1.767 +        <macrodef name="profile">
   1.768 +            <attribute default="${main.class}" name="classname"/>
   1.769 +            <element name="customize" optional="true"/>
   1.770 +            <sequential>
   1.771 +                <property environment="env"/>
   1.772 +                <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
   1.773 +                <java classname="@{classname}" dir="${profiler.info.dir}" failonerror="${java.failonerror}" fork="true" jvm="${profiler.info.jvm}">
   1.774 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   1.775 +                    <jvmarg value="${profiler.info.jvmargs.agent}"/>
   1.776 +                    <jvmarg line="${profiler.info.jvmargs}"/>
   1.777 +                    <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
   1.778 +                    <arg line="${application.args}"/>
   1.779 +                    <classpath>
   1.780 +                        <path path="${run.classpath}"/>
   1.781 +                    </classpath>
   1.782 +                    <syspropertyset>
   1.783 +                        <propertyref prefix="run-sys-prop."/>
   1.784 +                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
   1.785 +                    </syspropertyset>
   1.786 +                    <customize/>
   1.787 +                </java>
   1.788 +            </sequential>
   1.789 +        </macrodef>
   1.790 +    </target>
   1.791 +    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile" if="profiler.info.jvmargs.agent" name="-profile-init-check">
   1.792 +        <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail>
   1.793 +        <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
   1.794 +    </target>
   1.795 +    <!--
   1.796 +                end of pre NB7.2 profiling section
   1.797 +            -->
   1.798 +    <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
   1.799          <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
   1.800              <attribute default="${main.class}" name="name"/>
   1.801 +            <attribute default="${debug.modulepath}" name="modulepath"/>
   1.802              <attribute default="${debug.classpath}" name="classpath"/>
   1.803              <attribute default="" name="stopclassname"/>
   1.804              <sequential>
   1.805 -                <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="dt_socket">
   1.806 +                <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport}">
   1.807 +                    <modulepath>
   1.808 +                        <path path="@{modulepath}"/>
   1.809 +                    </modulepath>
   1.810                      <classpath>
   1.811                          <path path="@{classpath}"/>
   1.812                      </classpath>
   1.813 @@ -235,35 +857,120 @@
   1.814              <attribute default="${build.classes.dir}" name="dir"/>
   1.815              <sequential>
   1.816                  <nbjpdareload>
   1.817 -                    <fileset dir="@{dir}" includes="${fix.includes}*.class"/>
   1.818 +                    <fileset dir="@{dir}" includes="${fix.classes}">
   1.819 +                        <include name="${fix.includes}*.class"/>
   1.820 +                    </fileset>
   1.821                  </nbjpdareload>
   1.822              </sequential>
   1.823          </macrodef>
   1.824      </target>
   1.825      <target name="-init-debug-args">
   1.826 -        <property name="version-output" value="java version &quot;${ant.java.version}"/>
   1.827 -        <condition property="have-jdk-older-than-1.4">
   1.828 -            <or>
   1.829 -                <contains string="${version-output}" substring="java version &quot;1.0"/>
   1.830 -                <contains string="${version-output}" substring="java version &quot;1.1"/>
   1.831 -                <contains string="${version-output}" substring="java version &quot;1.2"/>
   1.832 -                <contains string="${version-output}" substring="java version &quot;1.3"/>
   1.833 -            </or>
   1.834 +        <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
   1.835 +            <os family="windows"/>
   1.836          </condition>
   1.837 -        <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
   1.838 -            <istrue value="${have-jdk-older-than-1.4}"/>
   1.839 +        <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}">
   1.840 +            <isset property="debug.transport"/>
   1.841          </condition>
   1.842      </target>
   1.843      <target depends="-init-debug-args" name="-init-macrodef-debug">
   1.844          <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.845 +            <attribute default="${module.name}" name="modulename"/>
   1.846              <attribute default="${main.class}" name="classname"/>
   1.847 +            <attribute default="${debug.modulepath}" name="modulepath"/>
   1.848              <attribute default="${debug.classpath}" name="classpath"/>
   1.849 +            <element name="customizeDebuggee" optional="true"/>
   1.850 +            <sequential>
   1.851 +                <j2seproject1:java classname="@{classname}" classpath="@{classpath}" modulename="@{modulename}" modulepath="@{modulepath}">
   1.852 +                    <customize>
   1.853 +                        <jvmarg value="-agentlib:jdwp=transport=${debug-transport},address=${jpda.address}"/>
   1.854 +                        <customizeDebuggee/>
   1.855 +                    </customize>
   1.856 +                </j2seproject1:java>
   1.857 +            </sequential>
   1.858 +        </macrodef>
   1.859 +    </target>
   1.860 +    <target depends="-init-source-module-properties" if="named.module.internal" name="-init-macrodef-java-with-module">
   1.861 +        <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
   1.862 +            <attribute default="${module.name}" name="modulename"/>
   1.863 +            <attribute default="${main.class}" name="classname"/>
   1.864 +            <attribute default="${run.modulepath}" name="modulepath"/>
   1.865 +            <attribute default="${run.upgrademodulepath}" name="upgrademodulepath"/>
   1.866 +            <attribute default="${run.classpath}" name="classpath"/>
   1.867 +            <attribute default="jvm" name="jvm"/>
   1.868              <element name="customize" optional="true"/>
   1.869              <sequential>
   1.870 -                <java classname="@{classname}" dir="${work.dir}" fork="true">
   1.871 -                    <jvmarg line="${debug-args-line}"/>
   1.872 -                    <jvmarg value="-Xrunjdwp:transport=dt_socket,address=${jpda.address}"/>
   1.873 +                <java classname="@{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true" module="@{modulename}">
   1.874 +                    <classpath>
   1.875 +                        <path path="@{classpath}"/>
   1.876 +                    </classpath>
   1.877 +                    <modulepath>
   1.878 +                        <pathelement path="@{modulepath}"/>
   1.879 +                        <pathelement location="${module.build.classes.dir}"/>
   1.880 +                    </modulepath>
   1.881 +                    <upgrademodulepath>
   1.882 +                        <path path="@{upgrademodulepath}"/>
   1.883 +                    </upgrademodulepath>
   1.884 +                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
   1.885 +                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
   1.886                      <jvmarg line="${run.jvmargs}"/>
   1.887 +                    <jvmarg line="${run.jvmargs.ide}"/>
   1.888 +                    <syspropertyset>
   1.889 +                        <propertyref prefix="run-sys-prop."/>
   1.890 +                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
   1.891 +                    </syspropertyset>
   1.892 +                    <customize/>
   1.893 +                </java>
   1.894 +            </sequential>
   1.895 +        </macrodef>
   1.896 +    </target>
   1.897 +    <target depends="-init-source-module-properties" if="unnamed.module.internal" name="-init-macrodef-java-with-unnamed-module">
   1.898 +        <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
   1.899 +            <attribute default="" name="modulename"/>
   1.900 +            <attribute default="${main.class}" name="classname"/>
   1.901 +            <attribute default="${run.modulepath}" name="modulepath"/>
   1.902 +            <attribute default="${run.upgrademodulepath}" name="upgrademodulepath"/>
   1.903 +            <attribute default="${run.classpath}" name="classpath"/>
   1.904 +            <attribute default="jvm" name="jvm"/>
   1.905 +            <element name="customize" optional="true"/>
   1.906 +            <sequential>
   1.907 +                <java classname="@{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true">
   1.908 +                    <classpath>
   1.909 +                        <path path="@{classpath}"/>
   1.910 +                    </classpath>
   1.911 +                    <modulepath>
   1.912 +                        <path path="@{modulepath}"/>
   1.913 +                    </modulepath>
   1.914 +                    <upgrademodulepath>
   1.915 +                        <path path="@{upgrademodulepath}"/>
   1.916 +                    </upgrademodulepath>
   1.917 +                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
   1.918 +                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
   1.919 +                    <jvmarg line="${run.jvmargs}"/>
   1.920 +                    <jvmarg line="${run.jvmargs.ide}"/>
   1.921 +                    <syspropertyset>
   1.922 +                        <propertyref prefix="run-sys-prop."/>
   1.923 +                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
   1.924 +                    </syspropertyset>
   1.925 +                    <customize/>
   1.926 +                </java>
   1.927 +            </sequential>
   1.928 +        </macrodef>
   1.929 +    </target>
   1.930 +    <target depends="-init-source-module-properties" name="-init-macrodef-java-without-module" unless="modules.supported.internal">
   1.931 +        <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
   1.932 +            <attribute default="" name="modulename"/>
   1.933 +            <attribute default="${main.class}" name="classname"/>
   1.934 +            <attribute default="" name="modulepath"/>
   1.935 +            <attribute default="${run.classpath}" name="classpath"/>
   1.936 +            <attribute default="jvm" name="jvm"/>
   1.937 +            <element name="customize" optional="true"/>
   1.938 +            <sequential>
   1.939 +                <java classname="@{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true">
   1.940 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   1.941 +                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
   1.942 +                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
   1.943 +                    <jvmarg line="${run.jvmargs}"/>
   1.944 +                    <jvmarg line="${run.jvmargs.ide}"/>
   1.945                      <classpath>
   1.946                          <path path="@{classpath}"/>
   1.947                      </classpath>
   1.948 @@ -276,39 +983,100 @@
   1.949              </sequential>
   1.950          </macrodef>
   1.951      </target>
   1.952 -    <target name="-init-macrodef-java">
   1.953 -        <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
   1.954 -            <attribute default="${main.class}" name="classname"/>
   1.955 +    <target depends="-init-macrodef-java-with-module, -init-macrodef-java-with-unnamed-module, -init-macrodef-java-without-module" name="-init-macrodef-java"/>
   1.956 +    <target name="-init-macrodef-copylibs">
   1.957 +        <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.958 +            <attribute default="${manifest.file}" name="manifest"/>
   1.959              <element name="customize" optional="true"/>
   1.960              <sequential>
   1.961 -                <java classname="@{classname}" dir="${work.dir}" fork="true">
   1.962 -                    <jvmarg line="${run.jvmargs}"/>
   1.963 -                    <classpath>
   1.964 -                        <path path="${run.classpath}"/>
   1.965 -                    </classpath>
   1.966 -                    <syspropertyset>
   1.967 -                        <propertyref prefix="run-sys-prop."/>
   1.968 -                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
   1.969 -                    </syspropertyset>
   1.970 -                    <customize/>
   1.971 -                </java>
   1.972 +                <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
   1.973 +                <pathconvert property="run.classpath.without.build.classes.dir">
   1.974 +                    <path path="${run.classpath}"/>
   1.975 +                    <map from="${build.classes.dir.resolved}" to=""/>
   1.976 +                </pathconvert>
   1.977 +                <pathconvert pathsep=" " property="jar.classpath">
   1.978 +                    <path path="${run.classpath.without.build.classes.dir}"/>
   1.979 +                    <chainedmapper>
   1.980 +                        <flattenmapper/>
   1.981 +                        <filtermapper>
   1.982 +                            <replacestring from=" " to="%20"/>
   1.983 +                        </filtermapper>
   1.984 +                        <globmapper from="*" to="lib/*"/>
   1.985 +                    </chainedmapper>
   1.986 +                </pathconvert>
   1.987 +                <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
   1.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}">
   1.989 +                    <fileset dir="${build.classes.dir}" excludes="${dist.archive.excludes}"/>
   1.990 +                    <manifest>
   1.991 +                        <attribute name="Class-Path" value="${jar.classpath}"/>
   1.992 +                        <customize/>
   1.993 +                    </manifest>
   1.994 +                </copylibs>
   1.995              </sequential>
   1.996          </macrodef>
   1.997      </target>
   1.998      <target name="-init-presetdef-jar">
   1.999          <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
  1.1000 -            <jar compress="${jar.compress}" jarfile="${dist.jar}">
  1.1001 -                <j2seproject1:fileset dir="${build.classes.dir}"/>
  1.1002 +            <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}" manifestencoding="UTF-8">
  1.1003 +                <j2seproject1:fileset dir="${build.classes.dir}" excludes="${dist.archive.excludes}"/>
  1.1004              </jar>
  1.1005          </presetdef>
  1.1006      </target>
  1.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"/>
  1.1008 +    <target name="-init-ap-cmdline-properties">
  1.1009 +        <property name="annotation.processing.enabled" value="true"/>
  1.1010 +        <property name="annotation.processing.processors.list" value=""/>
  1.1011 +        <property name="annotation.processing.processor.options" value=""/>
  1.1012 +        <property name="annotation.processing.run.all.processors" value="true"/>
  1.1013 +        <property name="javac.processorpath" value="${javac.classpath}"/>
  1.1014 +        <property name="javac.test.processorpath" value="${javac.test.classpath}"/>
  1.1015 +        <condition property="ap.supported.internal" value="true">
  1.1016 +            <not>
  1.1017 +                <matches pattern="1\.[0-5](\..*)?" string="${javac.source}"/>
  1.1018 +            </not>
  1.1019 +        </condition>
  1.1020 +    </target>
  1.1021 +    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-ap-cmdline-supported">
  1.1022 +        <condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}">
  1.1023 +            <isfalse value="${annotation.processing.run.all.processors}"/>
  1.1024 +        </condition>
  1.1025 +        <condition else="" property="ap.proc.none.internal" value="-proc:none">
  1.1026 +            <isfalse value="${annotation.processing.enabled}"/>
  1.1027 +        </condition>
  1.1028 +    </target>
  1.1029 +    <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline">
  1.1030 +        <property name="ap.cmd.line.internal" value=""/>
  1.1031 +    </target>
  1.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"/>
  1.1033      <!--
  1.1034                  ===================
  1.1035                  COMPILATION SECTION
  1.1036                  ===================
  1.1037              -->
  1.1038 -    <target depends="init" name="deps-jar" unless="no.deps"/>
  1.1039 +    <target name="-deps-jar-init" unless="built-jar.properties">
  1.1040 +        <property location="${build.dir}/built-jar.properties" name="built-jar.properties"/>
  1.1041 +        <delete file="${built-jar.properties}" quiet="true"/>
  1.1042 +    </target>
  1.1043 +    <target if="already.built.jar.${basedir}" name="-warn-already-built-jar">
  1.1044 +        <echo level="warn" message="Cycle detected: javabeans was already built"/>
  1.1045 +    </target>
  1.1046 +    <target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps">
  1.1047 +        <mkdir dir="${build.dir}"/>
  1.1048 +        <touch file="${built-jar.properties}" verbose="false"/>
  1.1049 +        <property file="${built-jar.properties}" prefix="already.built.jar."/>
  1.1050 +        <antcall target="-warn-already-built-jar"/>
  1.1051 +        <propertyfile file="${built-jar.properties}">
  1.1052 +            <entry key="${basedir}" value=""/>
  1.1053 +        </propertyfile>
  1.1054 +    </target>
  1.1055 +    <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
  1.1056 +    <target depends="init" name="-check-automatic-build">
  1.1057 +        <available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/>
  1.1058 +    </target>
  1.1059 +    <target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build">
  1.1060 +        <antcall target="clean">
  1.1061 +            <param name="no.dependencies" value="true"/>
  1.1062 +        </antcall>
  1.1063 +    </target>
  1.1064      <target depends="init,deps-jar" name="-pre-pre-compile">
  1.1065          <mkdir dir="${build.classes.dir}"/>
  1.1066      </target>
  1.1067 @@ -317,19 +1085,30 @@
  1.1068          <!-- You can override this target in the ../build.xml file. -->
  1.1069      </target>
  1.1070      <target if="do.depend.true" name="-compile-depend">
  1.1071 -        <j2seproject3:depend/>
  1.1072 +        <pathconvert property="build.generated.subdirs">
  1.1073 +            <dirset dir="${build.generated.sources.dir}" erroronmissingdir="false">
  1.1074 +                <include name="*"/>
  1.1075 +            </dirset>
  1.1076 +        </pathconvert>
  1.1077 +        <j2seproject3:depend srcdir="${src.dir}:${build.generated.subdirs}"/>
  1.1078      </target>
  1.1079 -    <target depends="init,deps-jar,-pre-pre-compile,-pre-compile,-compile-depend" if="have.sources" name="-do-compile">
  1.1080 -        <j2seproject3:javac/>
  1.1081 +    <target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile">
  1.1082 +        <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
  1.1083          <copy todir="${build.classes.dir}">
  1.1084              <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
  1.1085          </copy>
  1.1086      </target>
  1.1087 +    <target if="has.persistence.xml" name="-copy-persistence-xml">
  1.1088 +        <mkdir dir="${build.classes.dir}/META-INF"/>
  1.1089 +        <copy todir="${build.classes.dir}/META-INF">
  1.1090 +            <fileset dir="${meta.inf.dir}" includes="persistence.xml orm.xml"/>
  1.1091 +        </copy>
  1.1092 +    </target>
  1.1093      <target name="-post-compile">
  1.1094          <!-- Empty placeholder for easier customization. -->
  1.1095          <!-- You can override this target in the ../build.xml file. -->
  1.1096      </target>
  1.1097 -    <target depends="init,deps-jar,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
  1.1098 +    <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
  1.1099      <target name="-pre-compile-single">
  1.1100          <!-- Empty placeholder for easier customization. -->
  1.1101          <!-- You can override this target in the ../build.xml file. -->
  1.1102 @@ -337,13 +1116,13 @@
  1.1103      <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
  1.1104          <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
  1.1105          <j2seproject3:force-recompile/>
  1.1106 -        <j2seproject3:javac excludes="" includes="${javac.includes}" sourcepath="${src.dir}"/>
  1.1107 +        <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}, module-info.java" sourcepath="${src.dir}"/>
  1.1108      </target>
  1.1109      <target name="-post-compile-single">
  1.1110          <!-- Empty placeholder for easier customization. -->
  1.1111          <!-- You can override this target in the ../build.xml file. -->
  1.1112      </target>
  1.1113 -    <target depends="init,deps-jar,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
  1.1114 +    <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
  1.1115      <!--
  1.1116                  ====================
  1.1117                  JAR BUILDING SECTION
  1.1118 @@ -357,57 +1136,191 @@
  1.1119          <!-- Empty placeholder for easier customization. -->
  1.1120          <!-- You can override this target in the ../build.xml file. -->
  1.1121      </target>
  1.1122 -    <target depends="init,compile,-pre-pre-jar,-pre-jar" name="-do-jar-without-manifest" unless="manifest.available">
  1.1123 -        <j2seproject1:jar/>
  1.1124 +    <target depends="init,compile" name="-check-module-main-class">
  1.1125 +        <pathconvert property="main.class.file">
  1.1126 +            <string value="${main.class}"/>
  1.1127 +            <unpackagemapper from="*" to="*.class"/>
  1.1128 +        </pathconvert>
  1.1129 +        <condition property="do.module.main.class">
  1.1130 +            <and>
  1.1131 +                <isset property="main.class.available"/>
  1.1132 +                <available file="${build.classes.dir}/module-info.class"/>
  1.1133 +                <available file="${build.classes.dir}/${main.class.file}"/>
  1.1134 +                <isset property="libs.CopyLibs.classpath"/>
  1.1135 +                <available classname="org.netbeans.modules.java.j2seproject.moduletask.ModuleMainClass" classpath="${libs.CopyLibs.classpath}"/>
  1.1136 +            </and>
  1.1137 +        </condition>
  1.1138      </target>
  1.1139 -    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class">
  1.1140 -        <j2seproject1:jar manifest="${manifest.file}"/>
  1.1141 +    <target depends="-check-module-main-class" if="do.module.main.class" name="-set-module-main-class">
  1.1142 +        <taskdef classname="org.netbeans.modules.java.j2seproject.moduletask.ModuleMainClass" classpath="${libs.CopyLibs.classpath}" name="modulemainclass"/>
  1.1143 +        <modulemainclass failonerror="false" mainclass="${main.class}" moduleinfo="${build.classes.dir}/module-info.class"/>
  1.1144      </target>
  1.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">
  1.1146 -        <j2seproject1:jar manifest="${manifest.file}">
  1.1147 -            <j2seproject1:manifest>
  1.1148 -                <j2seproject1:attribute name="Main-Class" value="${main.class}"/>
  1.1149 -            </j2seproject1:manifest>
  1.1150 -        </j2seproject1:jar>
  1.1151 -        <echo>To run this application from the command line without Ant, try:</echo>
  1.1152 +    <target depends="init" if="do.archive" name="-do-jar-create-manifest" unless="manifest.available">
  1.1153 +        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
  1.1154 +        <touch file="${tmp.manifest.file}" verbose="false"/>
  1.1155 +    </target>
  1.1156 +    <target depends="init" if="do.archive+manifest.available" name="-do-jar-copy-manifest">
  1.1157 +        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
  1.1158 +        <copy encoding="${manifest.encoding}" file="${manifest.file}" outputencoding="UTF-8" tofile="${tmp.manifest.file}"/>
  1.1159 +    </target>
  1.1160 +    <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+main.class.available" name="-do-jar-set-mainclass">
  1.1161 +        <manifest encoding="UTF-8" file="${tmp.manifest.file}" mode="update">
  1.1162 +            <attribute name="Main-Class" value="${main.class}"/>
  1.1163 +        </manifest>
  1.1164 +    </target>
  1.1165 +    <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+profile.available" name="-do-jar-set-profile">
  1.1166 +        <manifest encoding="UTF-8" file="${tmp.manifest.file}" mode="update">
  1.1167 +            <attribute name="Profile" value="${javac.profile}"/>
  1.1168 +        </manifest>
  1.1169 +    </target>
  1.1170 +    <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+splashscreen.available" name="-do-jar-set-splashscreen">
  1.1171 +        <basename file="${application.splash}" property="splashscreen.basename"/>
  1.1172 +        <mkdir dir="${build.classes.dir}/META-INF"/>
  1.1173 +        <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
  1.1174 +        <manifest encoding="UTF-8" file="${tmp.manifest.file}" mode="update">
  1.1175 +            <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
  1.1176 +        </manifest>
  1.1177 +    </target>
  1.1178 +    <target depends="init,compile" name="-check-do-mkdist">
  1.1179 +        <condition property="do.mkdist">
  1.1180 +            <and>
  1.1181 +                <isset property="do.archive"/>
  1.1182 +                <isset property="libs.CopyLibs.classpath"/>
  1.1183 +                <not>
  1.1184 +                    <istrue value="${mkdist.disabled}"/>
  1.1185 +                </not>
  1.1186 +                <not>
  1.1187 +                    <available file="${build.classes.dir}/module-info.class"/>
  1.1188 +                </not>
  1.1189 +            </and>
  1.1190 +        </condition>
  1.1191 +    </target>
  1.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">
  1.1193 +        <j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
  1.1194 +        <echo level="info">To run this application from the command line without Ant, try:</echo>
  1.1195 +        <property location="${dist.jar}" name="dist.jar.resolved"/>
  1.1196 +        <echo level="info">java -jar "${dist.jar.resolved}"</echo>
  1.1197 +    </target>
  1.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">
  1.1199 +        <j2seproject1:jar manifest="${tmp.manifest.file}"/>
  1.1200          <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
  1.1201          <property location="${dist.jar}" name="dist.jar.resolved"/>
  1.1202 +        <condition else="${dist.jar.resolved}" property="jar.usage.message.class.path.replacement" value="">
  1.1203 +            <isset property="named.module.internal"/>
  1.1204 +        </condition>
  1.1205          <pathconvert property="run.classpath.with.dist.jar">
  1.1206              <path path="${run.classpath}"/>
  1.1207 +            <map from="${build.classes.dir.resolved}" to="${jar.usage.message.class.path.replacement}"/>
  1.1208 +        </pathconvert>
  1.1209 +        <pathconvert property="run.modulepath.with.dist.jar">
  1.1210 +            <path location="${dist.jar.resolved}"/>
  1.1211 +            <path path="${run.modulepath}"/>
  1.1212              <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
  1.1213          </pathconvert>
  1.1214 -        <echo>java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
  1.1215 +        <condition else="${run.modulepath}" property="jar.usage.message.run.modulepath.with.dist.jar" value="${run.modulepath.with.dist.jar}">
  1.1216 +            <isset property="named.module.internal"/>
  1.1217 +        </condition>
  1.1218 +        <condition else="" property="jar.usage.message.module.path" value=" -p ${jar.usage.message.run.modulepath.with.dist.jar}">
  1.1219 +            <and>
  1.1220 +                <isset property="modules.supported.internal"/>
  1.1221 +                <length length="0" string="${jar.usage.message.run.modulepath.with.dist.jar}" when="greater"/>
  1.1222 +            </and>
  1.1223 +        </condition>
  1.1224 +        <condition else="" property="jar.usage.message.class.path" value=" -cp ${run.classpath.with.dist.jar}">
  1.1225 +            <length length="0" string="${run.classpath.with.dist.jar}" when="greater"/>
  1.1226 +        </condition>
  1.1227 +        <condition else="/${main.class}" property="jar.usage.message.main.class.class.selector" value="">
  1.1228 +            <isset property="do.module.main.class"/>
  1.1229 +        </condition>
  1.1230 +        <condition else=" ${main.class}" property="jar.usage.message.main.class" value=" -m ${module.name}${jar.usage.message.main.class.class.selector}">
  1.1231 +            <isset property="named.module.internal"/>
  1.1232 +        </condition>
  1.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}">
  1.1234 +            <isset property="main.class.available"/>
  1.1235 +        </condition>
  1.1236 +        <condition else="debug" property="jar.usage.level" value="info">
  1.1237 +            <isset property="main.class.available"/>
  1.1238 +        </condition>
  1.1239 +        <echo level="${jar.usage.level}" message="${jar.usage.message}"/>
  1.1240      </target>
  1.1241 -    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class+mkdist.available" name="-do-jar-with-libraries">
  1.1242 -        <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
  1.1243 -        <pathconvert property="run.classpath.without.build.classes.dir">
  1.1244 -            <path path="${run.classpath}"/>
  1.1245 -            <map from="${build.classes.dir.resolved}" to=""/>
  1.1246 -        </pathconvert>
  1.1247 -        <pathconvert pathsep=" " property="jar.classpath">
  1.1248 -            <path path="${run.classpath.without.build.classes.dir}"/>
  1.1249 -            <chainedmapper>
  1.1250 -                <flattenmapper/>
  1.1251 -                <globmapper from="*" to="lib/*"/>
  1.1252 -            </chainedmapper>
  1.1253 -        </pathconvert>
  1.1254 -        <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
  1.1255 -        <copylibs compress="${jar.compress}" jarfile="${dist.jar}" manifest="${manifest.file}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
  1.1256 -            <fileset dir="${build.classes.dir}"/>
  1.1257 -            <manifest>
  1.1258 -                <attribute name="Main-Class" value="${main.class}"/>
  1.1259 -                <attribute name="Class-Path" value="${jar.classpath}"/>
  1.1260 -            </manifest>
  1.1261 -        </copylibs>
  1.1262 -        <echo>To run this application from the command line without Ant, try:</echo>
  1.1263 -        <property location="${dist.jar}" name="dist.jar.resolved"/>
  1.1264 -        <echo>java -jar "${dist.jar.resolved}"</echo>
  1.1265 +    <target depends="-do-jar-copylibs" if="do.archive" name="-do-jar-delete-manifest">
  1.1266 +        <delete>
  1.1267 +            <fileset file="${tmp.manifest.file}"/>
  1.1268 +        </delete>
  1.1269      </target>
  1.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"/>
  1.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"/>
  1.1272      <target name="-post-jar">
  1.1273          <!-- Empty placeholder for easier customization. -->
  1.1274          <!-- You can override this target in the ../build.xml file. -->
  1.1275      </target>
  1.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"/>
  1.1277 +    <target depends="init,compile,-pre-jar,-set-module-main-class,-do-jar-without-libraries,-do-jar-with-libraries,-post-jar" name="-do-jar"/>
  1.1278 +    <target depends="init,compile,-pre-jar,-do-jar,-post-jar,deploy" description="Build JAR." name="jar"/>
  1.1279 +    <!--
  1.1280 +                =================
  1.1281 +                DEPLOY SECTION
  1.1282 +                =================
  1.1283 +            -->
  1.1284 +    <target name="-pre-deploy">
  1.1285 +        <!-- Empty placeholder for easier customization. -->
  1.1286 +        <!-- You can override this target in the ../build.xml file. -->
  1.1287 +    </target>
  1.1288 +    <target depends="init" name="-check-jlink">
  1.1289 +        <condition property="do.jlink.internal">
  1.1290 +            <and>
  1.1291 +                <istrue value="${do.jlink}"/>
  1.1292 +                <isset property="do.archive"/>
  1.1293 +                <isset property="named.module.internal"/>
  1.1294 +            </and>
  1.1295 +        </condition>
  1.1296 +    </target>
  1.1297 +    <target depends="init,-do-jar,-post-jar,-pre-deploy,-check-jlink" if="do.jlink.internal" name="-do-deploy">
  1.1298 +        <delete dir="${dist.jlink.dir}" failonerror="false" quiet="true"/>
  1.1299 +        <property name="jlink.launcher.name" value="${application.title}"/>
  1.1300 +        <condition else="${module.name}" property="jlink.add.modules" value="${module.name},${jlink.additionalmodules}">
  1.1301 +            <and>
  1.1302 +                <isset property="jlink.additionalmodules"/>
  1.1303 +                <length length="0" string="${jlink.additionalmodules}" when="greater"/>
  1.1304 +            </and>
  1.1305 +        </condition>
  1.1306 +        <condition property="jlink.do.strip.internal">
  1.1307 +            <and>
  1.1308 +                <isset property="jlink.strip"/>
  1.1309 +                <istrue value="${jlink.strip}"/>
  1.1310 +            </and>
  1.1311 +        </condition>
  1.1312 +        <condition property="jlink.do.additionalparam.internal">
  1.1313 +            <and>
  1.1314 +                <isset property="jlink.additionalparam"/>
  1.1315 +                <length length="0" string="${jlink.additionalparam}" when="greater"/>
  1.1316 +            </and>
  1.1317 +        </condition>
  1.1318 +        <condition property="jlink.do.launcher.internal">
  1.1319 +            <and>
  1.1320 +                <istrue value="${jlink.launcher}"/>
  1.1321 +                <isset property="main.class.available"/>
  1.1322 +            </and>
  1.1323 +        </condition>
  1.1324 +        <property name="platform.jlink" value="${jdk.home}/bin/jlink"/>
  1.1325 +        <property name="jlink.systemmodules.internal" value="${jdk.home}/jmods"/>
  1.1326 +        <exec executable="${platform.jlink}">
  1.1327 +            <arg value="--module-path"/>
  1.1328 +            <arg path="${jlink.systemmodules.internal}:${run.modulepath}:${dist.jar}"/>
  1.1329 +            <arg value="--add-modules"/>
  1.1330 +            <arg value="${jlink.add.modules}"/>
  1.1331 +            <arg if:set="jlink.do.strip.internal" value="--strip-debug"/>
  1.1332 +            <arg if:set="jlink.do.launcher.internal" value="--launcher"/>
  1.1333 +            <arg if:set="jlink.do.launcher.internal" value="${jlink.launcher.name}=${module.name}/${main.class}"/>
  1.1334 +            <arg if:set="jlink.do.additionalparam.internal" line="${jlink.additionalparam}"/>
  1.1335 +            <arg value="--output"/>
  1.1336 +            <arg value="${dist.jlink.output}"/>
  1.1337 +        </exec>
  1.1338 +    </target>
  1.1339 +    <target name="-post-deploy">
  1.1340 +        <!-- Empty placeholder for easier customization. -->
  1.1341 +        <!-- You can override this target in the ../build.xml file. -->
  1.1342 +    </target>
  1.1343 +    <target depends="-do-jar,-post-jar,-pre-deploy,-do-deploy,-post-deploy" name="deploy"/>
  1.1344      <!--
  1.1345                  =================
  1.1346                  EXECUTION SECTION
  1.1347 @@ -423,10 +1336,14 @@
  1.1348      <target name="-do-not-recompile">
  1.1349          <property name="javac.includes.binary" value=""/>
  1.1350      </target>
  1.1351 -    <target depends="init,-do-not-recompile,compile-single" name="run-single">
  1.1352 +    <target depends="init,compile-single" name="run-single">
  1.1353          <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
  1.1354          <j2seproject1:java classname="${run.class}"/>
  1.1355      </target>
  1.1356 +    <target depends="init,compile-test-single" name="run-test-with-main">
  1.1357 +        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
  1.1358 +        <j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
  1.1359 +    </target>
  1.1360      <!--
  1.1361                  =================
  1.1362                  DEBUGGING SECTION
  1.1363 @@ -435,11 +1352,14 @@
  1.1364      <target depends="init" if="netbeans.home" name="-debug-start-debugger">
  1.1365          <j2seproject1:nbjpdastart name="${debug.class}"/>
  1.1366      </target>
  1.1367 +    <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">
  1.1368 +        <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/>
  1.1369 +    </target>
  1.1370      <target depends="init,compile" name="-debug-start-debuggee">
  1.1371          <j2seproject3:debug>
  1.1372 -            <customize>
  1.1373 +            <customizeDebuggee>
  1.1374                  <arg line="${application.args}"/>
  1.1375 -            </customize>
  1.1376 +            </customizeDebuggee>
  1.1377          </j2seproject3:debug>
  1.1378      </target>
  1.1379      <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/>
  1.1380 @@ -451,7 +1371,12 @@
  1.1381          <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
  1.1382          <j2seproject3:debug classname="${debug.class}"/>
  1.1383      </target>
  1.1384 -    <target depends="init,-do-not-recompile,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
  1.1385 +    <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
  1.1386 +    <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
  1.1387 +        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
  1.1388 +        <j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
  1.1389 +    </target>
  1.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"/>
  1.1391      <target depends="init" name="-pre-debug-fix">
  1.1392          <fail unless="fix.includes">Must set fix.includes</fail>
  1.1393          <property name="javac.includes" value="${fix.includes}.java"/>
  1.1394 @@ -461,20 +1386,146 @@
  1.1395      </target>
  1.1396      <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
  1.1397      <!--
  1.1398 +                =================
  1.1399 +                PROFILING SECTION
  1.1400 +                =================
  1.1401 +            -->
  1.1402 +    <!--
  1.1403 +                pre NB7.2 profiler integration
  1.1404 +            -->
  1.1405 +    <target depends="profile-init,compile" description="Profile a project in the IDE." if="profiler.info.jvmargs.agent" name="-profile-pre72">
  1.1406 +        <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
  1.1407 +        <nbprofiledirect>
  1.1408 +            <classpath>
  1.1409 +                <path path="${run.classpath}"/>
  1.1410 +            </classpath>
  1.1411 +        </nbprofiledirect>
  1.1412 +        <profile/>
  1.1413 +    </target>
  1.1414 +    <target depends="profile-init,compile-single" description="Profile a selected class in the IDE." if="profiler.info.jvmargs.agent" name="-profile-single-pre72">
  1.1415 +        <fail unless="profile.class">Must select one file in the IDE or set profile.class</fail>
  1.1416 +        <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
  1.1417 +        <nbprofiledirect>
  1.1418 +            <classpath>
  1.1419 +                <path path="${run.classpath}"/>
  1.1420 +            </classpath>
  1.1421 +        </nbprofiledirect>
  1.1422 +        <profile classname="${profile.class}"/>
  1.1423 +    </target>
  1.1424 +    <target depends="profile-init,compile-single" if="profiler.info.jvmargs.agent" name="-profile-applet-pre72">
  1.1425 +        <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
  1.1426 +        <nbprofiledirect>
  1.1427 +            <classpath>
  1.1428 +                <path path="${run.classpath}"/>
  1.1429 +            </classpath>
  1.1430 +        </nbprofiledirect>
  1.1431 +        <profile classname="sun.applet.AppletViewer">
  1.1432 +            <customize>
  1.1433 +                <arg value="${applet.url}"/>
  1.1434 +            </customize>
  1.1435 +        </profile>
  1.1436 +    </target>
  1.1437 +    <target depends="-init-macrodef-junit,profile-init,compile-test-single" if="profiler.info.jvmargs.agent" name="-profile-test-single-pre72">
  1.1438 +        <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
  1.1439 +        <nbprofiledirect>
  1.1440 +            <classpath>
  1.1441 +                <path path="${run.test.classpath}"/>
  1.1442 +            </classpath>
  1.1443 +        </nbprofiledirect>
  1.1444 +        <j2seproject3:junit excludes="${excludes}" includes="${includes}" testincludes="${profile.class}" testmethods="">
  1.1445 +            <customize>
  1.1446 +                <jvmarg value="-agentlib:jdwp=transport=${debug-transport},address=${jpda.address}"/>
  1.1447 +                <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
  1.1448 +                <jvmarg value="${profiler.info.jvmargs.agent}"/>
  1.1449 +                <jvmarg line="${profiler.info.jvmargs}"/>
  1.1450 +                <classpath>
  1.1451 +                    <path path="${run.test.classpath}"/>
  1.1452 +                </classpath>
  1.1453 +            </customize>
  1.1454 +        </j2seproject3:junit>
  1.1455 +    </target>
  1.1456 +    <!--
  1.1457 +                end of pre NB72 profiling section
  1.1458 +            -->
  1.1459 +    <target if="netbeans.home" name="-profile-check">
  1.1460 +        <condition property="profiler.configured">
  1.1461 +            <or>
  1.1462 +                <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-agentpath:"/>
  1.1463 +                <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-javaagent:"/>
  1.1464 +            </or>
  1.1465 +        </condition>
  1.1466 +    </target>
  1.1467 +    <target depends="-profile-check,-profile-pre72" description="Profile a project in the IDE." if="profiler.configured" name="profile" unless="profiler.info.jvmargs.agent">
  1.1468 +        <startprofiler/>
  1.1469 +        <antcall target="run"/>
  1.1470 +    </target>
  1.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">
  1.1472 +        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
  1.1473 +        <startprofiler/>
  1.1474 +        <antcall target="run-single"/>
  1.1475 +    </target>
  1.1476 +    <target depends="-profile-test-single-pre72" description="Profile a selected test in the IDE." name="profile-test-single"/>
  1.1477 +    <target depends="-profile-check" description="Profile a selected test in the IDE." if="profiler.configured" name="profile-test" unless="profiler.info.jvmargs">
  1.1478 +        <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
  1.1479 +        <startprofiler/>
  1.1480 +        <antcall target="test-single"/>
  1.1481 +    </target>
  1.1482 +    <target depends="-profile-check" description="Profile a selected class in the IDE." if="profiler.configured" name="profile-test-with-main">
  1.1483 +        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
  1.1484 +        <startprofiler/>
  1.1485 +        <antcall target="run-test-with-main"/>
  1.1486 +    </target>
  1.1487 +    <target depends="-profile-check,-profile-applet-pre72" if="profiler.configured" name="profile-applet" unless="profiler.info.jvmargs.agent">
  1.1488 +        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
  1.1489 +        <startprofiler/>
  1.1490 +        <antcall target="run-applet"/>
  1.1491 +    </target>
  1.1492 +    <!--
  1.1493                  ===============
  1.1494                  JAVADOC SECTION
  1.1495                  ===============
  1.1496              -->
  1.1497 -    <target depends="init" name="-javadoc-build">
  1.1498 +    <target depends="init" if="have.sources" name="-javadoc-build">
  1.1499          <mkdir dir="${dist.javadoc.dir}"/>
  1.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}">
  1.1501 +        <condition else="" property="javadoc.endorsed.classpath.cmd.line.arg" value="-J${endorsed.classpath.cmd.line.arg}">
  1.1502 +            <and>
  1.1503 +                <isset property="endorsed.classpath.cmd.line.arg"/>
  1.1504 +                <not>
  1.1505 +                    <equals arg1="${endorsed.classpath.cmd.line.arg}" arg2=""/>
  1.1506 +                </not>
  1.1507 +            </and>
  1.1508 +        </condition>
  1.1509 +        <condition else="" property="bug5101868workaround" value="*.java">
  1.1510 +            <matches pattern="1\.[56](\..*)?" string="${java.version}"/>
  1.1511 +        </condition>
  1.1512 +        <condition else="" property="javadoc.html5.cmd.line.arg" value="-html5">
  1.1513 +            <and>
  1.1514 +                <isset property="javadoc.html5"/>
  1.1515 +                <available file="${jdk.home}${file.separator}lib${file.separator}jrt-fs.jar"/>
  1.1516 +            </and>
  1.1517 +        </condition>
  1.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}">
  1.1519              <classpath>
  1.1520                  <path path="${javac.classpath}"/>
  1.1521              </classpath>
  1.1522 -            <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
  1.1523 +            <fileset dir="${src.dir}" excludes="${bug5101868workaround},${excludes}" includes="${includes}">
  1.1524                  <filename name="**/*.java"/>
  1.1525              </fileset>
  1.1526 +            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
  1.1527 +                <include name="**/*.java"/>
  1.1528 +                <exclude name="*.java"/>
  1.1529 +            </fileset>
  1.1530 +            <arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/>
  1.1531 +            <arg line="${javadoc.html5.cmd.line.arg}"/>
  1.1532          </javadoc>
  1.1533 +        <copy todir="${dist.javadoc.dir}">
  1.1534 +            <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
  1.1535 +                <filename name="**/doc-files/**"/>
  1.1536 +            </fileset>
  1.1537 +            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
  1.1538 +                <include name="**/doc-files/**"/>
  1.1539 +            </fileset>
  1.1540 +        </copy>
  1.1541      </target>
  1.1542      <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
  1.1543          <nbbrowse file="${dist.javadoc.dir}/index.html"/>
  1.1544 @@ -482,7 +1533,7 @@
  1.1545      <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
  1.1546      <!--
  1.1547                  =========================
  1.1548 -                JUNIT COMPILATION SECTION
  1.1549 +                TEST COMPILATION SECTION
  1.1550                  =========================
  1.1551              -->
  1.1552      <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
  1.1553 @@ -492,11 +1543,63 @@
  1.1554          <!-- Empty placeholder for easier customization. -->
  1.1555          <!-- You can override this target in the ../build.xml file. -->
  1.1556      </target>
  1.1557 +    <target depends="-init-source-module-properties" if="named.module.internal" name="-init-test-javac-module-properties-with-module">
  1.1558 +        <j2seproject3:modulename property="test.module.name" sourcepath="${test.src.dir}"/>
  1.1559 +        <condition else="${empty.dir}" property="javac.test.sourcepath" value="${test.src.dir}">
  1.1560 +            <and>
  1.1561 +                <isset property="test.module.name"/>
  1.1562 +                <length length="0" string="${test.module.name}" when="greater"/>
  1.1563 +            </and>
  1.1564 +        </condition>
  1.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">
  1.1566 +            <and>
  1.1567 +                <isset property="test.module.name"/>
  1.1568 +                <length length="0" string="${test.module.name}" when="greater"/>
  1.1569 +            </and>
  1.1570 +        </condition>
  1.1571 +    </target>
  1.1572 +    <target depends="-init-source-module-properties" if="named.module.internal" name="-init-test-run-module-properties">
  1.1573 +        <condition else="${module.name}" property="run.test.addexport.source.module.internal" value="${test.module.name}">
  1.1574 +            <and>
  1.1575 +                <isset property="test.module.name"/>
  1.1576 +                <length length="0" string="${test.module.name}" when="greater"/>
  1.1577 +            </and>
  1.1578 +        </condition>
  1.1579 +        <fileset dir="${build.test.classes.dir}" id="run.test.packages.internal" includes="**/*.class"/>
  1.1580 +        <property location="${build.test.classes.dir}" name="build.test.classes.dir.abs.internal"/>
  1.1581 +        <pathconvert pathsep=" " property="run.test.addexports.internal" refid="run.test.packages.internal">
  1.1582 +            <chainedmapper>
  1.1583 +                <regexpmapper from="^(.*)\Q${file.separator}\E.*\.class$$" to="\1"/>
  1.1584 +                <filtermapper>
  1.1585 +                    <uniqfilter/>
  1.1586 +                    <replacestring from="${build.test.classes.dir.abs.internal}" to=""/>
  1.1587 +                </filtermapper>
  1.1588 +                <cutdirsmapper dirs="1"/>
  1.1589 +                <packagemapper from="*" to="--add-exports ${run.test.addexport.source.module.internal}/*=ALL-UNNAMED"/>
  1.1590 +            </chainedmapper>
  1.1591 +        </pathconvert>
  1.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}">
  1.1593 +            <and>
  1.1594 +                <isset property="test.module.name"/>
  1.1595 +                <length length="0" string="${test.module.name}" when="greater"/>
  1.1596 +            </and>
  1.1597 +        </condition>
  1.1598 +    </target>
  1.1599 +    <target depends="-init-source-module-properties" name="-init-test-module-properties-without-module" unless="named.module.internal">
  1.1600 +        <property name="javac.test.sourcepath" value="${empty.dir}"/>
  1.1601 +        <property name="javac.test.compilerargs" value=""/>
  1.1602 +        <property name="run.test.jvmargs" value=""/>
  1.1603 +    </target>
  1.1604 +    <target depends="-init-test-javac-module-properties-with-module,-init-test-module-properties-without-module" name="-init-test-module-properties"/>
  1.1605      <target if="do.depend.true" name="-compile-test-depend">
  1.1606          <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
  1.1607      </target>
  1.1608 -    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
  1.1609 -        <j2seproject3:javac classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
  1.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">
  1.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}">
  1.1612 +            <customize>
  1.1613 +                <compilerarg line="${javac.test.compilerargs}"/>
  1.1614 +            </customize>
  1.1615 +        </j2seproject3:javac>
  1.1616          <copy todir="${build.test.classes.dir}">
  1.1617              <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
  1.1618          </copy>
  1.1619 @@ -510,10 +1613,14 @@
  1.1620          <!-- Empty placeholder for easier customization. -->
  1.1621          <!-- You can override this target in the ../build.xml file. -->
  1.1622      </target>
  1.1623 -    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
  1.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">
  1.1625          <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
  1.1626          <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
  1.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}"/>
  1.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}">
  1.1629 +            <customize>
  1.1630 +                <compilerarg line="${javac.test.compilerargs}"/>
  1.1631 +            </customize>
  1.1632 +        </j2seproject3:javac>
  1.1633          <copy todir="${build.test.classes.dir}">
  1.1634              <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
  1.1635          </copy>
  1.1636 @@ -525,17 +1632,17 @@
  1.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"/>
  1.1638      <!--
  1.1639                  =======================
  1.1640 -                JUNIT EXECUTION SECTION
  1.1641 +                TEST EXECUTION SECTION
  1.1642                  =======================
  1.1643              -->
  1.1644      <target depends="init" if="have.tests" name="-pre-test-run">
  1.1645          <mkdir dir="${build.test.results.dir}"/>
  1.1646      </target>
  1.1647 -    <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
  1.1648 -        <j2seproject3:junit testincludes="**/*Test.java"/>
  1.1649 +    <target depends="init,compile-test,-init-test-run-module-properties,-pre-test-run" if="have.tests" name="-do-test-run">
  1.1650 +        <j2seproject3:test includes="${includes}" testincludes="**/*Test.java"/>
  1.1651      </target>
  1.1652      <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
  1.1653 -        <fail if="tests.failed">Some tests failed; see details above.</fail>
  1.1654 +        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
  1.1655      </target>
  1.1656      <target depends="init" if="have.tests" name="test-report"/>
  1.1657      <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
  1.1658 @@ -543,41 +1650,42 @@
  1.1659      <target depends="init" if="have.tests" name="-pre-test-run-single">
  1.1660          <mkdir dir="${build.test.results.dir}"/>
  1.1661      </target>
  1.1662 -    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
  1.1663 +    <target depends="init,compile-test-single,-init-test-run-module-properties,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
  1.1664          <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
  1.1665 -        <j2seproject3:junit excludes="" includes="${test.includes}"/>
  1.1666 +        <j2seproject3:test excludes="" includes="${test.includes}" testincludes="${test.includes}"/>
  1.1667      </target>
  1.1668      <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
  1.1669 -        <fail if="tests.failed">Some tests failed; see details above.</fail>
  1.1670 +        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
  1.1671      </target>
  1.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"/>
  1.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"/>
  1.1674 +    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single-method">
  1.1675 +        <fail unless="test.class">Must select some files in the IDE or set test.class</fail>
  1.1676 +        <fail unless="test.method">Must select some method in the IDE or set test.method</fail>
  1.1677 +        <j2seproject3:test excludes="" includes="${javac.includes}" testincludes="${test.class}" testmethods="${test.method}"/>
  1.1678 +    </target>
  1.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">
  1.1680 +        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
  1.1681 +    </target>
  1.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"/>
  1.1683      <!--
  1.1684                  =======================
  1.1685 -                JUNIT DEBUGGING SECTION
  1.1686 +                TEST DEBUGGING SECTION
  1.1687                  =======================
  1.1688              -->
  1.1689 -    <target depends="init,compile-test" if="have.tests" name="-debug-start-debuggee-test">
  1.1690 +    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test">
  1.1691          <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
  1.1692 -        <property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/>
  1.1693 -        <delete file="${test.report.file}"/>
  1.1694 -        <mkdir dir="${build.test.results.dir}"/>
  1.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}">
  1.1696 -            <customize>
  1.1697 -                <syspropertyset>
  1.1698 -                    <propertyref prefix="test-sys-prop."/>
  1.1699 -                    <mapper from="test-sys-prop.*" to="*" type="glob"/>
  1.1700 -                </syspropertyset>
  1.1701 -                <arg value="${test.class}"/>
  1.1702 -                <arg value="showoutput=true"/>
  1.1703 -                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/>
  1.1704 -                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/>
  1.1705 -            </customize>
  1.1706 -        </j2seproject3:debug>
  1.1707 +        <j2seproject3:test-debug excludes="" includes="${javac.includes}" testClass="${test.class}" testincludes="${javac.includes}"/>
  1.1708 +    </target>
  1.1709 +    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test-method">
  1.1710 +        <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
  1.1711 +        <fail unless="test.method">Must select some method in the IDE or set test.method</fail>
  1.1712 +        <j2seproject3:test-debug excludes="" includes="${javac.includes}" testClass="${test.class}" testMethod="${test.method}" testincludes="${test.class}" testmethods="${test.method}"/>
  1.1713      </target>
  1.1714      <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
  1.1715          <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
  1.1716      </target>
  1.1717 -    <target depends="init,-do-not-recompile,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
  1.1718 +    <target depends="init,compile-test-single,-init-test-run-module-properties,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
  1.1719 +    <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.1720      <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
  1.1721          <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
  1.1722      </target>
  1.1723 @@ -603,9 +1711,9 @@
  1.1724      <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet">
  1.1725          <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
  1.1726          <j2seproject3:debug classname="sun.applet.AppletViewer">
  1.1727 -            <customize>
  1.1728 +            <customizeDebuggee>
  1.1729                  <arg value="${applet.url}"/>
  1.1730 -            </customize>
  1.1731 +            </customizeDebuggee>
  1.1732          </j2seproject3:debug>
  1.1733      </target>
  1.1734      <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/>
  1.1735 @@ -614,14 +1722,49 @@
  1.1736                  CLEANUP SECTION
  1.1737                  ===============
  1.1738              -->
  1.1739 -    <target depends="init" name="deps-clean" unless="no.deps"/>
  1.1740 +    <target name="-deps-clean-init" unless="built-clean.properties">
  1.1741 +        <property location="${build.dir}/built-clean.properties" name="built-clean.properties"/>
  1.1742 +        <delete file="${built-clean.properties}" quiet="true"/>
  1.1743 +    </target>
  1.1744 +    <target if="already.built.clean.${basedir}" name="-warn-already-built-clean">
  1.1745 +        <echo level="warn" message="Cycle detected: javabeans was already built"/>
  1.1746 +    </target>
  1.1747 +    <target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps">
  1.1748 +        <mkdir dir="${build.dir}"/>
  1.1749 +        <touch file="${built-clean.properties}" verbose="false"/>
  1.1750 +        <property file="${built-clean.properties}" prefix="already.built.clean."/>
  1.1751 +        <antcall target="-warn-already-built-clean"/>
  1.1752 +        <propertyfile file="${built-clean.properties}">
  1.1753 +            <entry key="${basedir}" value=""/>
  1.1754 +        </propertyfile>
  1.1755 +    </target>
  1.1756      <target depends="init" name="-do-clean">
  1.1757          <delete dir="${build.dir}"/>
  1.1758 -        <delete dir="${dist.dir}"/>
  1.1759 +        <delete dir="${dist.jlink.output}"/>
  1.1760 +        <delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/>
  1.1761      </target>
  1.1762      <target name="-post-clean">
  1.1763          <!-- Empty placeholder for easier customization. -->
  1.1764          <!-- You can override this target in the ../build.xml file. -->
  1.1765      </target>
  1.1766      <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
  1.1767 +    <target name="-check-call-dep">
  1.1768 +        <property file="${call.built.properties}" prefix="already.built."/>
  1.1769 +        <condition property="should.call.dep">
  1.1770 +            <and>
  1.1771 +                <not>
  1.1772 +                    <isset property="already.built.${call.subproject}"/>
  1.1773 +                </not>
  1.1774 +                <available file="${call.script}"/>
  1.1775 +            </and>
  1.1776 +        </condition>
  1.1777 +    </target>
  1.1778 +    <target depends="-check-call-dep" if="should.call.dep" name="-maybe-call-dep">
  1.1779 +        <ant antfile="${call.script}" inheritall="false" target="${call.target}">
  1.1780 +            <propertyset>
  1.1781 +                <propertyref prefix="transfer."/>
  1.1782 +                <mapper from="transfer.*" to="*" type="glob"/>
  1.1783 +            </propertyset>
  1.1784 +        </ant>
  1.1785 +    </target>
  1.1786  </project>