Initial import of pre-beta 1.0.
[nativez] / 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.nativez-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.nativez" 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.nativez -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.nativez 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     </target>
846     <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
847     <target depends="init" name="-check-automatic-build">
848         <available file="${build.modules.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/>
849     </target>
850     <target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build">
851         <antcall target="clean">
852             <param name="no.dependencies" value="true"/>
853         </antcall>
854     </target>
855     <target name="-pre-pre-compile">
856         <mkdir dir="${build.modules.dir}"/>
857     </target>
858     <target name="-pre-compile">
859         <!-- Empty placeholder for easier customization. -->
860         <!-- You can override this target in the ../build.xml file. -->
861     </target>
862     <scriptdef language="javascript" name="coalesce_keyvalue" uri="http://www.netbeans.org/ns/j2se-modular-project/1">
863         <attribute name="property"/>
864         <attribute name="value"/>
865         <attribute name="value-sep"/>
866         <attribute name="entry-sep"/>
867         <attribute name="multi-sep"/>
868         <attribute name="out-sep"/>
869                             
870
871             function coalesce(input, keyValueSeparator, multiSeparator, entrySeparator) {
872                 var result = [];
873                 var values = {};
874
875                 (typeof input === "string" ? input.split(entrySeparator) : input).forEach(function(entry) {
876                     var idx = entry.indexOf(keyValueSeparator);
877                     if (idx &lt; 1) {
878                         result.push(entry);
879                     } else {
880                         var key = entry.substring(0, idx);
881                         var val = entry.substring(idx + 1);
882                         if (!values[key]) {
883                             values[key] = [];
884                         }
885                         values[key].push(val.trim());
886                     }
887                 });
888                 Object.keys(values).sort().forEach(function(k) {
889                     result.push(k + keyValueSeparator + values[k].join(multiSeparator));
890                 });
891                 return result.join(" " + entrySeparator);
892             }
893             self.project.setProperty(attributes.get("property"),
894                 coalesce(attributes.get("value"), 
895                 attributes.get("value-sep"), 
896                 attributes.get("entry-sep"),
897                 attributes.get("multi-sep")
898             ));
899             
900             
901     
902     </scriptdef>
903     <scriptdef language="javascript" name="modsource_regexp" uri="http://www.netbeans.org/ns/j2se-modular-project/1">
904         <attribute name="property"/>
905         <attribute name="filePattern"/>
906         <attribute name="modsource"/>
907                         function expandGroup(grp) {
908             var exp = [];
909             var item = "";
910             var depth = 0;
911
912             for (i = 0; i &lt; grp.length; i++) {
913                 var c = grp[i];
914                 switch (c) {
915                     case '{':
916                         if (depth++ === 0) {
917                             continue;
918                         }
919                         break;
920                     case '}':
921                         if (--depth === 0) {
922                             exp.push(item);
923                             continue;
924                         }
925                         break;
926                     case ',':
927                         if (depth === 1) {
928                             exp.push(item);
929                             item = "";
930                             continue;
931                         }
932                     default:
933                         break;
934                 }
935                 item = item + c;
936             }
937             return exp;
938         }
939
940         function pathVariants(spec, res) {
941             res = res || [];
942             var start  = spec.indexOf('{');
943             if (start === -1) {
944                 res.push(spec);
945                 return res;
946             }
947             var depth = 1;
948             var end;
949             for (end = start + 1; end &lt; spec.length &amp;&amp; depth &gt; 0; end++) {
950                 var c = spec[end];
951                 switch (c) {
952                     case '{': depth++; break;
953                     case '}': depth--; break;
954                 }
955             }
956             var prefix = spec.substring(0, start);
957             var suffix = spec.substring(end);
958             expandGroup(spec.slice(start, end)).forEach(function (item) {
959                 pathVariants(prefix + item + suffix, res);
960             })
961             return res;
962         }
963
964         function toRegexp2(spec, filepattern, separator) {
965             var prefixes = [];
966             var suffixes = [];
967             pathVariants(spec).forEach(function(item) {
968                 suffixes.push(item);
969             });
970             var tail = "";
971             var separatorString = separator;
972             if (separatorString == "\\") {
973                 separatorString = "\\\\";
974             }
975             if (filepattern &amp;&amp; filepattern != tail) {
976                 tail = separatorString + filepattern;
977             }
978             return "([^" + separatorString +"]+)\\Q" + separator + "\\E(" + suffixes.join("|") + ")" + tail;
979         }
980                 self.project.setProperty(attributes.get("property"), 
981                     toRegexp2(attributes.get("modsource"), attributes.get("filepattern"), self.project.getProperty("file.separator")));
982             
983             
984             
985     
986     </scriptdef>
987     <target if="do.depend.true" name="-compile-depend">
988         <pathconvert property="build.generated.subdirs">
989             <dirset dir="${build.generated.sources.dir}" erroronmissingdir="false">
990                 <include name="*"/>
991             </dirset>
992         </pathconvert>
993         <j2semodularproject1:depend xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" srcdir="${src.dir}:${build.generated.subdirs}"/>
994     </target>
995     <target depends="init,deps-jar,-pre-pre-compile,-pre-compile,-compile-depend" if="have.sources" name="-do-compile">
996         <j2semodularproject1:javac xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" gensrcdir="${build.generated.sources.dir}"/>
997         <j2semodularproject1:modsource_regexp xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" filePattern="(.*$)" modsource="${src.dir.path}" property="src.dir.path.regexp"/>
998         <echo message="Copying resources from ${src.dir}"/>
999         <copy todir="${build.modules.dir}">
1000             <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
1001             <regexpmapper from="${src.dir.path.regexp}" to="\1/\3"/>
1002         </copy>
1003     </target>
1004     <target if="has.persistence.xml" name="-copy-persistence-xml">
1005         <fail message="XXX: Not supported on MM projects"/>
1006         <mkdir dir="${build.classes.dir}/META-INF"/>
1007         <copy todir="${build.classes.dir}/META-INF">
1008             <fileset dir="${meta.inf.dir}" includes="persistence.xml orm.xml"/>
1009         </copy>
1010     </target>
1011     <target name="-post-compile">
1012         <!-- Empty placeholder for easier customization. -->
1013         <!-- You can override this target in the ../build.xml file. -->
1014     </target>
1015     <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
1016     <target name="-pre-compile-single">
1017         <!-- Empty placeholder for easier customization. -->
1018         <!-- You can override this target in the ../build.xml file. -->
1019     </target>
1020     <target depends="init,deps-jar" name="-do-compile-single">
1021         <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
1022         <j2semodularproject1:force-recompile xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1"/>
1023         <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"/>
1024     </target>
1025     <target name="-post-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,-verify-automatic-build,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
1030     <!--
1031                 ====================
1032                 JAR BUILDING SECTION
1033                 ====================
1034             -->
1035     <target depends="init,compile" name="-check-module-main-class">
1036         <condition property="do.module.main.class">
1037             <and>
1038                 <available file="${module.dir}/module-info.class"/>
1039                 <isset property="main.class.check.available"/>
1040             </and>
1041         </condition>
1042     </target>
1043     <target depends="init" name="-pre-pre-jar">
1044         <dirname file="${dist.jar}" property="dist.jar.dir"/>
1045         <mkdir dir="${dist.jar.dir}"/>
1046     </target>
1047     <target name="-pre-jar">
1048         <!-- Empty placeholder for easier customization. -->
1049         <!-- You can override this target in the ../build.xml file. -->
1050     </target>
1051     <target name="-pre-single-jar"/>
1052     <target depends="-pre-single-jar" if="module.jar.filename" name="-make-single-jar">
1053         <jar basedir="${module.dir}" compress="${jar.compress}" destfile="${dist.dir}/${module.jar.filename}" excludes="${dist.archive.excludes}" manifestencoding="UTF-8"/>
1054     </target>
1055     <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive" name="-do-jar-jar" unless="do.mkdist">
1056         <property location="${build.modules.dir}" name="build.modules.dir.resolved"/>
1057         <dirset dir="${build.modules.dir.resolved}" id="do.jar.dirs" includes="*"/>
1058         <pathconvert property="do.jar.dir.list" refid="do.jar.dirs">
1059             <identitymapper/>
1060         </pathconvert>
1061         <j2semodularproject1:for-paths xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" paths="${do.jar.dir.list}">
1062             <local name="module.jar.filename"/>
1063             <local name="module.jar.name.tmp"/>
1064             <basename file="${entry}" property="module.jar.name.tmp"/>
1065             <property name="module.jar.filename" value="${module.jar.name.tmp}.jar"/>
1066             <antcall inheritRefs="true" target="-make-single-jar">
1067                 <param name="module.jar.filename" value="${module.jar.filename}"/>
1068                 <param location="${entry}" name="module.dir"/>
1069             </antcall>
1070         </j2semodularproject1:for-paths>
1071         <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
1072         <property location="${dist.jar}" name="dist.jar.resolved"/>
1073         <pathconvert property="run.classpath.with.dist.jar">
1074             <path path="${run.classpath}"/>
1075             <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
1076         </pathconvert>
1077         <pathconvert property="run.modulepath.with.dist.jar">
1078             <path path="${run.modulepath}"/>
1079             <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
1080         </pathconvert>
1081         <condition else="" property="jar.usage.message.module.path" value=" -modulepath ${run.modulepath.with.dist.jar}">
1082             <and>
1083                 <isset property="modules.supported.internal"/>
1084                 <length length="0" string="${run.modulepath.with.dist.jar}" when="greater"/>
1085             </and>
1086         </condition>
1087         <condition else="" property="jar.usage.message.class.path" value=" -cp ${run.classpath.with.dist.jar}">
1088             <length length="0" string="${run.classpath.with.dist.jar}" when="greater"/>
1089         </condition>
1090         <condition else=" ${main.class}" property="jar.usage.message.main.class" value=" -m ${module.name}/${main.class}">
1091             <isset property="named.module.internal"/>
1092         </condition>
1093         <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}">
1094             <isset property="main.class.available"/>
1095         </condition>
1096         <condition else="debug" property="jar.usage.level" value="info">
1097             <isset property="main.class.available"/>
1098         </condition>
1099         <echo level="${jar.usage.level}" message="${jar.usage.message}"/>
1100     </target>
1101     <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-jar" name="-do-jar-without-libraries"/>
1102     <target depends="init,compile,-pre-pre-jar,-pre-jar" name="-do-jar-with-libraries"/>
1103     <target name="-post-jar">
1104         <!-- Empty placeholder for easier customization. -->
1105         <!-- You can override this target in the ../build.xml file. -->
1106     </target>
1107     <target depends="init,compile,-pre-jar,-do-jar-without-libraries,-do-jar-with-libraries,-post-jar" name="-do-jar"/>
1108     <target depends="init,compile,-pre-jar,-do-jar,-post-jar,deploy" description="Build JAR." name="jar"/>
1109     <!--
1110                 =================
1111                 DEPLOY SECTION
1112                 =================
1113             -->
1114     <target name="-pre-deploy">
1115         <!-- Empty placeholder for easier customization. -->
1116         <!-- You can override this target in the ../build.xml file. -->
1117     </target>
1118     <target depends="init" name="-check-jlink">
1119         <condition property="do.jlink.internal">
1120             <and>
1121                 <istrue value="${do.jlink}"/>
1122                 <isset property="do.archive"/>
1123             </and>
1124         </condition>
1125     </target>
1126     <target depends="init,-do-jar,-post-jar,-pre-deploy,-check-jlink,-main-module-set" if="do.jlink.internal" name="-do-deploy">
1127         <delete dir="${dist.jlink.dir}" failonerror="false" quiet="true"/>
1128         <property name="jlink.launcher.name" value="${application.title}"/>
1129         <pathconvert pathsep="," property="jlink.modulelist.internal">
1130             <fileset dir="${dist.dir}" includes="*.jar"/>
1131             <mapper>
1132                 <chainedmapper>
1133                     <flattenmapper/>
1134                     <globmapper from="*.jar" to="*"/>
1135                 </chainedmapper>
1136             </mapper>
1137         </pathconvert>
1138         <condition else="${jlink.modulelist.internal}" property="jlink.add.modules" value="${jlink.modulelist.internal},${jlink.additionalmodules}">
1139             <and>
1140                 <isset property="jlink.additionalmodules"/>
1141                 <length length="0" string="${jlink.additionalmodules}" when="greater"/>
1142             </and>
1143         </condition>
1144         <condition property="jlink.do.strip.internal">
1145             <and>
1146                 <isset property="jlink.strip"/>
1147                 <istrue value="${jlink.strip}"/>
1148             </and>
1149         </condition>
1150         <condition property="jlink.do.additionalparam.internal">
1151             <and>
1152                 <isset property="jlink.additionalparam"/>
1153                 <length length="0" string="${jlink.additionalparam}" when="greater"/>
1154             </and>
1155         </condition>
1156         <condition property="jlink.do.launcher.internal">
1157             <and>
1158                 <istrue value="${jlink.launcher}"/>
1159                 <isset property="module.name"/>
1160                 <length length="0" string="${module.name}" when="greater"/>
1161                 <isset property="main.class.available"/>
1162             </and>
1163         </condition>
1164         <property name="platform.jlink" value="${jdk.home}/bin/jlink"/>
1165         <property name="jlink.systemmodules.internal" value="${jdk.home}/jmods"/>
1166         <exec executable="${platform.jlink}">
1167             <arg value="--module-path"/>
1168             <arg path="${jlink.systemmodules.internal}:${run.modulepath}:${dist.dir}"/>
1169             <arg value="--add-modules"/>
1170             <arg value="${jlink.add.modules}"/>
1171             <arg if:set="jlink.do.strip.internal" value="--strip-debug"/>
1172             <arg if:set="jlink.do.launcher.internal" value="--launcher"/>
1173             <arg if:set="jlink.do.launcher.internal" value="${jlink.launcher.name}=${module.name}/${main.class}"/>
1174             <arg if:set="jlink.do.additionalparam.internal" line="${jlink.additionalparam}"/>
1175             <arg value="--output"/>
1176             <arg value="${dist.jlink.output}"/>
1177         </exec>
1178     </target>
1179     <target name="-post-deploy">
1180         <!-- Empty placeholder for easier customization. -->
1181         <!-- You can override this target in the ../build.xml file. -->
1182     </target>
1183     <target depends="-do-jar,-post-jar,-pre-deploy,-do-deploy,-post-deploy" name="deploy"/>
1184     <!--
1185                 =================
1186                 EXECUTION SECTION
1187                 =================
1188             -->
1189     <target name="-check-main-class">
1190         <fail unless="main.class">No main class specified</fail>
1191     </target>
1192     <target depends="init,compile,-check-main-class,-main-module-check" description="Run a main class." name="run">
1193         <property name="main.class.relativepath" refid="main.class.relativepath"/>
1194         <pathconvert pathsep="," property="src.dir.list" refid="have.sources.set"/>
1195         <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"/>
1196         <j2semodularproject1:java xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1">
1197             <customize>
1198                 <arg line="${application.args}"/>
1199             </customize>
1200         </j2semodularproject1:java>
1201     </target>
1202     <target name="-main-module-set" unless="module.name">
1203         <condition else="${main.class}" property="check.class.name" value="${run.class}">
1204             <isset property="run.class"/>
1205         </condition>
1206         <condition property="run.modules.dir" value="${build.modules.dir}">
1207             <not>
1208                 <isset property="run.modules.dir"/>
1209             </not>
1210         </condition>
1211         <resources id="main.class.relativepath">
1212             <mappedresources>
1213                 <string value="${check.class.name}"/>
1214                 <unpackagemapper from="*" to="*.class"/>
1215             </mappedresources>
1216         </resources>
1217         <property location="${run.modules.dir}" name="run.modules.dir.location"/>
1218         <pathconvert property="module.name">
1219             <fileset dir="${run.modules.dir}" includes="**/${toString:main.class.relativepath}"/>
1220             <regexpmapper from="\Q${run.modules.dir.location}${file.separator}\E([^${file.separator.string}]+)\Q${file.separator}\E.*\.class" to="\1"/>
1221         </pathconvert>
1222     </target>
1223     <target depends="-main-module-set" name="-main-module-check">
1224         <fail message="Could not determine module of the main class and module.name is not set">
1225             <condition>
1226                 <or>
1227                     <not>
1228                         <isset property="module.name"/>
1229                     </not>
1230                     <length length="0" string="${module.name}" when="equal"/>
1231                 </or>
1232             </condition>
1233         </fail>
1234     </target>
1235     <target name="-do-not-recompile">
1236         <property name="javac.includes.binary" value=""/>
1237     </target>
1238     <target depends="init,compile-single,-main-module-check" name="run-single">
1239         <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
1240         <j2semodularproject1:java xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" classname="${run.class}"/>
1241     </target>
1242     <target depends="init,compile-test-single,-init-test-run-module-properties,-main-module-check" name="run-test-with-main">
1243         <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
1244         <j2semodularproject1:java xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" classname="${run.class}" classpath="${run.test.classpath}" modulepath="${run.test.modulepath}">
1245             <customize>
1246                 <jvmarg line="${run.test.jvmargs}"/>
1247             </customize>
1248         </j2semodularproject1:java>
1249     </target>
1250     <!--
1251                 =================
1252                 DEBUGGING SECTION
1253                 =================
1254             -->
1255     <target name="-debug-init">
1256         <condition else="${main.class}" property="run.class" value="${debug.class}">
1257             <isset property="debug.class"/>
1258         </condition>
1259         <fail message="debug.class or main.class property is not set" unless="run.class"/>
1260     </target>
1261     <target depends="init,-debug-init,-main-module-check" if="netbeans.home" name="-debug-start-debugger">
1262         <j2semodularproject1:nbjpdastart xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" name="${debug.class}"/>
1263     </target>
1264     <target depends="init,-debug-init,-main-module-check" if="netbeans.home" name="-debug-start-debugger-main-test">
1265         <j2semodularproject1:nbjpdastart xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" classpath="${debug.test.classpath}" name="${debug.class}"/>
1266     </target>
1267     <target depends="init,compile,-debug-init,-main-module-check" name="-debug-start-debuggee">
1268         <j2semodularproject1:debug xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" classname="${run.class}">
1269             <customizeDebuggee>
1270                 <arg line="${application.args}"/>
1271             </customizeDebuggee>
1272         </j2semodularproject1:debug>
1273     </target>
1274     <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"/>
1275     <target depends="init,-debug-init,-main-module-check" if="netbeans.home" name="-debug-start-debugger-stepinto">
1276         <j2semodularproject1:nbjpdastart xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" stopclassname="${debug.class}"/>
1277     </target>
1278     <target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/>
1279     <target depends="init,compile-single,-debug-init,-main-module-check" if="netbeans.home" name="-debug-start-debuggee-single">
1280         <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
1281         <j2semodularproject1:debug xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" classname="${debug.class}"/>
1282     </target>
1283     <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
1284     <target depends="init,compile-test-single,-debug-init,-main-module-check" if="netbeans.home" name="-debug-start-debuggee-main-test">
1285         <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
1286         <j2semodularproject1:debug xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" classname="${debug.class}" classpath="${debug.test.classpath}"/>
1287     </target>
1288     <target depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/>
1289     <target depends="init" name="-pre-debug-fix">
1290         <fail unless="fix.includes">Must set fix.includes</fail>
1291         <property name="javac.includes" value="${fix.includes}.java"/>
1292     </target>
1293     <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
1294         <property location="${build.modules.dir}" name="debug.modules.dir"/>
1295         <j2semodularproject1:nbjpdareload xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1"/>
1296     </target>
1297     <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
1298     <!--
1299                 =================
1300                 PROFILING SECTION
1301                 =================
1302             -->
1303     <!--
1304                 pre NB7.2 profiler integration
1305             -->
1306     <target depends="profile-init,compile" description="Profile a project in the IDE." if="profiler.info.jvmargs.agent" name="-profile-pre72">
1307         <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
1308         <nbprofiledirect>
1309             <classpath>
1310                 <path path="${run.classpath}"/>
1311             </classpath>
1312         </nbprofiledirect>
1313         <profile/>
1314     </target>
1315     <target depends="profile-init,compile-single" description="Profile a selected class in the IDE." if="profiler.info.jvmargs.agent" name="-profile-single-pre72">
1316         <fail unless="profile.class">Must select one file in the IDE or set profile.class</fail>
1317         <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
1318         <nbprofiledirect>
1319             <classpath>
1320                 <path path="${run.classpath}"/>
1321             </classpath>
1322         </nbprofiledirect>
1323         <profile classname="${profile.class}"/>
1324     </target>
1325     <target depends="profile-init,compile-single" if="profiler.info.jvmargs.agent" name="-profile-applet-pre72">
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="sun.applet.AppletViewer">
1333             <customize>
1334                 <arg value="${applet.url}"/>
1335             </customize>
1336         </profile>
1337     </target>
1338     <target depends="-init-macrodef-junit,profile-init,compile-test-single" if="profiler.info.jvmargs.agent" name="-profile-test-single-pre72">
1339         <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
1340         <nbprofiledirect>
1341             <classpath>
1342                 <path path="${run.test.classpath}"/>
1343             </classpath>
1344         </nbprofiledirect>
1345         <j2semodularproject1:junit xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" excludes="${excludes}" includes="${includes}" testincludes="${profile.class}" testmethods="">
1346             <customize>
1347                 <jvmarg value="-agentlib:jdwp=transport=${debug-transport},address=${jpda.address}"/>
1348                 <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
1349                 <jvmarg value="${profiler.info.jvmargs.agent}"/>
1350                 <jvmarg line="${profiler.info.jvmargs}"/>
1351                 <classpath>
1352                     <path path="${run.test.classpath}"/>
1353                 </classpath>
1354             </customize>
1355         </j2semodularproject1:junit>
1356     </target>
1357     <!--
1358                 end of pre NB72 profiling section
1359             -->
1360     <target if="netbeans.home" name="-profile-check">
1361         <condition property="profiler.configured">
1362             <or>
1363                 <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-agentpath:"/>
1364                 <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-javaagent:"/>
1365             </or>
1366         </condition>
1367     </target>
1368     <target depends="-profile-check,-profile-pre72" description="Profile a project in the IDE." if="profiler.configured" name="profile" unless="profiler.info.jvmargs.agent">
1369         <startprofiler/>
1370         <antcall target="run"/>
1371     </target>
1372     <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">
1373         <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
1374         <startprofiler/>
1375         <antcall target="run-single"/>
1376     </target>
1377     <target depends="-profile-test-single-pre72" description="Profile a selected test in the IDE." name="profile-test-single"/>
1378     <target depends="-profile-check" description="Profile a selected test in the IDE." if="profiler.configured" name="profile-test" unless="profiler.info.jvmargs">
1379         <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
1380         <startprofiler/>
1381         <antcall target="test-single"/>
1382     </target>
1383     <target depends="-profile-check" description="Profile a selected class in the IDE." if="profiler.configured" name="profile-test-with-main">
1384         <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
1385         <startprofiler/>
1386         <antcall target="run-test-with-main"/>
1387     </target>
1388     <target depends="-profile-check,-profile-applet-pre72" if="profiler.configured" name="profile-applet" unless="profiler.info.jvmargs.agent">
1389         <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
1390         <startprofiler/>
1391         <antcall target="run-applet"/>
1392     </target>
1393     <!--
1394                 ===============
1395                 JAVADOC SECTION
1396                 ===============
1397             -->
1398     <target depends="init" if="have.sources" name="-javadoc-build">
1399         <mkdir dir="${dist.javadoc.dir}"/>
1400         <condition else="" property="javadoc.endorsed.classpath.cmd.line.arg" value="-J${endorsed.classpath.cmd.line.arg}">
1401             <and>
1402                 <isset property="endorsed.classpath.cmd.line.arg"/>
1403                 <not>
1404                     <equals arg1="${endorsed.classpath.cmd.line.arg}" arg2=""/>
1405                 </not>
1406             </and>
1407         </condition>
1408         <condition else="" property="bug5101868workaround" value="*.java">
1409             <matches pattern="1\.[56](\..*)?" string="${java.version}"/>
1410         </condition>
1411         <condition else="" property="javadoc.html5.cmd.line.arg" value="-html5">
1412             <and>
1413                 <isset property="javadoc.html5"/>
1414                 <available file="${jdk.home}${file.separator}lib${file.separator}jrt-fs.jar"/>
1415             </and>
1416         </condition>
1417         <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}">
1418             <classpath>
1419                 <path path="${javac.classpath}"/>
1420             </classpath>
1421             <fileset dir="${src.dir}" excludes="${bug5101868workaround},${excludes}" includes="${includes}">
1422                 <filename name="**/*.java"/>
1423             </fileset>
1424             <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
1425                 <include name="**/*.java"/>
1426                 <exclude name="*.java"/>
1427             </fileset>
1428             <arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/>
1429             <arg line="${javadoc.html5.cmd.line.arg}"/>
1430         </javadoc>
1431         <copy todir="${dist.javadoc.dir}">
1432             <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
1433                 <filename name="**/doc-files/**"/>
1434             </fileset>
1435             <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
1436                 <include name="**/doc-files/**"/>
1437             </fileset>
1438         </copy>
1439     </target>
1440     <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
1441         <nbbrowse file="${dist.javadoc.dir}/index.html"/>
1442     </target>
1443     <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
1444     <!--
1445                 =========================
1446                 TEST COMPILATION SECTION
1447                 =========================
1448             -->
1449     <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
1450         <mkdir dir="${build.test.modules.dir}"/>
1451     </target>
1452     <target name="-pre-compile-test">
1453         <!-- Empty placeholder for easier customization. -->
1454         <!-- You can override this target in the ../build.xml file. -->
1455     </target>
1456     <target depends="-init-source-module-properties" name="-init-test-run-module-properties">
1457         <fileset dir="${build.test.modules.dir}" id="run.test.packages.internal" includes="**/*.class"/>
1458         <property location="${build.test.modules.dir}" name="build.test.modules.dir.abs.internal"/>
1459         <pathconvert pathsep=" " property="run.test.addexports.internal" refid="run.test.packages.internal">
1460             <chainedmapper>
1461                 <filtermapper>
1462                     <replacestring from="${build.test.modules.dir.abs.internal}${file.separator}" to=""/>
1463                 </filtermapper>
1464                 <regexpmapper from="^([^${file.separator.string}]*)\Q${file.separator}\E(.*)\Q${file.separator}\E.*\.class$$" to="\1${path.separator}\2"/>
1465                 <filtermapper>
1466                     <uniqfilter/>
1467                     <replacestring from="${file.separator}" to="."/>
1468                 </filtermapper>
1469                 <regexpmapper from="([^${file.separator.string}]+)${path.separator}(.*)" to="--add-exports \1/\2=ALL-UNNAMED"/>
1470             </chainedmapper>
1471         </pathconvert>
1472         <property location="${build.test.modules.dir}" name="build.test.modules.location"/>
1473         <pathconvert pathsep="," property="run.test.addmodules.list">
1474             <map from="${build.test.modules.location}${file.separator}" to=""/>
1475             <dirset dir="${build.test.modules.dir}" includes="*"/>
1476             <chainedmapper>
1477                 <filtermapper>
1478                     <uniqfilter/>
1479                 </filtermapper>
1480             </chainedmapper>
1481         </pathconvert>
1482         <pathconvert pathsep=" " property="run.test.patchmodules.list">
1483             <dirset dir="${build.test.modules.dir}" includes="*">
1484                 <scriptselector language="javascript">
1485                             self.setSelected(!new java.io.File(file, "module-info.class").exists());
1486                         </scriptselector>
1487             </dirset>
1488             <chainedmapper>
1489                 <filtermapper>
1490                     <uniqfilter/>
1491                 </filtermapper>
1492                 <regexpmapper from=".*\Q${file.separator}\E([^${file.separator.string}]+)$" to="--patch-module \1=\0"/>
1493             </chainedmapper>
1494         </pathconvert>
1495         <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="="/>
1496         <condition else="" property="run.test.addmodules.internal" value="--add-modules ${run.test.addmodules.list}">
1497             <isset property="run.test.addmodules.list"/>
1498         </condition>
1499         <pathconvert pathsep=" " property="run.test.addreads.internal">
1500             <map from="${build.test.modules.location}" to=""/>
1501             <dirset dir="${build.test.modules.dir}" includes="*"/>
1502             <chainedmapper>
1503                 <regexpmapper from="^\Q${build.test.modules.location}${file.separator}\E(.*)" to="\1"/>
1504                 <regexpmapper from="(.*)" to="--add-reads \1=ALL-UNNAMED"/>
1505                 <filtermapper>
1506                     <uniqfilter/>
1507                 </filtermapper>
1508             </chainedmapper>
1509         </pathconvert>
1510         <property name="run.test.jvmargs" value="${run.test.addmodules.internal} ${run.test.addreads.internal} ${run.test.addexports.internal} ${run.test.patchmodules}"/>
1511     </target>
1512     <target depends="-init-source-module-properties" name="-init-test-javac-module-properties">
1513         <pathconvert pathsep=" " property="compile.test.patchmodule.internal" refid="have.tests.patchset">
1514             <regexpmapper from="(.*\Q${file.separator}\E)([^${file.separator.string}]+)\Q${file.separator}\E(.*)$$" to="--patch-module \2=\1\2${file.separator.string}\3"/>
1515         </pathconvert>
1516         <pathconvert pathsep=" " property="compile.test.addreads">
1517             <union refid="have.tests.set"/>
1518             <chainedmapper>
1519                 <firstmatchmapper>
1520                     <regexpmapper from="${have.tests.test.src.dir.regexp}" to="\1"/>
1521                 </firstmatchmapper>
1522                 <regexpmapper from="(.*)" to="--add-reads \1=ALL-UNNAMED"/>
1523                 <filtermapper>
1524                     <uniqfilter/>
1525                 </filtermapper>
1526             </chainedmapper>
1527         </pathconvert>
1528         <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="="/>
1529         <property name="javac.test.moduleargs" value="${compile.test.patchmodules} ${compile.test.addreads}"/>
1530     </target>
1531     <target depends="-init-test-javac-module-properties" name="-init-test-module-properties">
1532         <property location="${build.modules.dir}" name="test.module.build.location"/>
1533         <property name="test.source.modulepath" value="${test.src.dir}/*/${test.src.dir.path}"/>
1534         <property name="test.compile.modulepath" value="${javac.test.modulepath}:${build.modules.dir}"/>
1535         <macrodef name="test-javac" uri="http://www.netbeans.org/ns/j2se-modular-project/1">
1536             <attribute default="${includes}" name="includes"/>
1537             <attribute default="${excludes}" name="excludes"/>
1538             <element implicit="true" name="additionalargs" optional="true"/>
1539             <sequential>
1540                 <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}">
1541                     <customize>
1542                         <compilerarg line="${javac.test.moduleargs}"/>
1543                         <additionalargs/>
1544                     </customize>
1545                 </j2semodularproject1:javac>
1546             </sequential>
1547         </macrodef>
1548     </target>
1549     <target if="do.depend.true" name="-compile-test-depend">
1550         <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}"/>
1551     </target>
1552     <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">
1553         <j2semodularproject1:test-javac xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1"/>
1554         <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"/>
1555         <echo message="Copying resources from ${test.src.dir}"/>
1556         <copy todir="${build.test.modules.dir}">
1557             <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
1558             <regexpmapper from="${test.src.dir.path.regexp}" to="\1/\3"/>
1559         </copy>
1560     </target>
1561     <target name="-post-compile-test">
1562         <!-- Empty placeholder for easier customization. -->
1563         <!-- You can override this target in the ../build.xml file. -->
1564     </target>
1565     <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
1566     <target name="-pre-compile-test-single">
1567         <!-- Empty placeholder for easier customization. -->
1568         <!-- You can override this target in the ../build.xml file. -->
1569     </target>
1570     <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">
1571         <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
1572         <j2semodularproject1:force-recompile xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" destdir="${build.test.modules.dir}"/>
1573         <j2semodularproject1:test-javac xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" includes="${javac.includes}"/>
1574         <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"/>
1575         <echo message="Copying resources from ${test.src.dir}"/>
1576         <copy todir="${build.test.modules.dir}">
1577             <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
1578             <regexpmapper from="${test.src.dir.path.regexp}" to="\1/\3"/>
1579         </copy>
1580     </target>
1581     <target name="-post-compile-test-single">
1582         <!-- Empty placeholder for easier customization. -->
1583         <!-- You can override this target in the ../build.xml file. -->
1584     </target>
1585     <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
1586     <!--
1587                 =======================
1588                 TEST EXECUTION SECTION
1589                 =======================
1590             -->
1591     <target depends="init" if="have.tests" name="-pre-test-run">
1592         <mkdir dir="${build.test.results.dir}"/>
1593     </target>
1594     <target name="-init-test-run">
1595         <property name="run.modules.dir" value="${build.test.modules.dir}"/>
1596     </target>
1597     <target depends="init,compile-test,-init-test-run-module-properties,-pre-test-run" if="have.tests" name="-do-test-run">
1598         <j2semodularproject1:test xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" includes="${includes}" testincludes="**/*Test.java"/>
1599     </target>
1600     <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
1601         <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
1602     </target>
1603     <target depends="init" if="have.tests" name="test-report"/>
1604     <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
1605     <target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/>
1606     <target depends="init" if="have.tests" name="-pre-test-run-single">
1607         <mkdir dir="${build.test.results.dir}"/>
1608     </target>
1609     <target depends="init,compile-test-single,-init-test-run-module-properties,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
1610         <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
1611         <j2semodularproject1:test xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" excludes="" includes="${test.includes}" testincludes="${test.includes}"/>
1612     </target>
1613     <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
1614         <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
1615     </target>
1616     <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"/>
1617     <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single-method">
1618         <fail unless="test.class">Must select some files in the IDE or set test.class</fail>
1619         <fail unless="test.method">Must select some method in the IDE or set test.method</fail>
1620         <j2semodularproject1:test xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" excludes="" includes="${javac.includes}" testincludes="${test.class}" testmethods="${test.method}"/>
1621     </target>
1622     <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single-method" if="have.tests" name="-post-test-run-single-method">
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-method,-post-test-run-single-method" description="Run single unit test." name="test-single-method"/>
1626     <!--
1627                 =======================
1628                 TEST DEBUGGING SECTION
1629                 =======================
1630             -->
1631     <target depends="init,compile-test-single,-init-test-run-module-properties,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test">
1632         <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
1633         <j2semodularproject1:test-debug xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" excludes="" includes="${javac.includes}" testClass="${test.class}" testincludes="${javac.includes}"/>
1634     </target>
1635     <target depends="init,compile-test-single,-init-test-run-module-properties,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test-method">
1636         <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
1637         <fail unless="test.method">Must select some method in the IDE or set test.method</fail>
1638         <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}"/>
1639     </target>
1640     <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
1641         <j2semodularproject1:nbjpdastart xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" classpath="${debug.test.classpath}" name="${test.class}"/>
1642     </target>
1643     <target depends="init,compile-test-single,-init-test-run-module-properties,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
1644     <target depends="init,compile-test-single,-init-test-run-module-properties,-debug-start-debugger-test,-debug-start-debuggee-test-method" name="debug-test-method"/>
1645     <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
1646         <property name="debug.modules.dir" value="${build.test.modules.dir}"/>
1647         <j2semodularproject1:nbjpdareload xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1"/>
1648     </target>
1649     <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
1650     <!--
1651                 =========================
1652                 APPLET EXECUTION SECTION
1653                 =========================
1654             -->
1655     <target name="run-applet">
1656         <fail message="Applets are no longer supported by JDK 9"/>
1657     </target>
1658     <!--
1659                 =========================
1660                 APPLET DEBUGGING  SECTION
1661                 =========================
1662             -->
1663     <target name="-debug-start-debuggee-applet">
1664         <fail message="Applets are no longer supported by JDK 9"/>
1665     </target>
1666     <target name="debug-applet">
1667         <fail message="Applets are no longer supported by JDK 9"/>
1668     </target>
1669     <!--
1670                 ===============
1671                 CLEANUP SECTION
1672                 ===============
1673             -->
1674     <target name="-deps-clean-init" unless="built-clean.properties">
1675         <property location="${build.dir}/built-clean.properties" name="built-clean.properties"/>
1676         <delete file="${built-clean.properties}" quiet="true"/>
1677     </target>
1678     <target if="already.built.clean.${basedir}" name="-warn-already-built-clean">
1679         <echo level="warn" message="Cycle detected: notzed.nativez was already built"/>
1680     </target>
1681     <target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps">
1682         <mkdir dir="${build.dir}"/>
1683         <touch file="${built-clean.properties}" verbose="false"/>
1684         <property file="${built-clean.properties}" prefix="already.built.clean."/>
1685         <antcall target="-warn-already-built-clean"/>
1686         <propertyfile file="${built-clean.properties}">
1687             <entry key="${basedir}" value=""/>
1688         </propertyfile>
1689     </target>
1690     <target depends="init" name="-do-clean">
1691         <delete dir="${build.dir}"/>
1692         <delete dir="${dist.jlink.output}"/>
1693         <delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/>
1694     </target>
1695     <target name="-post-clean">
1696         <!-- Empty placeholder for easier customization. -->
1697         <!-- You can override this target in the ../build.xml file. -->
1698     </target>
1699     <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
1700     <target name="-check-call-dep">
1701         <property file="${call.built.properties}" prefix="already.built."/>
1702         <condition property="should.call.dep">
1703             <and>
1704                 <not>
1705                     <isset property="already.built.${call.subproject}"/>
1706                 </not>
1707                 <available file="${call.script}"/>
1708             </and>
1709         </condition>
1710     </target>
1711     <target depends="-check-call-dep" if="should.call.dep" name="-maybe-call-dep">
1712         <ant antfile="${call.script}" inheritall="false" target="${call.target}">
1713             <propertyset>
1714                 <propertyref prefix="transfer."/>
1715                 <mapper from="transfer.*" to="*" type="glob"/>
1716             </propertyset>
1717         </ant>
1718     </target>
1719 </project>