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