9cc58e9cdd8bbff88cef0b083d106705de6cadd9
[zcl] / nbproject / build-impl.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3 *** GENERATED FROM project.xml - DO NOT EDIT  ***
4 ***         EDIT ../build.xml INSTEAD         ***
5
6 For the purpose of easier reading the script
7 is divided into following sections:
8
9   - initialization
10   - compilation
11   - jar
12   - execution
13   - debugging
14   - javadoc
15   - test compilation
16   - test execution
17   - test debugging
18   - applet
19   - cleanup
20
21         -->
22 <project xmlns:if="ant:if" xmlns:unless="ant:unless" basedir=".." default="default" name="notzed.zcl-impl">
23     <fail message="Please build using Ant 1.9.7 or higher.">
24         <condition>
25             <not>
26                 <antversion atleast="1.9.7"/>
27             </not>
28         </condition>
29     </fail>
30     <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
31     <!-- 
32                 ======================
33                 INITIALIZATION SECTION 
34                 ======================
35             -->
36     <target name="-pre-init">
37         <!-- Empty placeholder for easier customization. -->
38         <!-- You can override this target in the ../build.xml file. -->
39     </target>
40     <target depends="-pre-init" name="-init-private">
41         <property file="nbproject/private/config.properties"/>
42         <property file="nbproject/private/configs/${config}.properties"/>
43         <property file="nbproject/private/private.properties"/>
44     </target>
45     <target depends="-pre-init,-init-private" name="-init-user">
46         <property file="${user.properties.file}"/>
47         <!-- The two properties below are usually overridden -->
48         <!-- by the active platform. Just a fallback. -->
49         <property name="default.javac.source" value="9"/>
50         <property name="default.javac.target" value="9"/>
51     </target>
52     <target depends="-pre-init,-init-private,-init-user" name="-init-project">
53         <property file="nbproject/configs/${config}.properties"/>
54         <property file="nbproject/project.properties"/>
55     </target>
56     <target name="-init-source-module-properties">
57         <property name="javac.modulepath" value=""/>
58         <property name="run.modulepath" value="${javac.modulepath}:${build.modules.dir}"/>
59         <property name="debug.modulepath" value="${run.modulepath}"/>
60         <property name="javac.upgrademodulepath" value=""/>
61         <property name="run.upgrademodulepath" value="${javac.upgrademodulepath}"/>
62         <condition else="" property="javac.systemmodulepath.cmd.line.arg" value="-system '${javac.systemmodulepath}'">
63             <and>
64                 <isset property="javac.systemmodulepath"/>
65                 <length length="0" string="${javac.systemmodulepath}" when="greater"/>
66             </and>
67         </condition>
68         <property name="dist.jlink.dir" value="${dist.dir}/jlink"/>
69         <property name="dist.jlink.output" value="${dist.jlink.dir}/${application.title}"/>
70     </target>
71     <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init">
72         <j2semodularproject1:property xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" name="platform.home" value="platforms.${platform.active}.home"/>
73         <j2semodularproject1:property xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" name="platform.bootcp" value="platforms.${platform.active}.bootclasspath"/>
74         <j2semodularproject1:property xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" name="platform.compiler" value="platforms.${platform.active}.compile"/>
75         <j2semodularproject1:property xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" name="platform.javac.tmp" value="platforms.${platform.active}.javac"/>
76         <condition property="platform.javac" value="${platform.home}/bin/javac">
77             <equals arg1="${platform.javac.tmp}" arg2="$${platforms.${platform.active}.javac}"/>
78         </condition>
79         <property name="platform.javac" value="${platform.javac.tmp}"/>
80         <j2semodularproject1:property xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" name="platform.java.tmp" value="platforms.${platform.active}.java"/>
81         <condition property="platform.java" value="${platform.home}/bin/java">
82             <equals arg1="${platform.java.tmp}" arg2="$${platforms.${platform.active}.java}"/>
83         </condition>
84         <property name="platform.java" value="${platform.java.tmp}"/>
85         <j2semodularproject1:property xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" name="platform.javadoc.tmp" value="platforms.${platform.active}.javadoc"/>
86         <condition property="platform.javadoc" value="${platform.home}/bin/javadoc">
87             <equals arg1="${platform.javadoc.tmp}" arg2="$${platforms.${platform.active}.javadoc}"/>
88         </condition>
89         <property name="platform.javadoc" value="${platform.javadoc.tmp}"/>
90         <condition property="platform.invalid" value="true">
91             <or>
92                 <contains string="${platform.javac}" substring="$${platforms."/>
93                 <contains string="${platform.java}" substring="$${platforms."/>
94                 <contains string="${platform.javadoc}" substring="$${platforms."/>
95             </or>
96         </condition>
97         <fail unless="platform.home">Must set platform.home</fail>
98         <fail unless="platform.bootcp">Must set platform.bootcp</fail>
99         <fail unless="platform.java">Must set platform.java</fail>
100         <fail unless="platform.javac">Must set platform.javac</fail>
101         <fail if="platform.invalid">
102  The J2SE Platform is not correctly set up.
103  Your active platform is: ${platform.active}, but the corresponding property "platforms.${platform.active}.home" is not found in the project's properties files. 
104  Either open the project in the IDE and setup the Platform with the same name or add it manually.
105  For example like this:
106      ant -Duser.properties.file=&lt;path_to_property_file&gt; jar (where you put the property "platforms.${platform.active}.home" in a .properties file)
107   or ant -Dplatforms.${platform.active}.home=&lt;path_to_JDK_home&gt; jar (where no properties file is used) 
108   </fail>
109         <j2semodularproject1:modsource_regexp xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" modsource="${test.src.dir.path}" property="have.tests.test.src.dir.regexp"/>
110         <dirset dir="${basedir}/${test.src.dir}" id="have.tests.test.src.dir.set" includes="*/*">
111             <filename regex="${have.tests.test.src.dir.regexp}"/>
112         </dirset>
113         <union id="have.tests.set">
114             <dirset refid="have.tests.test.src.dir.set"/>
115         </union>
116         <condition property="have.tests">
117             <or>
118                 <resourcecount count="0" when="greater">
119                     <union refid="have.tests.set"/>
120                 </resourcecount>
121             </or>
122         </condition>
123         <j2semodularproject1:modsource_regexp xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" modsource="${test.src.dir.path}" property="have.tests.test.src.dir.regexp"/>
124         <dirset dir="${basedir}/${test.src.dir}" id="have.tests.test.src.dir.patchset" includes="*/*">
125             <filename regex="${have.tests.test.src.dir.regexp}"/>
126             <scriptselector language="javascript">
127                             self.setSelected(!new java.io.File(file, "module-info.java").exists());
128                         </scriptselector>
129         </dirset>
130         <union id="have.tests.patchset">
131             <dirset refid="have.tests.test.src.dir.patchset"/>
132         </union>
133         <j2semodularproject1:modsource_regexp xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" modsource="${src.gen2.dir.path}" property="have.sources.src.gen2.dir.regexp"/>
134         <dirset dir="${basedir}/${src.gen2.dir}" id="have.sources.src.gen2.dir.set" includes="*/*">
135             <filename regex="${have.sources.src.gen2.dir.regexp}"/>
136         </dirset>
137         <j2semodularproject1:modsource_regexp xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" modsource="${src.dir.path}" property="have.sources.src.dir.regexp"/>
138         <dirset dir="${basedir}/${src.dir}" id="have.sources.src.dir.set" includes="*/*">
139             <filename regex="${have.sources.src.dir.regexp}"/>
140         </dirset>
141         <union id="have.sources.set">
142             <dirset refid="have.sources.src.gen2.dir.set"/>
143             <dirset refid="have.sources.src.dir.set"/>
144         </union>
145         <condition property="have.sources">
146             <or>
147                 <resourcecount count="0" when="greater">
148                     <union refid="have.sources.set"/>
149                 </resourcecount>
150                 <resourcecount count="0" when="greater">
151                     <union refid="have.sources.set"/>
152                 </resourcecount>
153             </or>
154         </condition>
155         <condition property="main.class.available">
156             <and>
157                 <isset property="main.class"/>
158                 <not>
159                     <equals arg1="${main.class}" arg2="" trim="true"/>
160                 </not>
161             </and>
162         </condition>
163         <condition property="netbeans.home+have.tests">
164             <and>
165                 <isset property="netbeans.home"/>
166                 <isset property="have.tests"/>
167             </and>
168         </condition>
169         <condition property="no.javadoc.preview">
170             <and>
171                 <isset property="javadoc.preview"/>
172                 <isfalse value="${javadoc.preview}"/>
173             </and>
174         </condition>
175         <condition property="do.archive">
176             <or>
177                 <not>
178                     <istrue value="${jar.archive.disabled}"/>
179                 </not>
180                 <istrue value="${not.archive.disabled}"/>
181             </or>
182         </condition>
183         <property name="run.jvmargs" value=""/>
184         <property name="run.jvmargs.ide" value=""/>
185         <property name="javac.compilerargs" value=""/>
186         <property name="work.dir" value="${basedir}"/>
187         <condition property="no.deps">
188             <and>
189                 <istrue value="${no.dependencies}"/>
190             </and>
191         </condition>
192         <property name="javac.debug" value="true"/>
193         <property name="javadoc.preview" value="true"/>
194         <property name="application.args" value=""/>
195         <property name="source.encoding" value="${file.encoding}"/>
196         <property name="runtime.encoding" value="${source.encoding}"/>
197         <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
198             <and>
199                 <isset property="javadoc.encoding"/>
200                 <not>
201                     <equals arg1="${javadoc.encoding}" arg2=""/>
202                 </not>
203             </and>
204         </condition>
205         <property name="javadoc.encoding.used" value="${source.encoding}"/>
206         <property name="includes" value="**"/>
207         <property name="excludes" value=""/>
208         <property name="do.depend" value="false"/>
209         <condition property="do.depend.true">
210             <istrue value="${do.depend}"/>
211         </condition>
212         <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
213         <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
214             <and>
215                 <isset property="endorsed.classpath"/>
216                 <not>
217                     <equals arg1="${endorsed.classpath}" arg2="" trim="true"/>
218                 </not>
219             </and>
220         </condition>
221         <condition else="" property="javac.profile.cmd.line.arg" value="-profile ${javac.profile}">
222             <isset property="profile.available"/>
223         </condition>
224         <condition property="main.class.check.available">
225             <and>
226                 <isset property="libs.CopyLibs.classpath"/>
227                 <available classname="org.netbeans.modules.java.j2seproject.moduletask.ModuleMainClass" classpath="${libs.CopyLibs.classpath}"/>
228             </and>
229         </condition>
230         <property name="jar.index" value="false"/>
231         <property name="jar.index.metainf" value="${jar.index}"/>
232         <condition property="junit.available">
233             <or>
234                 <available classname="org.junit.Test" classpath="${run.test.classpath}"/>
235                 <available classname="junit.framework.Test" classpath="${run.test.classpath}"/>
236             </or>
237         </condition>
238         <condition property="testng.available">
239             <available classname="org.testng.annotations.Test" classpath="${run.test.classpath}"/>
240         </condition>
241         <condition property="junit+testng.available">
242             <and>
243                 <istrue value="${junit.available}"/>
244                 <istrue value="${testng.available}"/>
245             </and>
246         </condition>
247         <condition else="testng" property="testng.mode" value="mixed">
248             <istrue value="${junit+testng.available}"/>
249         </condition>
250         <condition else="" property="testng.debug.mode" value="-mixed">
251             <istrue value="${junit+testng.available}"/>
252         </condition>
253         <property name="java.failonerror" value="true"/>
254         <macrodef name="for-paths" uri="http://www.netbeans.org/ns/j2se-modular-project/1">
255             <attribute name="paths"/>
256             <attribute default="${path.separator}" name="separator"/>
257             <element implicit="yes" name="call"/>
258             <sequential>
259                 <local name="entry"/>
260                 <local name="tail"/>
261                 <local name="moreElements"/>
262                 <loadresource property="entry" quiet="true" unless:blank="@{paths}">
263                     <concat>@{paths}</concat>
264                     <filterchain>
265                         <replaceregex pattern="([^@{separator}]*)\Q@{separator}\E.*" replace="\1"/>
266                     </filterchain>
267                 </loadresource>
268                 <sequential if:set="entry">
269                     <call/>
270                 </sequential>
271                 <condition else="false" property="moreElements" value="true">
272                     <contains string="@{paths}" substring="@{separator}"/>
273                 </condition>
274                 <loadresource if:true="${moreElements}" property="tail" quiet="true">
275                     <concat>@{paths}</concat>
276                     <filterchain>
277                         <replaceregex pattern="[^@{separator}]*\Q@{separator}\E(.*)" replace="\1"/>
278                     </filterchain>
279                 </loadresource>
280                 <j2semodularproject1:for-paths xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" if:true="${moreElements}" paths="${tail}">
281                     <call/>
282                 </j2semodularproject1:for-paths>
283             </sequential>
284         </macrodef>
285         <property name="modules.supported.internal" value="true"/>
286         <condition else="${file.separator}" property="file.separator.string" value="\${file.separator}">
287             <equals arg1="${file.separator}" arg2="\"/>
288         </condition>
289     </target>
290     <target name="-post-init">
291         <!-- Empty placeholder for easier customization. -->
292         <!-- You can override this target in the ../build.xml file. -->
293     </target>
294     <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init" name="-init-check">
295         <fail unless="src.gen2.dir">Must set src.gen2.dir</fail>
296         <fail unless="src.dir">Must set src.dir</fail>
297         <fail unless="test.src.dir">Must set test.src.dir</fail>
298         <fail unless="build.dir">Must set build.dir</fail>
299         <fail unless="dist.dir">Must set dist.dir</fail>
300         <fail unless="build.modules.dir">Must set build.modules.dir</fail>
301         <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
302         <fail unless="build.test.modules.dir">Must set build.test.modules.dir</fail>
303         <fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
304         <fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
305         <fail message="Java 9 support requires Ant 1.10.0 or higher.">
306             <condition>
307                 <not>
308                     <antversion atleast="1.10.0"/>
309                 </not>
310             </condition>
311         </fail>
312     </target>
313     <target name="-init-macrodef-property">
314         <macrodef name="property" uri="http://www.netbeans.org/ns/j2se-modular-project/1">
315             <attribute name="name"/>
316             <attribute name="value"/>
317             <sequential>
318                 <property name="@{name}" value="${@{value}}"/>
319             </sequential>
320         </macrodef>
321     </target>
322     <target depends="-init-ap-cmdline-properties,-init-source-module-properties" name="-init-macrodef-javac">
323         <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-modular-project/1">
324             <attribute default="${build.modules.dir}" name="destdir"/>
325             <attribute default="${javac.classpath}" name="classpath"/>
326             <attribute default="${javac.modulepath}" name="modulepath"/>
327             <attribute default="${src.gen2.dir}/*/${src.gen2.dir.path}:${src.dir}/*/${src.dir.path}" name="modulesourcepath"/>
328             <attribute default="${javac.upgrademodulepath}" name="upgrademodulepath"/>
329             <attribute default="${javac.processorpath}" name="processorpath"/>
330             <attribute default="${javac.processormodulepath}" name="processormodulepath"/>
331             <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
332             <attribute default="${includes}" name="includes"/>
333             <attribute default="${excludes}" name="excludes"/>
334             <attribute default="${javac.debug}" name="debug"/>
335             <attribute default="${empty.dir}" name="gensrcdir"/>
336             <element name="customize" optional="true"/>
337             <sequential>
338                 <property location="${build.dir}/empty" name="empty.dir"/>
339                 <mkdir dir="${empty.dir}"/>
340                 <mkdir dir="@{apgeneratedsrcdir}"/>
341                 <condition property="processormodulepath.set">
342                     <resourcecount count="0" when="greater">
343                         <path>
344                             <pathelement path="@{processormodulepath}"/>
345                         </path>
346                     </resourcecount>
347                 </condition>
348                 <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" executable="${platform.javac}" fork="yes" includeantruntime="false" includes="@{includes}" source="${javac.source}" target="${javac.target}" tempdir="${java.io.tmpdir}">
349                     <classpath>
350                         <path path="@{classpath}"/>
351                     </classpath>
352                     <modulepath>
353                         <path path="@{modulepath}"/>
354                     </modulepath>
355                     <modulesourcepath>
356                         <path path="@{modulesourcepath}"/>
357                     </modulesourcepath>
358                     <upgrademodulepath>
359                         <path path="@{upgrademodulepath}"/>
360                     </upgrademodulepath>
361                     <compilerarg line="${javac.systemmodulepath.cmd.line.arg}"/>
362                     <compilerarg line="${javac.profile.cmd.line.arg}"/>
363                     <compilerarg line="${javac.compilerargs}"/>
364                     <compilerarg if:set="processormodulepath.set" value="--processor-module-path"/>
365                     <compilerarg if:set="processormodulepath.set" path="@{processormodulepath}"/>
366                     <compilerarg unless:set="processormodulepath.set" value="-processorpath"/>
367                     <compilerarg path="@{processorpath}:${empty.dir}" unless:set="processormodulepath.set"/>
368                     <compilerarg line="${ap.processors.internal}"/>
369                     <compilerarg line="${annotation.processing.processor.options}"/>
370                     <compilerarg value="-s"/>
371                     <compilerarg path="@{apgeneratedsrcdir}"/>
372                     <compilerarg line="${ap.proc.none.internal}"/>
373                     <customize/>
374                 </javac>
375             </sequential>
376         </macrodef>
377     </target>
378     <target depends="-init-macrodef-javac" name="-init-macrodef-javac-depend">
379         <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-modular-project/1">
380             <attribute default="${src.gen2.dir}:${src.dir}" name="srcdir"/>
381             <attribute default="${build.classes.dir}" name="destdir"/>
382             <attribute default="${javac.classpath}" name="classpath"/>
383             <sequential>
384                 <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">
385                     <classpath>
386                         <path path="@{classpath}"/>
387                     </classpath>
388                 </depend>
389             </sequential>
390         </macrodef>
391         <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-modular-project/1">
392             <attribute default="${build.modules.dir}" name="destdir"/>
393             <sequential>
394                 <fail unless="javac.includes">Must set javac.includes</fail>
395                 <pathconvert pathsep="${line.separator}" property="javac.includes.binary">
396                     <path>
397                         <filelist dir="@{destdir}" files="${javac.includes}"/>
398                     </path>
399                     <globmapper from="*.java" to="*.class"/>
400                 </pathconvert>
401                 <tempfile deleteonexit="true" property="javac.includesfile.binary"/>
402                 <echo file="${javac.includesfile.binary}" message="${javac.includes.binary}"/>
403                 <delete>
404                     <files includesfile="${javac.includesfile.binary}"/>
405                 </delete>
406                 <delete>
407                     <fileset file="${javac.includesfile.binary}"/>
408                 </delete>
409             </sequential>
410         </macrodef>
411     </target>
412     <target if="${junit.available}" name="-init-macrodef-junit-init">
413         <condition else="false" property="nb.junit.batch" value="true">
414             <and>
415                 <istrue value="${junit.available}"/>
416                 <not>
417                     <isset property="test.method"/>
418                 </not>
419             </and>
420         </condition>
421         <condition else="false" property="nb.junit.single" value="true">
422             <and>
423                 <istrue value="${junit.available}"/>
424                 <isset property="test.method"/>
425             </and>
426         </condition>
427     </target>
428     <target name="-init-test-properties">
429         <property name="test.binaryincludes" value="&lt;nothing&gt;"/>
430         <property name="test.binarytestincludes" value=""/>
431         <property name="test.binaryexcludes" value=""/>
432     </target>
433     <target name="-init-macrodef-junit-prototype">
434         <macrodef name="junit-prototype" uri="http://www.netbeans.org/ns/j2se-modular-project/1">
435             <attribute default="${includes}" name="includes"/>
436             <attribute default="${excludes}" name="excludes"/>
437             <element name="customizePrototype" optional="true"/>
438             <sequential>
439                 <property location="${build.dir}/empty" name="empty.dir"/>
440                 <property name="junit.forkmode" value="perTest"/>
441                 <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" jvm="${platform.java}" showoutput="true" tempdir="${build.dir}">
442                     <syspropertyset>
443                         <propertyref prefix="test-sys-prop."/>
444                         <mapper from="test-sys-prop.*" to="*" type="glob"/>
445                     </syspropertyset>
446                     <classpath>
447                         <path path="${run.test.classpath}"/>
448                     </classpath>
449                     <formatter type="brief" usefile="false"/>
450                     <formatter type="xml"/>
451                     <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
452                     <jvmarg value="-ea"/>
453                     <jvmarg value="--module-path"/>
454                     <jvmarg path="${run.modulepath}${path.separator}${run.test.modulepath}${path.separator}${empty.dir}"/>
455                     <jvmarg line="${run.test.jvmargs}"/>
456                     <customizePrototype/>
457                 </junit>
458             </sequential>
459         </macrodef>
460     </target>
461     <target depends="-init-test-properties,-init-macrodef-junit-prototype" if="${nb.junit.single}" name="-init-macrodef-junit-single" unless="${nb.junit.batch}">
462         <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-modular-project/1">
463             <attribute default="${includes}" name="includes"/>
464             <attribute default="${excludes}" name="excludes"/>
465             <attribute default="**" name="testincludes"/>
466             <attribute default="" name="testmethods"/>
467             <element name="customize" optional="true"/>
468             <sequential>
469                 <j2semodularproject1:junit-prototype xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1">
470                     <customizePrototype>
471                         <test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/>
472                         <customize/>
473                     </customizePrototype>
474                 </j2semodularproject1:junit-prototype>
475             </sequential>
476         </macrodef>
477     </target>
478     <target depends="-init-test-properties,-init-macrodef-junit-prototype" if="${nb.junit.batch}" name="-init-macrodef-junit-batch" unless="${nb.junit.single}">
479         <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-modular-project/1">
480             <attribute default="${includes}" name="includes"/>
481             <attribute default="${excludes}" name="excludes"/>
482             <attribute default="**" name="testincludes"/>
483             <attribute default="" name="testmethods"/>
484             <element name="customize" optional="true"/>
485             <sequential>
486                 <j2semodularproject1:junit-prototype xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1">
487                     <customizePrototype>
488                         <batchtest todir="${build.test.results.dir}">
489                             <mappedresources>
490                                 <union>
491                                     <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="**/@{includes}">
492                                         <filename name="**/@{testincludes}"/>
493                                         <filename regex="${have.tests.test.src.dir.regexp}"/>
494                                     </fileset>
495                                 </union>
496                                 <regexpmapper from="${have.tests.test.src.dir.regexp}\Q${file.separator}\E(.*)$" to="\3"/>
497                             </mappedresources>
498                             <fileset dir="${build.test.modules.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}">
499                                 <filename name="${test.binarytestincludes}"/>
500                             </fileset>
501                         </batchtest>
502                         <customize/>
503                     </customizePrototype>
504                 </j2semodularproject1:junit-prototype>
505             </sequential>
506         </macrodef>
507     </target>
508     <target depends="-init-macrodef-junit-init,-init-macrodef-junit-single, -init-macrodef-junit-batch" if="${junit.available}" name="-init-macrodef-junit"/>
509     <target if="${testng.available}" name="-init-macrodef-testng">
510         <macrodef name="testng" uri="http://www.netbeans.org/ns/j2se-modular-project/1">
511             <attribute default="${includes}" name="includes"/>
512             <attribute default="${excludes}" name="excludes"/>
513             <attribute default="**" name="testincludes"/>
514             <attribute default="" name="testmethods"/>
515             <element name="customize" optional="true"/>
516             <sequential>
517                 <condition else="" property="testng.methods.arg" value="@{testincludes}.@{testmethods}">
518                     <isset property="test.method"/>
519                 </condition>
520                 <union id="test.set">
521                     <fileset dir="${test.src.dir}" excludes="@{excludes},**/*.xml,${excludes}" includes="@{includes}">
522                         <filename name="@{testincludes}"/>
523                     </fileset>
524                 </union>
525                 <taskdef classname="org.testng.TestNGAntTask" classpath="${run.test.classpath}" name="testng"/>
526                 <testng classfilesetref="test.set" failureProperty="tests.failed" jvm="${platform.java}" listeners="org.testng.reporters.VerboseReporter" methods="${testng.methods.arg}" mode="${testng.mode}" outputdir="${build.test.results.dir}" suitename="notzed.zcl" testname="TestNG tests" workingDir="${work.dir}">
527                     <xmlfileset dir="${build.test.classes.dir}" includes="@{testincludes}"/>
528                     <propertyset>
529                         <propertyref prefix="test-sys-prop."/>
530                         <mapper from="test-sys-prop.*" to="*" type="glob"/>
531                     </propertyset>
532                     <classpath>
533                         <path path="${run.test.classpath}"/>
534                     </classpath>
535                     <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
536                     <customize/>
537                 </testng>
538             </sequential>
539         </macrodef>
540     </target>
541     <target name="-init-macrodef-test-impl">
542         <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-modular-project/1">
543             <attribute default="${includes}" name="includes"/>
544             <attribute default="${excludes}" name="excludes"/>
545             <attribute default="**" name="testincludes"/>
546             <attribute default="" name="testmethods"/>
547             <element implicit="true" name="customize" optional="true"/>
548             <sequential>
549                 <echo>No tests executed.</echo>
550             </sequential>
551         </macrodef>
552     </target>
553     <target depends="-init-macrodef-junit" if="${junit.available}" name="-init-macrodef-junit-impl">
554         <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-modular-project/1">
555             <attribute default="${includes}" name="includes"/>
556             <attribute default="${excludes}" name="excludes"/>
557             <attribute default="**" name="testincludes"/>
558             <attribute default="" name="testmethods"/>
559             <element implicit="true" name="customize" optional="true"/>
560             <sequential>
561                 <j2semodularproject1:junit xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
562                     <customize/>
563                 </j2semodularproject1:junit>
564             </sequential>
565         </macrodef>
566     </target>
567     <target depends="-init-macrodef-testng" if="${testng.available}" name="-init-macrodef-testng-impl">
568         <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-modular-project/1">
569             <attribute default="${includes}" name="includes"/>
570             <attribute default="${excludes}" name="excludes"/>
571             <attribute default="**" name="testincludes"/>
572             <attribute default="" name="testmethods"/>
573             <element implicit="true" name="customize" optional="true"/>
574             <sequential>
575                 <j2semodularproject1:testng xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
576                     <customize/>
577                 </j2semodularproject1:testng>
578             </sequential>
579         </macrodef>
580     </target>
581     <target depends="-init-macrodef-test-impl,-init-macrodef-junit-impl,-init-macrodef-testng-impl" name="-init-macrodef-test">
582         <macrodef name="test" uri="http://www.netbeans.org/ns/j2se-modular-project/1">
583             <attribute default="${includes}" name="includes"/>
584             <attribute default="${excludes}" name="excludes"/>
585             <attribute default="**" name="testincludes"/>
586             <attribute default="" name="testmethods"/>
587             <sequential>
588                 <j2semodularproject1:test-impl xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
589                     <customize>
590                         <jvmarg line="${run.jvmargs}"/>
591                         <jvmarg line="${run.jvmargs.ide}"/>
592                     </customize>
593                 </j2semodularproject1:test-impl>
594             </sequential>
595         </macrodef>
596     </target>
597     <target depends="-init-macrodef-junit" if="${junit.available}" name="-init-macrodef-junit-debug-impl">
598         <macrodef name="test-debug-impl" uri="http://www.netbeans.org/ns/j2se-modular-project/1">
599             <attribute default="${includes}" name="includes"/>
600             <attribute default="${excludes}" name="excludes"/>
601             <attribute default="**" name="testincludes"/>
602             <attribute default="" name="testmethods"/>
603             <element name="customizeDebuggee" optional="true"/>
604             <sequential>
605                 <j2semodularproject1:junit xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
606                     <customize>
607                         <jvmarg value="-agentlib:jdwp=transport=${debug-transport},address=${jpda.address}"/>
608                         <customizeDebuggee/>
609                     </customize>
610                 </j2semodularproject1:junit>
611             </sequential>
612         </macrodef>
613     </target>
614     <target if="${testng.available}" name="-init-macrodef-testng-debug">
615         <macrodef name="testng-debug" uri="http://www.netbeans.org/ns/j2se-modular-project/1">
616             <attribute default="${main.class}" name="testClass"/>
617             <attribute default="" name="testMethod"/>
618             <element name="customize2" optional="true"/>
619             <sequential>
620                 <condition else="-testclass @{testClass}" property="test.class.or.method" value="-methods @{testClass}.@{testMethod}">
621                     <isset property="test.method"/>
622                 </condition>
623                 <condition else="-suitename notzed.zcl -testname @{testClass} ${test.class.or.method}" property="testng.cmd.args" value="@{testClass}">
624                     <matches pattern=".*\.xml" string="@{testClass}"/>
625                 </condition>
626                 <delete dir="${build.test.results.dir}" quiet="true"/>
627                 <mkdir dir="${build.test.results.dir}"/>
628                 <j2semodularproject1:debug xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" classname="org.testng.TestNG" classpath="${debug.test.classpath}">
629                     <customizeDebuggee>
630                         <customize2/>
631                         <jvmarg value="-ea"/>
632                         <arg line="${testng.debug.mode}"/>
633                         <arg line="-d ${build.test.results.dir}"/>
634                         <arg line="-listener org.testng.reporters.VerboseReporter"/>
635                         <arg line="${testng.cmd.args}"/>
636                     </customizeDebuggee>
637                 </j2semodularproject1:debug>
638             </sequential>
639         </macrodef>
640     </target>
641     <target depends="-init-macrodef-testng-debug" if="${testng.available}" name="-init-macrodef-testng-debug-impl">
642         <macrodef name="testng-debug-impl" uri="http://www.netbeans.org/ns/j2se-modular-project/1">
643             <attribute default="${main.class}" name="testClass"/>
644             <attribute default="" name="testMethod"/>
645             <element implicit="true" name="customize2" optional="true"/>
646             <sequential>
647                 <j2semodularproject1:testng-debug xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" testClass="@{testClass}" testMethod="@{testMethod}">
648                     <customize2/>
649                 </j2semodularproject1:testng-debug>
650             </sequential>
651         </macrodef>
652     </target>
653     <target depends="-init-macrodef-junit-debug-impl" if="${junit.available}" name="-init-macrodef-test-debug-junit">
654         <macrodef name="test-debug" uri="http://www.netbeans.org/ns/j2se-modular-project/1">
655             <attribute default="${includes}" name="includes"/>
656             <attribute default="${excludes}" name="excludes"/>
657             <attribute default="**" name="testincludes"/>
658             <attribute default="" name="testmethods"/>
659             <attribute default="${main.class}" name="testClass"/>
660             <attribute default="" name="testMethod"/>
661             <sequential>
662                 <j2semodularproject1:test-debug-impl xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
663                     <customizeDebuggee>
664                         <jvmarg line="${run.jvmargs}"/>
665                         <jvmarg line="${run.jvmargs.ide}"/>
666                     </customizeDebuggee>
667                 </j2semodularproject1:test-debug-impl>
668             </sequential>
669         </macrodef>
670     </target>
671     <target depends="-init-macrodef-testng-debug-impl" if="${testng.available}" name="-init-macrodef-test-debug-testng">
672         <macrodef name="test-debug" uri="http://www.netbeans.org/ns/j2se-modular-project/1">
673             <attribute default="${includes}" name="includes"/>
674             <attribute default="${excludes}" name="excludes"/>
675             <attribute default="**" name="testincludes"/>
676             <attribute default="" name="testmethods"/>
677             <attribute default="${main.class}" name="testClass"/>
678             <attribute default="" name="testMethod"/>
679             <sequential>
680                 <j2semodularproject1:testng-debug-impl xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" testClass="@{testClass}" testMethod="@{testMethod}">
681                     <customize2>
682                         <syspropertyset>
683                             <propertyref prefix="test-sys-prop."/>
684                             <mapper from="test-sys-prop.*" to="*" type="glob"/>
685                         </syspropertyset>
686                     </customize2>
687                 </j2semodularproject1:testng-debug-impl>
688             </sequential>
689         </macrodef>
690     </target>
691     <target depends="-init-macrodef-test-debug-junit,-init-macrodef-test-debug-testng" name="-init-macrodef-test-debug"/>
692     <!--
693                 pre NB7.2 profiling section; consider it deprecated
694             -->
695     <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check" if="profiler.info.jvmargs.agent" name="profile-init"/>
696     <target if="profiler.info.jvmargs.agent" name="-profile-pre-init">
697         <!-- Empty placeholder for easier customization. -->
698         <!-- You can override this target in the ../build.xml file. -->
699     </target>
700     <target if="profiler.info.jvmargs.agent" name="-profile-post-init">
701         <!-- Empty placeholder for easier customization. -->
702         <!-- You can override this target in the ../build.xml file. -->
703     </target>
704     <target if="profiler.info.jvmargs.agent" name="-profile-init-macrodef-profile">
705         <macrodef name="resolve">
706             <attribute name="name"/>
707             <attribute name="value"/>
708             <sequential>
709                 <property name="@{name}" value="${env.@{value}}"/>
710             </sequential>
711         </macrodef>
712         <macrodef name="profile">
713             <attribute default="${main.class}" name="classname"/>
714             <element name="customize" optional="true"/>
715             <sequential>
716                 <property environment="env"/>
717                 <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
718                 <java classname="@{classname}" dir="${profiler.info.dir}" failonerror="${java.failonerror}" fork="true" jvm="${profiler.info.jvm}">
719                     <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
720                     <jvmarg value="${profiler.info.jvmargs.agent}"/>
721                     <jvmarg line="${profiler.info.jvmargs}"/>
722                     <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
723                     <arg line="${application.args}"/>
724                     <classpath>
725                         <path path="${run.classpath}"/>
726                     </classpath>
727                     <syspropertyset>
728                         <propertyref prefix="run-sys-prop."/>
729                         <mapper from="run-sys-prop.*" to="*" type="glob"/>
730                     </syspropertyset>
731                     <customize/>
732                 </java>
733             </sequential>
734         </macrodef>
735     </target>
736     <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile" if="profiler.info.jvmargs.agent" name="-profile-init-check">
737         <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail>
738         <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
739     </target>
740     <!--
741                 end of pre NB7.2 profiling section
742             -->
743     <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
744         <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-modular-project/1">
745             <attribute default="${main.class}" name="name"/>
746             <attribute default="${debug.modulepath}" name="modulepath"/>
747             <attribute default="${debug.classpath}" name="classpath"/>
748             <attribute default="" name="stopclassname"/>
749             <sequential>
750                 <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport}">
751                     <modulepath>
752                         <path path="@{modulepath}"/>
753                     </modulepath>
754                     <classpath>
755                         <path path="@{classpath}"/>
756                     </classpath>
757                     <bootclasspath>
758                         <path path="${platform.bootcp}"/>
759                     </bootclasspath>
760                 </nbjpdastart>
761             </sequential>
762         </macrodef>
763         <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-modular-project/1">
764             <attribute default="${debug.modules.dir}" name="dir"/>
765             <sequential>
766                 <nbjpdareload>
767                     <fileset dir="@{dir}" includes="${fix.classes}">
768                         <include name="*/${fix.includes}*.class"/>
769                     </fileset>
770                 </nbjpdareload>
771             </sequential>
772         </macrodef>
773     </target>
774     <target name="-init-debug-args">
775         <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
776             <os family="windows"/>
777         </condition>
778         <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}">
779             <isset property="debug.transport"/>
780         </condition>
781     </target>
782     <target depends="-init-debug-args" name="-init-macrodef-debug">
783         <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-modular-project/1">
784             <attribute default="${module.name}" name="modulename"/>
785             <attribute default="${main.class}" name="classname"/>
786             <attribute default="${debug.modulepath}" name="modulepath"/>
787             <attribute default="${debug.classpath}" name="classpath"/>
788             <element name="customizeDebuggee" optional="true"/>
789             <sequential>
790                 <j2semodularproject1:java xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" classname="@{classname}" classpath="@{classpath}" modulename="@{modulename}" modulepath="@{modulepath}">
791                     <customize>
792                         <jvmarg value="-agentlib:jdwp=transport=${debug-transport},address=${jpda.address}"/>
793                         <customizeDebuggee/>
794                     </customize>
795                 </j2semodularproject1:java>
796             </sequential>
797         </macrodef>
798     </target>
799     <target depends="-init-source-module-properties" name="-init-macrodef-java">
800         <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-modular-project/1">
801             <attribute default="${module.name}" name="modulename"/>
802             <attribute default="${main.class}" name="classname"/>
803             <attribute default="${run.modulepath}" name="modulepath"/>
804             <attribute default="${run.upgrademodulepath}" name="upgrademodulepath"/>
805             <attribute default="${run.classpath}" name="classpath"/>
806             <attribute default="jvm" name="jvm"/>
807             <element name="customize" optional="true"/>
808             <sequential>
809                 <java classname="@{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true" jvm="${platform.java}" module="@{modulename}">
810                     <classpath>
811                         <path path="@{classpath}"/>
812                     </classpath>
813                     <modulepath>
814                         <path path="@{modulepath}"/>
815                     </modulepath>
816                     <upgrademodulepath>
817                         <path path="@{upgrademodulepath}"/>
818                     </upgrademodulepath>
819                     <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
820                     <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
821                     <jvmarg line="${run.jvmargs}"/>
822                     <jvmarg line="${run.jvmargs.ide}"/>
823                     <syspropertyset>
824                         <propertyref prefix="run-sys-prop."/>
825                         <mapper from="run-sys-prop.*" to="*" type="glob"/>
826                     </syspropertyset>
827                     <customize/>
828                 </java>
829             </sequential>
830         </macrodef>
831     </target>
832     <target name="-init-presetdef-jar">
833         <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-modular-project/1">
834             <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}" manifestencoding="UTF-8">
835                 <j2semodularproject1:fileset xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" dir="${build.classes.dir}" excludes="${dist.archive.excludes}"/>
836             </jar>
837         </presetdef>
838     </target>
839     <target name="-init-ap-cmdline-properties">
840         <property name="annotation.processing.enabled" value="true"/>
841         <property name="annotation.processing.processors.list" value=""/>
842         <property name="annotation.processing.processor.options" value=""/>
843         <property name="annotation.processing.run.all.processors" value="true"/>
844         <property name="javac.processorpath" value="${javac.classpath}"/>
845         <property name="javac.test.processorpath" value="${javac.test.classpath}"/>
846     </target>
847     <target depends="-init-ap-cmdline-properties" name="-init-ap-cmdline-supported">
848         <condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}">
849             <isfalse value="${annotation.processing.run.all.processors}"/>
850         </condition>
851         <condition else="" property="ap.proc.none.internal" value="-proc:none">
852             <isfalse value="${annotation.processing.enabled}"/>
853         </condition>
854     </target>
855     <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline">
856         <property name="ap.cmd.line.internal" value=""/>
857     </target>
858     <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac-depend,-init-macrodef-test,-init-macrodef-test-debug,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar,-init-ap-cmdline" name="init"/>
859     <!--
860                 ===================
861                 COMPILATION SECTION
862                 ===================
863             -->
864     <target name="-deps-jar-init" unless="built-jar.properties">
865         <property location="${build.dir}/built-jar.properties" name="built-jar.properties"/>
866         <delete file="${built-jar.properties}" quiet="true"/>
867     </target>
868     <target if="already.built.jar.${basedir}" name="-warn-already-built-jar">
869         <echo level="warn" message="Cycle detected: notzed.zcl was already built"/>
870     </target>
871     <target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps">
872         <mkdir dir="${build.dir}"/>
873         <touch file="${built-jar.properties}" verbose="false"/>
874         <property file="${built-jar.properties}" prefix="already.built.jar."/>
875         <antcall target="-warn-already-built-jar"/>
876         <propertyfile file="${built-jar.properties}">
877             <entry key="${basedir}" value=""/>
878         </propertyfile>
879     </target>
880     <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
881     <target depends="init" name="-check-automatic-build">
882         <available file="${build.modules.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/>
883     </target>
884     <target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build">
885         <antcall target="clean">
886             <param name="no.dependencies" value="true"/>
887         </antcall>
888     </target>
889     <target name="-pre-pre-compile">
890         <mkdir dir="${build.modules.dir}"/>
891     </target>
892     <target name="-pre-compile">
893         <!-- Empty placeholder for easier customization. -->
894         <!-- You can override this target in the ../build.xml file. -->
895     </target>
896     <scriptdef language="javascript" name="coalesce_keyvalue" uri="http://www.netbeans.org/ns/j2se-modular-project/1">
897         <attribute name="property"/>
898         <attribute name="value"/>
899         <attribute name="value-sep"/>
900         <attribute name="entry-sep"/>
901         <attribute name="multi-sep"/>
902         <attribute name="out-sep"/>
903                             
904
905             function coalesce(input, keyValueSeparator, multiSeparator, entrySeparator) {
906                 var result = [];
907                 var values = {};
908
909                 (typeof input === "string" ? input.split(entrySeparator) : input).forEach(function(entry) {
910                     var idx = entry.indexOf(keyValueSeparator);
911                     if (idx &lt; 1) {
912                         result.push(entry);
913                     } else {
914                         var key = entry.substring(0, idx);
915                         var val = entry.substring(idx + 1);
916                         if (!values[key]) {
917                             values[key] = [];
918                         }
919                         values[key].push(val.trim());
920                     }
921                 });
922                 Object.keys(values).sort().forEach(function(k) {
923                     result.push(k + keyValueSeparator + values[k].join(multiSeparator));
924                 });
925                 return result.join(" " + entrySeparator);
926             }
927             self.project.setProperty(attributes.get("property"),
928                 coalesce(attributes.get("value"), 
929                 attributes.get("value-sep"), 
930                 attributes.get("entry-sep"),
931                 attributes.get("multi-sep")
932             ));
933             
934             
935     
936     </scriptdef>
937     <scriptdef language="javascript" name="modsource_regexp" uri="http://www.netbeans.org/ns/j2se-modular-project/1">
938         <attribute name="property"/>
939         <attribute name="filePattern"/>
940         <attribute name="modsource"/>
941                         function expandGroup(grp) {
942             var exp = [];
943             var item = "";
944             var depth = 0;
945
946             for (i = 0; i &lt; grp.length; i++) {
947                 var c = grp[i];
948                 switch (c) {
949                     case '{':
950                         if (depth++ === 0) {
951                             continue;
952                         }
953                         break;
954                     case '}':
955                         if (--depth === 0) {
956                             exp.push(item);
957                             continue;
958                         }
959                         break;
960                     case ',':
961                         if (depth === 1) {
962                             exp.push(item);
963                             item = "";
964                             continue;
965                         }
966                     default:
967                         break;
968                 }
969                 item = item + c;
970             }
971             return exp;
972         }
973
974         function pathVariants(spec, res) {
975             res = res || [];
976             var start  = spec.indexOf('{');
977             if (start === -1) {
978                 res.push(spec);
979                 return res;
980             }
981             var depth = 1;
982             var end;
983             for (end = start + 1; end &lt; spec.length &amp;&amp; depth &gt; 0; end++) {
984                 var c = spec[end];
985                 switch (c) {
986                     case '{': depth++; break;
987                     case '}': depth--; break;
988                 }
989             }
990             var prefix = spec.substring(0, start);
991             var suffix = spec.substring(end);
992             expandGroup(spec.slice(start, end)).forEach(function (item) {
993                 pathVariants(prefix + item + suffix, res);
994             })
995             return res;
996         }
997
998         function toRegexp2(spec, filepattern, separator) {
999             var prefixes = [];
1000             var suffixes = [];
1001             pathVariants(spec).forEach(function(item) {
1002                 suffixes.push(item);
1003             });
1004             var tail = "";
1005             var separatorString = separator;
1006             if (separatorString == "\\") {
1007                 separatorString = "\\\\";
1008             }
1009             if (filepattern &amp;&amp; filepattern != tail) {
1010                 tail = separatorString + filepattern;
1011             }
1012             return "([^" + separatorString +"]+)\\Q" + separator + "\\E(" + suffixes.join("|") + ")" + tail;
1013         }
1014                 self.project.setProperty(attributes.get("property"), 
1015                     toRegexp2(attributes.get("modsource"), attributes.get("filepattern"), self.project.getProperty("file.separator")));
1016             
1017             
1018             
1019     
1020     </scriptdef>
1021     <target if="do.depend.true" name="-compile-depend">
1022         <pathconvert property="build.generated.subdirs">
1023             <dirset dir="${build.generated.sources.dir}" erroronmissingdir="false">
1024                 <include name="*"/>
1025             </dirset>
1026         </pathconvert>
1027         <j2semodularproject1:depend xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" srcdir="${src.gen2.dir}:${src.dir}:${build.generated.subdirs}"/>
1028     </target>
1029     <target depends="init,deps-jar,-pre-pre-compile,-pre-compile,-compile-depend" if="have.sources" name="-do-compile">
1030         <j2semodularproject1:javac xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" gensrcdir="${build.generated.sources.dir}"/>
1031         <j2semodularproject1:modsource_regexp xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" filePattern="(.*$)" modsource="${src.gen2.dir.path}" property="src.gen2.dir.path.regexp"/>
1032         <echo message="Copying resources from ${src.gen2.dir}"/>
1033         <copy todir="${build.modules.dir}">
1034             <fileset dir="${src.gen2.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
1035             <regexpmapper from="${src.gen2.dir.path.regexp}" to="\1/\3"/>
1036         </copy>
1037         <j2semodularproject1:modsource_regexp xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" filePattern="(.*$)" modsource="${src.dir.path}" property="src.dir.path.regexp"/>
1038         <echo message="Copying resources from ${src.dir}"/>
1039         <copy todir="${build.modules.dir}">
1040             <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
1041             <regexpmapper from="${src.dir.path.regexp}" to="\1/\3"/>
1042         </copy>
1043     </target>
1044     <target if="has.persistence.xml" name="-copy-persistence-xml">
1045         <fail message="XXX: Not supported on MM projects"/>
1046         <mkdir dir="${build.classes.dir}/META-INF"/>
1047         <copy todir="${build.classes.dir}/META-INF">
1048             <fileset dir="${meta.inf.dir}" includes="persistence.xml orm.xml"/>
1049         </copy>
1050     </target>
1051     <target name="-post-compile">
1052         <!-- Empty placeholder for easier customization. -->
1053         <!-- You can override this target in the ../build.xml file. -->
1054     </target>
1055     <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
1056     <target name="-pre-compile-single">
1057         <!-- Empty placeholder for easier customization. -->
1058         <!-- You can override this target in the ../build.xml file. -->
1059     </target>
1060     <target depends="init,deps-jar" name="-do-compile-single">
1061         <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
1062         <j2semodularproject1:force-recompile xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1"/>
1063         <j2semodularproject1:javac xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}, module-info.java"/>
1064     </target>
1065     <target name="-post-compile-single">
1066         <!-- Empty placeholder for easier customization. -->
1067         <!-- You can override this target in the ../build.xml file. -->
1068     </target>
1069     <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
1070     <!--
1071                 ====================
1072                 JAR BUILDING SECTION
1073                 ====================
1074             -->
1075     <target depends="init,compile" name="-check-module-main-class">
1076         <condition property="do.module.main.class">
1077             <and>
1078                 <available file="${module.dir}/module-info.class"/>
1079                 <isset property="main.class.check.available"/>
1080             </and>
1081         </condition>
1082     </target>
1083     <target depends="init" name="-pre-pre-jar">
1084         <dirname file="${dist.jar}" property="dist.jar.dir"/>
1085         <mkdir dir="${dist.jar.dir}"/>
1086     </target>
1087     <target name="-pre-jar">
1088         <!-- Empty placeholder for easier customization. -->
1089         <!-- You can override this target in the ../build.xml file. -->
1090     </target>
1091     <target name="-pre-single-jar"/>
1092     <target depends="-pre-single-jar" if="module.jar.filename" name="-make-single-jar">
1093         <jar basedir="${module.dir}" compress="${jar.compress}" destfile="${dist.dir}/${module.jar.filename}" excludes="${dist.archive.excludes}" manifestencoding="UTF-8"/>
1094     </target>
1095     <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive" name="-do-jar-jar" unless="do.mkdist">
1096         <property location="${build.modules.dir}" name="build.modules.dir.resolved"/>
1097         <dirset dir="${build.modules.dir.resolved}" id="do.jar.dirs" includes="*"/>
1098         <pathconvert property="do.jar.dir.list" refid="do.jar.dirs">
1099             <identitymapper/>
1100         </pathconvert>
1101         <j2semodularproject1:for-paths xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" paths="${do.jar.dir.list}">
1102             <local name="module.jar.filename"/>
1103             <local name="module.jar.name.tmp"/>
1104             <basename file="${entry}" property="module.jar.name.tmp"/>
1105             <property name="module.jar.filename" value="${module.jar.name.tmp}.jar"/>
1106             <antcall inheritRefs="true" target="-make-single-jar">
1107                 <param name="module.jar.filename" value="${module.jar.filename}"/>
1108                 <param location="${entry}" name="module.dir"/>
1109             </antcall>
1110         </j2semodularproject1:for-paths>
1111         <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
1112         <property location="${dist.jar}" name="dist.jar.resolved"/>
1113         <pathconvert property="run.classpath.with.dist.jar">
1114             <path path="${run.classpath}"/>
1115             <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
1116         </pathconvert>
1117         <pathconvert property="run.modulepath.with.dist.jar">
1118             <path path="${run.modulepath}"/>
1119             <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
1120         </pathconvert>
1121         <condition else="" property="jar.usage.message.module.path" value=" -modulepath ${run.modulepath.with.dist.jar}">
1122             <and>
1123                 <isset property="modules.supported.internal"/>
1124                 <length length="0" string="${run.modulepath.with.dist.jar}" when="greater"/>
1125             </and>
1126         </condition>
1127         <condition else="" property="jar.usage.message.class.path" value=" -cp ${run.classpath.with.dist.jar}">
1128             <length length="0" string="${run.classpath.with.dist.jar}" when="greater"/>
1129         </condition>
1130         <condition else=" ${main.class}" property="jar.usage.message.main.class" value=" -m ${module.name}/${main.class}">
1131             <isset property="named.module.internal"/>
1132         </condition>
1133         <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}">
1134             <isset property="main.class.available"/>
1135         </condition>
1136         <condition else="debug" property="jar.usage.level" value="info">
1137             <isset property="main.class.available"/>
1138         </condition>
1139         <echo level="${jar.usage.level}" message="${jar.usage.message}"/>
1140     </target>
1141     <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-jar" name="-do-jar-without-libraries"/>
1142     <target depends="init,compile,-pre-pre-jar,-pre-jar" name="-do-jar-with-libraries"/>
1143     <target name="-post-jar">
1144         <!-- Empty placeholder for easier customization. -->
1145         <!-- You can override this target in the ../build.xml file. -->
1146     </target>
1147     <target depends="init,compile,-pre-jar,-do-jar-without-libraries,-do-jar-with-libraries,-post-jar" name="-do-jar"/>
1148     <target depends="init,compile,-pre-jar,-do-jar,-post-jar,deploy" description="Build JAR." name="jar"/>
1149     <!--
1150                 =================
1151                 DEPLOY SECTION
1152                 =================
1153             -->
1154     <target name="-pre-deploy">
1155         <!-- Empty placeholder for easier customization. -->
1156         <!-- You can override this target in the ../build.xml file. -->
1157     </target>
1158     <target depends="init" name="-check-jlink">
1159         <condition property="do.jlink.internal">
1160             <and>
1161                 <istrue value="${do.jlink}"/>
1162                 <isset property="do.archive"/>
1163             </and>
1164         </condition>
1165     </target>
1166     <target depends="init,-do-jar,-post-jar,-pre-deploy,-check-jlink,-main-module-set" if="do.jlink.internal" name="-do-deploy">
1167         <delete dir="${dist.jlink.dir}" failonerror="false" quiet="true"/>
1168         <property name="jlink.launcher.name" value="${application.title}"/>
1169         <pathconvert pathsep="," property="jlink.modulelist.internal">
1170             <fileset dir="${dist.dir}" includes="*.jar"/>
1171             <mapper>
1172                 <chainedmapper>
1173                     <flattenmapper/>
1174                     <globmapper from="*.jar" to="*"/>
1175                 </chainedmapper>
1176             </mapper>
1177         </pathconvert>
1178         <condition else="${jlink.modulelist.internal}" property="jlink.add.modules" value="${jlink.modulelist.internal},${jlink.additionalmodules}">
1179             <and>
1180                 <isset property="jlink.additionalmodules"/>
1181                 <length length="0" string="${jlink.additionalmodules}" when="greater"/>
1182             </and>
1183         </condition>
1184         <condition property="jlink.do.strip.internal">
1185             <and>
1186                 <isset property="jlink.strip"/>
1187                 <istrue value="${jlink.strip}"/>
1188             </and>
1189         </condition>
1190         <condition property="jlink.do.additionalparam.internal">
1191             <and>
1192                 <isset property="jlink.additionalparam"/>
1193                 <length length="0" string="${jlink.additionalparam}" when="greater"/>
1194             </and>
1195         </condition>
1196         <condition property="jlink.do.launcher.internal">
1197             <and>
1198                 <istrue value="${jlink.launcher}"/>
1199                 <isset property="module.name"/>
1200                 <length length="0" string="${module.name}" when="greater"/>
1201                 <isset property="main.class.available"/>
1202             </and>
1203         </condition>
1204         <property name="platform.jlink" value="${platform.home}/bin/jlink"/>
1205         <property name="jlink.systemmodules.internal" value="${platform.home}/jmods"/>
1206         <exec executable="${platform.jlink}">
1207             <arg value="--module-path"/>
1208             <arg path="${jlink.systemmodules.internal}:${run.modulepath}:${dist.dir}"/>
1209             <arg value="--add-modules"/>
1210             <arg value="${jlink.add.modules}"/>
1211             <arg if:set="jlink.do.strip.internal" value="--strip-debug"/>
1212             <arg if:set="jlink.do.launcher.internal" value="--launcher"/>
1213             <arg if:set="jlink.do.launcher.internal" value="${jlink.launcher.name}=${module.name}/${main.class}"/>
1214             <arg if:set="jlink.do.additionalparam.internal" line="${jlink.additionalparam}"/>
1215             <arg value="--output"/>
1216             <arg value="${dist.jlink.output}"/>
1217         </exec>
1218     </target>
1219     <target name="-post-deploy">
1220         <!-- Empty placeholder for easier customization. -->
1221         <!-- You can override this target in the ../build.xml file. -->
1222     </target>
1223     <target depends="-do-jar,-post-jar,-pre-deploy,-do-deploy,-post-deploy" name="deploy"/>
1224     <!--
1225                 =================
1226                 EXECUTION SECTION
1227                 =================
1228             -->
1229     <target name="-check-main-class">
1230         <fail unless="main.class">No main class specified</fail>
1231     </target>
1232     <target depends="init,compile,-check-main-class,-main-module-check" description="Run a main class." name="run">
1233         <property name="main.class.relativepath" refid="main.class.relativepath"/>
1234         <pathconvert pathsep="," property="src.dir.list" refid="have.sources.set"/>
1235         <j2semodularproject1:modsource_regexp xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" filePattern="(.*$)" modsource="${src.dir.path}" property="run.src.dir.path.regexp"/>
1236         <j2semodularproject1:java xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1">
1237             <customize>
1238                 <arg line="${application.args}"/>
1239             </customize>
1240         </j2semodularproject1:java>
1241     </target>
1242     <target name="-main-module-set" unless="module.name">
1243         <condition else="${main.class}" property="check.class.name" value="${run.class}">
1244             <isset property="run.class"/>
1245         </condition>
1246         <condition property="run.modules.dir" value="${build.modules.dir}">
1247             <not>
1248                 <isset property="run.modules.dir"/>
1249             </not>
1250         </condition>
1251         <resources id="main.class.relativepath">
1252             <mappedresources>
1253                 <string value="${check.class.name}"/>
1254                 <unpackagemapper from="*" to="*.class"/>
1255             </mappedresources>
1256         </resources>
1257         <property location="${run.modules.dir}" name="run.modules.dir.location"/>
1258         <pathconvert property="module.name">
1259             <fileset dir="${run.modules.dir}" includes="**/${toString:main.class.relativepath}"/>
1260             <regexpmapper from="\Q${run.modules.dir.location}${file.separator}\E([^${file.separator.string}]+)\Q${file.separator}\E.*\.class" to="\1"/>
1261         </pathconvert>
1262     </target>
1263     <target depends="-main-module-set" name="-main-module-check">
1264         <fail message="Could not determine module of the main class and module.name is not set">
1265             <condition>
1266                 <or>
1267                     <not>
1268                         <isset property="module.name"/>
1269                     </not>
1270                     <length length="0" string="${module.name}" when="equal"/>
1271                 </or>
1272             </condition>
1273         </fail>
1274     </target>
1275     <target name="-do-not-recompile">
1276         <property name="javac.includes.binary" value=""/>
1277     </target>
1278     <target depends="init,compile-single,-main-module-check" name="run-single">
1279         <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
1280         <j2semodularproject1:java xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" classname="${run.class}"/>
1281     </target>
1282     <target depends="init,compile-test-single,-init-test-run-module-properties,-main-module-check" name="run-test-with-main">
1283         <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
1284         <j2semodularproject1:java xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" classname="${run.class}" classpath="${run.test.classpath}" modulepath="${run.test.modulepath}">
1285             <customize>
1286                 <jvmarg line="${run.test.jvmargs}"/>
1287             </customize>
1288         </j2semodularproject1:java>
1289     </target>
1290     <!--
1291                 =================
1292                 DEBUGGING SECTION
1293                 =================
1294             -->
1295     <target name="-debug-init">
1296         <condition else="${main.class}" property="run.class" value="${debug.class}">
1297             <isset property="debug.class"/>
1298         </condition>
1299         <fail message="debug.class or main.class property is not set" unless="run.class"/>
1300     </target>
1301     <target depends="init,-debug-init,-main-module-check" if="netbeans.home" name="-debug-start-debugger">
1302         <j2semodularproject1:nbjpdastart xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" name="${debug.class}"/>
1303     </target>
1304     <target depends="init,-debug-init,-main-module-check" if="netbeans.home" name="-debug-start-debugger-main-test">
1305         <j2semodularproject1:nbjpdastart xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" classpath="${debug.test.classpath}" name="${debug.class}"/>
1306     </target>
1307     <target depends="init,compile,-debug-init,-main-module-check" name="-debug-start-debuggee">
1308         <j2semodularproject1:debug xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" classname="${run.class}">
1309             <customizeDebuggee>
1310                 <arg line="${application.args}"/>
1311             </customizeDebuggee>
1312         </j2semodularproject1:debug>
1313     </target>
1314     <target depends="init,compile,-debug-init,-main-module-check,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/>
1315     <target depends="init,-debug-init,-main-module-check" if="netbeans.home" name="-debug-start-debugger-stepinto">
1316         <j2semodularproject1:nbjpdastart xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" stopclassname="${debug.class}"/>
1317     </target>
1318     <target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/>
1319     <target depends="init,compile-single,-debug-init,-main-module-check" if="netbeans.home" name="-debug-start-debuggee-single">
1320         <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
1321         <j2semodularproject1:debug xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" classname="${debug.class}"/>
1322     </target>
1323     <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
1324     <target depends="init,compile-test-single,-debug-init,-main-module-check" if="netbeans.home" name="-debug-start-debuggee-main-test">
1325         <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
1326         <j2semodularproject1:debug xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" classname="${debug.class}" classpath="${debug.test.classpath}"/>
1327     </target>
1328     <target depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/>
1329     <target depends="init" name="-pre-debug-fix">
1330         <fail unless="fix.includes">Must set fix.includes</fail>
1331         <property name="javac.includes" value="${fix.includes}.java"/>
1332     </target>
1333     <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
1334         <property location="${build.modules.dir}" name="debug.modules.dir"/>
1335         <j2semodularproject1:nbjpdareload xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1"/>
1336     </target>
1337     <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
1338     <!--
1339                 =================
1340                 PROFILING SECTION
1341                 =================
1342             -->
1343     <!--
1344                 pre NB7.2 profiler integration
1345             -->
1346     <target depends="profile-init,compile" description="Profile a project in the IDE." if="profiler.info.jvmargs.agent" name="-profile-pre72">
1347         <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
1348         <nbprofiledirect>
1349             <classpath>
1350                 <path path="${run.classpath}"/>
1351             </classpath>
1352         </nbprofiledirect>
1353         <profile/>
1354     </target>
1355     <target depends="profile-init,compile-single" description="Profile a selected class in the IDE." if="profiler.info.jvmargs.agent" name="-profile-single-pre72">
1356         <fail unless="profile.class">Must select one file in the IDE or set profile.class</fail>
1357         <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
1358         <nbprofiledirect>
1359             <classpath>
1360                 <path path="${run.classpath}"/>
1361             </classpath>
1362         </nbprofiledirect>
1363         <profile classname="${profile.class}"/>
1364     </target>
1365     <target depends="profile-init,compile-single" if="profiler.info.jvmargs.agent" name="-profile-applet-pre72">
1366         <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
1367         <nbprofiledirect>
1368             <classpath>
1369                 <path path="${run.classpath}"/>
1370             </classpath>
1371         </nbprofiledirect>
1372         <profile classname="sun.applet.AppletViewer">
1373             <customize>
1374                 <arg value="${applet.url}"/>
1375             </customize>
1376         </profile>
1377     </target>
1378     <target depends="-init-macrodef-junit,profile-init,compile-test-single" if="profiler.info.jvmargs.agent" name="-profile-test-single-pre72">
1379         <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
1380         <nbprofiledirect>
1381             <classpath>
1382                 <path path="${run.test.classpath}"/>
1383             </classpath>
1384         </nbprofiledirect>
1385         <j2semodularproject1:junit xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" excludes="${excludes}" includes="${includes}" testincludes="${profile.class}" testmethods="">
1386             <customize>
1387                 <jvmarg value="-agentlib:jdwp=transport=${debug-transport},address=${jpda.address}"/>
1388                 <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
1389                 <jvmarg value="${profiler.info.jvmargs.agent}"/>
1390                 <jvmarg line="${profiler.info.jvmargs}"/>
1391                 <classpath>
1392                     <path path="${run.test.classpath}"/>
1393                 </classpath>
1394             </customize>
1395         </j2semodularproject1:junit>
1396     </target>
1397     <!--
1398                 end of pre NB72 profiling section
1399             -->
1400     <target if="netbeans.home" name="-profile-check">
1401         <condition property="profiler.configured">
1402             <or>
1403                 <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-agentpath:"/>
1404                 <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-javaagent:"/>
1405             </or>
1406         </condition>
1407     </target>
1408     <target depends="-profile-check,-profile-pre72" description="Profile a project in the IDE." if="profiler.configured" name="profile" unless="profiler.info.jvmargs.agent">
1409         <startprofiler/>
1410         <antcall target="run"/>
1411     </target>
1412     <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">
1413         <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
1414         <startprofiler/>
1415         <antcall target="run-single"/>
1416     </target>
1417     <target depends="-profile-test-single-pre72" description="Profile a selected test in the IDE." name="profile-test-single"/>
1418     <target depends="-profile-check" description="Profile a selected test in the IDE." if="profiler.configured" name="profile-test" unless="profiler.info.jvmargs">
1419         <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
1420         <startprofiler/>
1421         <antcall target="test-single"/>
1422     </target>
1423     <target depends="-profile-check" description="Profile a selected class in the IDE." if="profiler.configured" name="profile-test-with-main">
1424         <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
1425         <startprofiler/>
1426         <antcall target="run-test-with-main"/>
1427     </target>
1428     <target depends="-profile-check,-profile-applet-pre72" if="profiler.configured" name="profile-applet" unless="profiler.info.jvmargs.agent">
1429         <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
1430         <startprofiler/>
1431         <antcall target="run-applet"/>
1432     </target>
1433     <!--
1434                 ===============
1435                 JAVADOC SECTION
1436                 ===============
1437             -->
1438     <target depends="init" if="have.sources" name="-javadoc-build">
1439         <mkdir dir="${dist.javadoc.dir}"/>
1440         <condition else="" property="javadoc.endorsed.classpath.cmd.line.arg" value="-J${endorsed.classpath.cmd.line.arg}">
1441             <and>
1442                 <isset property="endorsed.classpath.cmd.line.arg"/>
1443                 <not>
1444                     <equals arg1="${endorsed.classpath.cmd.line.arg}" arg2=""/>
1445                 </not>
1446             </and>
1447         </condition>
1448         <exec executable="${platform.java}" failonerror="false" outputproperty="platform.version.output">
1449             <arg value="-version"/>
1450         </exec>
1451         <condition else="" property="bug5101868workaround" value="*.java">
1452             <matches multiline="true" pattern="1\.[56](\..*)?" string="${platform.version.output}"/>
1453         </condition>
1454         <condition else="" property="javadoc.html5.cmd.line.arg" value="-html5">
1455             <and>
1456                 <isset property="javadoc.html5"/>
1457                 <available file="${platform.home}${file.separator}lib${file.separator}jrt-fs.jar"/>
1458             </and>
1459         </condition>
1460         <javadoc additionalparam="-J-Dfile.encoding=${file.encoding} ${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" executable="${platform.javadoc}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
1461             <classpath>
1462                 <path path="${javac.classpath}"/>
1463             </classpath>
1464             <fileset dir="${src.gen2.dir}" excludes="${bug5101868workaround},${excludes}" includes="${includes}">
1465                 <filename name="**/*.java"/>
1466             </fileset>
1467             <fileset dir="${src.dir}" excludes="${bug5101868workaround},${excludes}" includes="${includes}">
1468                 <filename name="**/*.java"/>
1469             </fileset>
1470             <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
1471                 <include name="**/*.java"/>
1472                 <exclude name="*.java"/>
1473             </fileset>
1474             <arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/>
1475             <arg line="${javadoc.html5.cmd.line.arg}"/>
1476         </javadoc>
1477         <copy todir="${dist.javadoc.dir}">
1478             <fileset dir="${src.gen2.dir}" excludes="${excludes}" includes="${includes}">
1479                 <filename name="**/doc-files/**"/>
1480             </fileset>
1481             <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
1482                 <filename name="**/doc-files/**"/>
1483             </fileset>
1484             <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
1485                 <include name="**/doc-files/**"/>
1486             </fileset>
1487         </copy>
1488     </target>
1489     <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
1490         <nbbrowse file="${dist.javadoc.dir}/index.html"/>
1491     </target>
1492     <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
1493     <!--
1494                 =========================
1495                 TEST COMPILATION SECTION
1496                 =========================
1497             -->
1498     <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
1499         <mkdir dir="${build.test.modules.dir}"/>
1500     </target>
1501     <target name="-pre-compile-test">
1502         <!-- Empty placeholder for easier customization. -->
1503         <!-- You can override this target in the ../build.xml file. -->
1504     </target>
1505     <target depends="-init-source-module-properties" name="-init-test-run-module-properties">
1506         <fileset dir="${build.test.modules.dir}" id="run.test.packages.internal" includes="**/*.class"/>
1507         <property location="${build.test.modules.dir}" name="build.test.modules.dir.abs.internal"/>
1508         <pathconvert pathsep=" " property="run.test.addexports.internal" refid="run.test.packages.internal">
1509             <chainedmapper>
1510                 <filtermapper>
1511                     <replacestring from="${build.test.modules.dir.abs.internal}${file.separator}" to=""/>
1512                 </filtermapper>
1513                 <regexpmapper from="^([^${file.separator.string}]*)\Q${file.separator}\E(.*)\Q${file.separator}\E.*\.class$$" to="\1${path.separator}\2"/>
1514                 <filtermapper>
1515                     <uniqfilter/>
1516                     <replacestring from="${file.separator}" to="."/>
1517                 </filtermapper>
1518                 <regexpmapper from="([^${file.separator.string}]+)${path.separator}(.*)" to="--add-exports \1/\2=ALL-UNNAMED"/>
1519             </chainedmapper>
1520         </pathconvert>
1521         <property location="${build.test.modules.dir}" name="build.test.modules.location"/>
1522         <pathconvert pathsep="," property="run.test.addmodules.list">
1523             <map from="${build.test.modules.location}${file.separator}" to=""/>
1524             <dirset dir="${build.test.modules.dir}" includes="*"/>
1525             <chainedmapper>
1526                 <filtermapper>
1527                     <uniqfilter/>
1528                 </filtermapper>
1529             </chainedmapper>
1530         </pathconvert>
1531         <pathconvert pathsep=" " property="run.test.patchmodules.list">
1532             <dirset dir="${build.test.modules.dir}" includes="*">
1533                 <scriptselector language="javascript">
1534                             self.setSelected(!new java.io.File(file, "module-info.class").exists());
1535                         </scriptselector>
1536             </dirset>
1537             <chainedmapper>
1538                 <filtermapper>
1539                     <uniqfilter/>
1540                 </filtermapper>
1541                 <regexpmapper from=".*\Q${file.separator}\E([^${file.separator.string}]+)$" to="--patch-module \1=\0"/>
1542             </chainedmapper>
1543         </pathconvert>
1544         <j2semodularproject1:coalesce_keyvalue xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" entry-sep="${path.separator}" multi-sep="--patch-module " property="run.test.patchmodules" value="${run.test.patchmodules.list}" value-sep="="/>
1545         <condition else="" property="run.test.addmodules.internal" value="--add-modules ${run.test.addmodules.list}">
1546             <isset property="run.test.addmodules.list"/>
1547         </condition>
1548         <pathconvert pathsep=" " property="run.test.addreads.internal">
1549             <map from="${build.test.modules.location}" to=""/>
1550             <dirset dir="${build.test.modules.dir}" includes="*"/>
1551             <chainedmapper>
1552                 <regexpmapper from="^\Q${build.test.modules.location}${file.separator}\E(.*)" to="\1"/>
1553                 <regexpmapper from="(.*)" to="--add-reads \1=ALL-UNNAMED"/>
1554                 <filtermapper>
1555                     <uniqfilter/>
1556                 </filtermapper>
1557             </chainedmapper>
1558         </pathconvert>
1559         <property name="run.test.jvmargs" value="${run.test.addmodules.internal} ${run.test.addreads.internal} ${run.test.addexports.internal} ${run.test.patchmodules}"/>
1560     </target>
1561     <target depends="-init-source-module-properties" name="-init-test-javac-module-properties">
1562         <pathconvert pathsep=" " property="compile.test.patchmodule.internal" refid="have.tests.patchset">
1563             <regexpmapper from="(.*\Q${file.separator}\E)([^${file.separator.string}]+)\Q${file.separator}\E(.*)$$" to="--patch-module \2=\1\2${file.separator.string}\3"/>
1564         </pathconvert>
1565         <pathconvert pathsep=" " property="compile.test.addreads">
1566             <union refid="have.tests.set"/>
1567             <chainedmapper>
1568                 <firstmatchmapper>
1569                     <regexpmapper from="${have.tests.test.src.dir.regexp}" to="\1"/>
1570                 </firstmatchmapper>
1571                 <regexpmapper from="(.*)" to="--add-reads \1=ALL-UNNAMED"/>
1572                 <filtermapper>
1573                     <uniqfilter/>
1574                 </filtermapper>
1575             </chainedmapper>
1576         </pathconvert>
1577         <j2semodularproject1:coalesce_keyvalue xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" entry-sep="${path.separator}" multi-sep="--patch-module " property="compile.test.patchmodules" value="${compile.test.patchmodule.internal}" value-sep="="/>
1578         <property name="javac.test.moduleargs" value="${compile.test.patchmodules} ${compile.test.addreads}"/>
1579     </target>
1580     <target depends="-init-test-javac-module-properties" name="-init-test-module-properties">
1581         <property location="${build.modules.dir}" name="test.module.build.location"/>
1582         <property name="test.source.modulepath" value="${test.src.dir}/*/${test.src.dir.path}"/>
1583         <property name="test.compile.modulepath" value="${javac.test.modulepath}:${build.modules.dir}"/>
1584         <macrodef name="test-javac" uri="http://www.netbeans.org/ns/j2se-modular-project/1">
1585             <attribute default="${includes}" name="includes"/>
1586             <attribute default="${excludes}" name="excludes"/>
1587             <element implicit="true" name="additionalargs" optional="true"/>
1588             <sequential>
1589                 <j2semodularproject1:javac xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" apgeneratedsrcdir="${build.test.modules.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.modules.dir}" excludes="@{excludes}" includes="@{includes}" modulepath="${test.compile.modulepath}" modulesourcepath="${test.source.modulepath}" processorpath="${javac.test.processorpath}">
1590                     <customize>
1591                         <compilerarg line="${javac.test.moduleargs}"/>
1592                         <additionalargs/>
1593                     </customize>
1594                 </j2semodularproject1:javac>
1595             </sequential>
1596         </macrodef>
1597     </target>
1598     <target if="do.depend.true" name="-compile-test-depend">
1599         <j2semodularproject1:depend xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
1600     </target>
1601     <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">
1602         <j2semodularproject1:test-javac xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1"/>
1603         <j2semodularproject1:modsource_regexp xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" filePattern="(.*$)" modsource="${test.src.dir.path}" property="test.src.dir.path.regexp"/>
1604         <echo message="Copying resources from ${test.src.dir}"/>
1605         <copy todir="${build.test.modules.dir}">
1606             <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
1607             <regexpmapper from="${test.src.dir.path.regexp}" to="\1/\3"/>
1608         </copy>
1609     </target>
1610     <target name="-post-compile-test">
1611         <!-- Empty placeholder for easier customization. -->
1612         <!-- You can override this target in the ../build.xml file. -->
1613     </target>
1614     <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
1615     <target name="-pre-compile-test-single">
1616         <!-- Empty placeholder for easier customization. -->
1617         <!-- You can override this target in the ../build.xml file. -->
1618     </target>
1619     <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">
1620         <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
1621         <j2semodularproject1:force-recompile xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" destdir="${build.test.modules.dir}"/>
1622         <j2semodularproject1:test-javac xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" includes="${javac.includes}"/>
1623         <j2semodularproject1:modsource_regexp xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" filePattern="(.*$)" modsource="${test.src.dir.path}" property="test.src.dir.path.regexp"/>
1624         <echo message="Copying resources from ${test.src.dir}"/>
1625         <copy todir="${build.test.modules.dir}">
1626             <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
1627             <regexpmapper from="${test.src.dir.path.regexp}" to="\1/\3"/>
1628         </copy>
1629     </target>
1630     <target name="-post-compile-test-single">
1631         <!-- Empty placeholder for easier customization. -->
1632         <!-- You can override this target in the ../build.xml file. -->
1633     </target>
1634     <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
1635     <!--
1636                 =======================
1637                 TEST EXECUTION SECTION
1638                 =======================
1639             -->
1640     <target depends="init" if="have.tests" name="-pre-test-run">
1641         <mkdir dir="${build.test.results.dir}"/>
1642     </target>
1643     <target name="-init-test-run">
1644         <property name="run.modules.dir" value="${build.test.modules.dir}"/>
1645     </target>
1646     <target depends="init,compile-test,-init-test-run-module-properties,-pre-test-run" if="have.tests" name="-do-test-run">
1647         <j2semodularproject1:test xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" includes="${includes}" testincludes="**/*Test.java"/>
1648     </target>
1649     <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
1650         <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
1651     </target>
1652     <target depends="init" if="have.tests" name="test-report"/>
1653     <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
1654     <target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/>
1655     <target depends="init" if="have.tests" name="-pre-test-run-single">
1656         <mkdir dir="${build.test.results.dir}"/>
1657     </target>
1658     <target depends="init,compile-test-single,-init-test-run-module-properties,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
1659         <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
1660         <j2semodularproject1:test xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" excludes="" includes="${test.includes}" testincludes="${test.includes}"/>
1661     </target>
1662     <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
1663         <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
1664     </target>
1665     <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"/>
1666     <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single-method">
1667         <fail unless="test.class">Must select some files in the IDE or set test.class</fail>
1668         <fail unless="test.method">Must select some method in the IDE or set test.method</fail>
1669         <j2semodularproject1:test xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" excludes="" includes="${javac.includes}" testincludes="${test.class}" testmethods="${test.method}"/>
1670     </target>
1671     <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single-method" if="have.tests" name="-post-test-run-single-method">
1672         <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
1673     </target>
1674     <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"/>
1675     <!--
1676                 =======================
1677                 TEST DEBUGGING SECTION
1678                 =======================
1679             -->
1680     <target depends="init,compile-test-single,-init-test-run-module-properties,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test">
1681         <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
1682         <j2semodularproject1:test-debug xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" excludes="" includes="${javac.includes}" testClass="${test.class}" testincludes="${javac.includes}"/>
1683     </target>
1684     <target depends="init,compile-test-single,-init-test-run-module-properties,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test-method">
1685         <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
1686         <fail unless="test.method">Must select some method in the IDE or set test.method</fail>
1687         <j2semodularproject1:test-debug xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" excludes="" includes="${javac.includes}" testClass="${test.class}" testMethod="${test.method}" testincludes="${test.class}" testmethods="${test.method}"/>
1688     </target>
1689     <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
1690         <j2semodularproject1:nbjpdastart xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" classpath="${debug.test.classpath}" name="${test.class}"/>
1691     </target>
1692     <target depends="init,compile-test-single,-init-test-run-module-properties,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
1693     <target depends="init,compile-test-single,-init-test-run-module-properties,-debug-start-debugger-test,-debug-start-debuggee-test-method" name="debug-test-method"/>
1694     <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
1695         <property name="debug.modules.dir" value="${build.test.modules.dir}"/>
1696         <j2semodularproject1:nbjpdareload xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1"/>
1697     </target>
1698     <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
1699     <!--
1700                 =========================
1701                 APPLET EXECUTION SECTION
1702                 =========================
1703             -->
1704     <target name="run-applet">
1705         <fail message="Applets are no longer supported by JDK 9"/>
1706     </target>
1707     <!--
1708                 =========================
1709                 APPLET DEBUGGING  SECTION
1710                 =========================
1711             -->
1712     <target name="-debug-start-debuggee-applet">
1713         <fail message="Applets are no longer supported by JDK 9"/>
1714     </target>
1715     <target name="debug-applet">
1716         <fail message="Applets are no longer supported by JDK 9"/>
1717     </target>
1718     <!--
1719                 ===============
1720                 CLEANUP SECTION
1721                 ===============
1722             -->
1723     <target name="-deps-clean-init" unless="built-clean.properties">
1724         <property location="${build.dir}/built-clean.properties" name="built-clean.properties"/>
1725         <delete file="${built-clean.properties}" quiet="true"/>
1726     </target>
1727     <target if="already.built.clean.${basedir}" name="-warn-already-built-clean">
1728         <echo level="warn" message="Cycle detected: notzed.zcl was already built"/>
1729     </target>
1730     <target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps">
1731         <mkdir dir="${build.dir}"/>
1732         <touch file="${built-clean.properties}" verbose="false"/>
1733         <property file="${built-clean.properties}" prefix="already.built.clean."/>
1734         <antcall target="-warn-already-built-clean"/>
1735         <propertyfile file="${built-clean.properties}">
1736             <entry key="${basedir}" value=""/>
1737         </propertyfile>
1738     </target>
1739     <target depends="init" name="-do-clean">
1740         <delete dir="${build.dir}"/>
1741         <delete dir="${dist.jlink.output}"/>
1742         <delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/>
1743     </target>
1744     <target name="-post-clean">
1745         <!-- Empty placeholder for easier customization. -->
1746         <!-- You can override this target in the ../build.xml file. -->
1747     </target>
1748     <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
1749     <target name="-check-call-dep">
1750         <property file="${call.built.properties}" prefix="already.built."/>
1751         <condition property="should.call.dep">
1752             <and>
1753                 <not>
1754                     <isset property="already.built.${call.subproject}"/>
1755                 </not>
1756                 <available file="${call.script}"/>
1757             </and>
1758         </condition>
1759     </target>
1760     <target depends="-check-call-dep" if="should.call.dep" name="-maybe-call-dep">
1761         <ant antfile="${call.script}" inheritall="false" target="${call.target}">
1762             <propertyset>
1763                 <propertyref prefix="transfer."/>
1764                 <mapper from="transfer.*" to="*" type="glob"/>
1765             </propertyset>
1766         </ant>
1767     </target>
1768 </project>