This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 267729
Collapse All | Expand All

(-)a/groovy.samples/sample_src/GroovyJavaDemo/nbproject/build-impl.xml (-113 / +859 lines)
Lines 12-26 Link Here
12
  - execution
12
  - execution
13
  - debugging
13
  - debugging
14
  - javadoc
14
  - javadoc
15
  - junit compilation
15
  - test compilation
16
  - junit execution
16
  - test execution
17
  - junit debugging
17
  - test debugging
18
  - applet
18
  - applet
19
  - cleanup
19
  - cleanup
20
20
21
        -->
21
        -->
22
<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="GroovyJavaDemo-impl">
22
<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="GroovyJavaDemo-impl">
23
    <import file="groovy-build.xml"/>
23
    <import file="groovy-build.xml"/>
24
    <fail message="Please build using Ant 1.8.0 or higher.">
25
        <condition>
26
            <not>
27
                <antversion atleast="1.8.0"/>
28
            </not>
29
        </condition>
30
    </fail>
24
    <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
31
    <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
25
    <!-- 
32
    <!-- 
26
                ======================
33
                ======================
Lines 48-67 Link Here
48
        <property file="nbproject/project.properties"/>
55
        <property file="nbproject/project.properties"/>
49
    </target>
56
    </target>
50
    <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init">
57
    <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init">
58
        <property name="platform.java" value="${java.home}/bin/java"/>
51
        <available file="${manifest.file}" property="manifest.available"/>
59
        <available file="${manifest.file}" property="manifest.available"/>
52
        <condition property="manifest.available+main.class">
60
        <condition property="splashscreen.available">
53
            <and>
61
            <and>
54
                <isset property="manifest.available"/>
62
                <not>
63
                    <equals arg1="${application.splash}" arg2="" trim="true"/>
64
                </not>
65
                <available file="${application.splash}"/>
66
            </and>
67
        </condition>
68
        <condition property="main.class.available">
69
            <and>
55
                <isset property="main.class"/>
70
                <isset property="main.class"/>
56
                <not>
71
                <not>
57
                    <equals arg1="${main.class}" arg2="" trim="true"/>
72
                    <equals arg1="${main.class}" arg2="" trim="true"/>
58
                </not>
73
                </not>
59
            </and>
74
            </and>
60
        </condition>
75
        </condition>
61
        <condition property="manifest.available+main.class+mkdist.available">
76
        <condition property="profile.available">
62
            <and>
77
            <and>
63
                <istrue value="${manifest.available+main.class}"/>
78
                <isset property="javac.profile"/>
79
                <length length="0" string="${javac.profile}" when="greater"/>
80
                <matches pattern="1\.[89](\..*)?" string="${javac.source}"/>
81
            </and>
82
        </condition>
83
        <condition property="do.archive">
84
            <or>
85
                <not>
86
                    <istrue value="${jar.archive.disabled}"/>
87
                </not>
88
                <istrue value="${not.archive.disabled}"/>
89
            </or>
90
        </condition>
91
        <condition property="do.mkdist">
92
            <and>
93
                <isset property="do.archive"/>
64
                <isset property="libs.CopyLibs.classpath"/>
94
                <isset property="libs.CopyLibs.classpath"/>
95
                <not>
96
                    <istrue value="${mkdist.disabled}"/>
97
                </not>
98
            </and>
99
        </condition>
100
        <condition property="do.archive+manifest.available">
101
            <and>
102
                <isset property="manifest.available"/>
103
                <istrue value="${do.archive}"/>
104
            </and>
105
        </condition>
106
        <condition property="do.archive+main.class.available">
107
            <and>
108
                <isset property="main.class.available"/>
109
                <istrue value="${do.archive}"/>
110
            </and>
111
        </condition>
112
        <condition property="do.archive+splashscreen.available">
113
            <and>
114
                <isset property="splashscreen.available"/>
115
                <istrue value="${do.archive}"/>
116
            </and>
117
        </condition>
118
        <condition property="do.archive+profile.available">
119
            <and>
120
                <isset property="profile.available"/>
121
                <istrue value="${do.archive}"/>
65
            </and>
122
            </and>
66
        </condition>
123
        </condition>
67
        <condition property="have.tests">
124
        <condition property="have.tests">
Lines 87-92 Link Here
87
            </and>
144
            </and>
88
        </condition>
145
        </condition>
89
        <property name="run.jvmargs" value=""/>
146
        <property name="run.jvmargs" value=""/>
147
        <property name="run.jvmargs.ide" value=""/>
90
        <property name="javac.compilerargs" value=""/>
148
        <property name="javac.compilerargs" value=""/>
91
        <property name="work.dir" value="${basedir}"/>
149
        <property name="work.dir" value="${basedir}"/>
92
        <condition property="no.deps">
150
        <condition property="no.deps">
Lines 98-103 Link Here
98
        <property name="javadoc.preview" value="true"/>
156
        <property name="javadoc.preview" value="true"/>
99
        <property name="application.args" value=""/>
157
        <property name="application.args" value=""/>
100
        <property name="source.encoding" value="${file.encoding}"/>
158
        <property name="source.encoding" value="${file.encoding}"/>
159
        <property name="runtime.encoding" value="${source.encoding}"/>
101
        <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
160
        <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
102
            <and>
161
            <and>
103
                <isset property="javadoc.encoding"/>
162
                <isset property="javadoc.encoding"/>
Lines 113-124 Link Here
113
        <condition property="do.depend.true">
172
        <condition property="do.depend.true">
114
            <istrue value="${do.depend}"/>
173
            <istrue value="${do.depend}"/>
115
        </condition>
174
        </condition>
116
        <condition else="" property="javac.compilerargs.jaxws" value="-Djava.endorsed.dirs='${jaxws.endorsed.dir}'">
175
        <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
176
        <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
117
            <and>
177
            <and>
118
                <isset property="jaxws.endorsed.dir"/>
178
                <isset property="endorsed.classpath"/>
119
                <available file="nbproject/jaxws-build.xml"/>
179
                <not>
180
                    <equals arg1="${endorsed.classpath}" arg2="" trim="true"/>
181
                </not>
120
            </and>
182
            </and>
121
        </condition>
183
        </condition>
184
        <condition else="" property="javac.profile.cmd.line.arg" value="-profile ${javac.profile}">
185
            <isset property="profile.available"/>
186
        </condition>
187
        <condition else="false" property="jdkBug6558476">
188
            <and>
189
                <matches pattern="1\.[56]" string="${java.specification.version}"/>
190
                <not>
191
                    <os family="unix"/>
192
                </not>
193
            </and>
194
        </condition>
195
        <condition else="false" property="javac.fork">
196
            <or>
197
                <istrue value="${jdkBug6558476}"/>
198
                <istrue value="${javac.external.vm}"/>
199
            </or>
200
        </condition>
201
        <property name="jar.index" value="false"/>
202
        <property name="jar.index.metainf" value="${jar.index}"/>
203
        <property name="copylibs.rebase" value="true"/>
204
        <available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
205
        <condition property="junit.available">
206
            <or>
207
                <available classname="org.junit.Test" classpath="${run.test.classpath}"/>
208
                <available classname="junit.framework.Test" classpath="${run.test.classpath}"/>
209
            </or>
210
        </condition>
211
        <condition property="testng.available">
212
            <available classname="org.testng.annotations.Test" classpath="${run.test.classpath}"/>
213
        </condition>
214
        <condition property="junit+testng.available">
215
            <and>
216
                <istrue value="${junit.available}"/>
217
                <istrue value="${testng.available}"/>
218
            </and>
219
        </condition>
220
        <condition else="testng" property="testng.mode" value="mixed">
221
            <istrue value="${junit+testng.available}"/>
222
        </condition>
223
        <condition else="" property="testng.debug.mode" value="-mixed">
224
            <istrue value="${junit+testng.available}"/>
225
        </condition>
226
        <property name="java.failonerror" value="true"/>
122
    </target>
227
    </target>
123
    <target name="-post-init">
228
    <target name="-post-init">
124
        <!-- Empty placeholder for easier customization. -->
229
        <!-- Empty placeholder for easier customization. -->
Lines 145-163 Link Here
145
            </sequential>
250
            </sequential>
146
        </macrodef>
251
        </macrodef>
147
    </target>
252
    </target>
148
    <target name="-init-macrodef-javac">
253
    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors">
149
        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
254
        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
150
            <attribute default="${src.dir}" name="srcdir"/>
255
            <attribute default="${src.dir}" name="srcdir"/>
151
            <attribute default="${build.classes.dir}" name="destdir"/>
256
            <attribute default="${build.classes.dir}" name="destdir"/>
152
            <attribute default="${javac.classpath}" name="classpath"/>
257
            <attribute default="${javac.classpath}" name="classpath"/>
258
            <attribute default="${javac.processorpath}" name="processorpath"/>
259
            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
153
            <attribute default="${includes}" name="includes"/>
260
            <attribute default="${includes}" name="includes"/>
154
            <attribute default="${excludes}" name="excludes"/>
261
            <attribute default="${excludes}" name="excludes"/>
155
            <attribute default="${javac.debug}" name="debug"/>
262
            <attribute default="${javac.debug}" name="debug"/>
156
            <attribute default="/does/not/exist" name="sourcepath"/>
263
            <attribute default="${empty.dir}" name="sourcepath"/>
157
            <attribute default="/does/not/exist" name="gensrcdir"/>
264
            <attribute default="${empty.dir}" name="gensrcdir"/>
158
            <element name="customize" optional="true"/>
265
            <element name="customize" optional="true"/>
159
            <sequential>
266
            <sequential>
160
                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}">
267
                <property location="${build.dir}/empty" name="empty.dir"/>
268
                <mkdir dir="${empty.dir}"/>
269
                <mkdir dir="@{apgeneratedsrcdir}"/>
270
                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
161
                    <src>
271
                    <src>
162
                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
272
                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
163
                            <include name="*"/>
273
                            <include name="*"/>
Lines 166-176 Link Here
166
                    <classpath>
276
                    <classpath>
167
                        <path path="@{classpath}"/>
277
                        <path path="@{classpath}"/>
168
                    </classpath>
278
                    </classpath>
169
                    <compilerarg line="${javac.compilerargs} ${javac.compilerargs.jaxws}"/>
279
                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
280
                    <compilerarg line="${javac.profile.cmd.line.arg}"/>
281
                    <compilerarg line="${javac.compilerargs}"/>
282
                    <compilerarg value="-processorpath"/>
283
                    <compilerarg path="@{processorpath}:${empty.dir}"/>
284
                    <compilerarg line="${ap.processors.internal}"/>
285
                    <compilerarg line="${annotation.processing.processor.options}"/>
286
                    <compilerarg value="-s"/>
287
                    <compilerarg path="@{apgeneratedsrcdir}"/>
288
                    <compilerarg line="${ap.proc.none.internal}"/>
170
                    <customize/>
289
                    <customize/>
171
                </javac>
290
                </javac>
172
            </sequential>
291
            </sequential>
173
        </macrodef>
292
        </macrodef>
293
    </target>
294
    <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
295
        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
296
            <attribute default="${src.dir}" name="srcdir"/>
297
            <attribute default="${build.classes.dir}" name="destdir"/>
298
            <attribute default="${javac.classpath}" name="classpath"/>
299
            <attribute default="${javac.processorpath}" name="processorpath"/>
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="sourcepath"/>
305
            <attribute default="${empty.dir}" name="gensrcdir"/>
306
            <element name="customize" optional="true"/>
307
            <sequential>
308
                <property location="${build.dir}/empty" name="empty.dir"/>
309
                <mkdir dir="${empty.dir}"/>
310
                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
311
                    <src>
312
                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
313
                            <include name="*"/>
314
                        </dirset>
315
                    </src>
316
                    <classpath>
317
                        <path path="@{classpath}"/>
318
                    </classpath>
319
                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
320
                    <compilerarg line="${javac.profile.cmd.line.arg}"/>
321
                    <compilerarg line="${javac.compilerargs}"/>
322
                    <customize/>
323
                </javac>
324
            </sequential>
325
        </macrodef>
326
    </target>
327
    <target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
174
        <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
328
        <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
175
            <attribute default="${src.dir}" name="srcdir"/>
329
            <attribute default="${src.dir}" name="srcdir"/>
176
            <attribute default="${build.classes.dir}" name="destdir"/>
330
            <attribute default="${build.classes.dir}" name="destdir"/>
Lines 187-230 Link Here
187
            <attribute default="${build.classes.dir}" name="destdir"/>
341
            <attribute default="${build.classes.dir}" name="destdir"/>
188
            <sequential>
342
            <sequential>
189
                <fail unless="javac.includes">Must set javac.includes</fail>
343
                <fail unless="javac.includes">Must set javac.includes</fail>
190
                <pathconvert pathsep="," property="javac.includes.binary">
344
                <pathconvert pathsep="${line.separator}" property="javac.includes.binary">
191
                    <path>
345
                    <path>
192
                        <filelist dir="@{destdir}" files="${javac.includes}"/>
346
                        <filelist dir="@{destdir}" files="${javac.includes}"/>
193
                    </path>
347
                    </path>
194
                    <globmapper from="*.java" to="*.class"/>
348
                    <globmapper from="*.java" to="*.class"/>
195
                </pathconvert>
349
                </pathconvert>
350
                <tempfile deleteonexit="true" property="javac.includesfile.binary"/>
351
                <echo file="${javac.includesfile.binary}" message="${javac.includes.binary}"/>
196
                <delete>
352
                <delete>
197
                    <files includes="${javac.includes.binary}"/>
353
                    <files includesfile="${javac.includesfile.binary}"/>
354
                </delete>
355
                <delete>
356
                    <fileset file="${javac.includesfile.binary}"/>
198
                </delete>
357
                </delete>
199
            </sequential>
358
            </sequential>
200
        </macrodef>
359
        </macrodef>
201
    </target>
360
    </target>
202
    <target name="-init-macrodef-junit">
361
    <target if="${junit.available}" name="-init-macrodef-junit-init">
362
        <condition else="false" property="nb.junit.batch" value="true">
363
            <and>
364
                <istrue value="${junit.available}"/>
365
                <not>
366
                    <isset property="test.method"/>
367
                </not>
368
            </and>
369
        </condition>
370
        <condition else="false" property="nb.junit.single" value="true">
371
            <and>
372
                <istrue value="${junit.available}"/>
373
                <isset property="test.method"/>
374
            </and>
375
        </condition>
376
    </target>
377
    <target name="-init-test-properties">
378
        <property name="test.binaryincludes" value="&lt;nothing&gt;"/>
379
        <property name="test.binarytestincludes" value=""/>
380
        <property name="test.binaryexcludes" value=""/>
381
    </target>
382
    <target if="${nb.junit.single}" name="-init-macrodef-junit-single" unless="${nb.junit.batch}">
203
        <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
383
        <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
204
            <attribute default="${includes}" name="includes"/>
384
            <attribute default="${includes}" name="includes"/>
205
            <attribute default="${excludes}" name="excludes"/>
385
            <attribute default="${excludes}" name="excludes"/>
206
            <attribute default="**" name="testincludes"/>
386
            <attribute default="**" name="testincludes"/>
387
            <attribute default="" name="testmethods"/>
388
            <element name="customize" optional="true"/>
207
            <sequential>
389
            <sequential>
208
                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true">
390
                <property name="junit.forkmode" value="perTest"/>
209
                    <batchtest todir="${build.test.results.dir}">
391
                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
210
                        <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
392
                    <test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/>
211
                            <filename name="@{testincludes}"/>
212
                        </fileset>
213
                    </batchtest>
214
                    <classpath>
215
                        <path path="${run.test.classpath}"/>
216
                    </classpath>
217
                    <syspropertyset>
393
                    <syspropertyset>
218
                        <propertyref prefix="test-sys-prop."/>
394
                        <propertyref prefix="test-sys-prop."/>
219
                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
395
                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
220
                    </syspropertyset>
396
                    </syspropertyset>
221
                    <formatter type="brief" usefile="false"/>
397
                    <formatter type="brief" usefile="false"/>
222
                    <formatter type="xml"/>
398
                    <formatter type="xml"/>
223
                    <jvmarg line="${run.jvmargs}"/>
399
                    <jvmarg value="-ea"/>
400
                    <customize/>
224
                </junit>
401
                </junit>
225
            </sequential>
402
            </sequential>
226
        </macrodef>
403
        </macrodef>
227
    </target>
404
    </target>
405
    <target depends="-init-test-properties" if="${nb.junit.batch}" name="-init-macrodef-junit-batch" unless="${nb.junit.single}">
406
        <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
407
            <attribute default="${includes}" name="includes"/>
408
            <attribute default="${excludes}" name="excludes"/>
409
            <attribute default="**" name="testincludes"/>
410
            <attribute default="" name="testmethods"/>
411
            <element name="customize" optional="true"/>
412
            <sequential>
413
                <property name="junit.forkmode" value="perTest"/>
414
                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
415
                    <batchtest todir="${build.test.results.dir}">
416
                        <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
417
                            <filename name="@{testincludes}"/>
418
                        </fileset>
419
                        <fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}">
420
                            <filename name="${test.binarytestincludes}"/>
421
                        </fileset>
422
                    </batchtest>
423
                    <syspropertyset>
424
                        <propertyref prefix="test-sys-prop."/>
425
                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
426
                    </syspropertyset>
427
                    <formatter type="brief" usefile="false"/>
428
                    <formatter type="xml"/>
429
                    <jvmarg value="-ea"/>
430
                    <customize/>
431
                </junit>
432
            </sequential>
433
        </macrodef>
434
    </target>
435
    <target depends="-init-macrodef-junit-init,-init-macrodef-junit-single, -init-macrodef-junit-batch" if="${junit.available}" name="-init-macrodef-junit"/>
436
    <target if="${testng.available}" name="-init-macrodef-testng">
437
        <macrodef name="testng" uri="http://www.netbeans.org/ns/j2se-project/3">
438
            <attribute default="${includes}" name="includes"/>
439
            <attribute default="${excludes}" name="excludes"/>
440
            <attribute default="**" name="testincludes"/>
441
            <attribute default="" name="testmethods"/>
442
            <element name="customize" optional="true"/>
443
            <sequential>
444
                <condition else="" property="testng.methods.arg" value="@{testincludes}.@{testmethods}">
445
                    <isset property="test.method"/>
446
                </condition>
447
                <union id="test.set">
448
                    <fileset dir="${test.src.dir}" excludes="@{excludes},**/*.xml,${excludes}" includes="@{includes}">
449
                        <filename name="@{testincludes}"/>
450
                    </fileset>
451
                </union>
452
                <taskdef classname="org.testng.TestNGAntTask" classpath="${run.test.classpath}" name="testng"/>
453
                <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="GroovyJavaDemo" testname="TestNG tests" workingDir="${work.dir}">
454
                    <xmlfileset dir="${build.test.classes.dir}" includes="@{testincludes}"/>
455
                    <propertyset>
456
                        <propertyref prefix="test-sys-prop."/>
457
                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
458
                    </propertyset>
459
                    <customize/>
460
                </testng>
461
            </sequential>
462
        </macrodef>
463
    </target>
464
    <target name="-init-macrodef-test-impl">
465
        <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
466
            <attribute default="${includes}" name="includes"/>
467
            <attribute default="${excludes}" name="excludes"/>
468
            <attribute default="**" name="testincludes"/>
469
            <attribute default="" name="testmethods"/>
470
            <element implicit="true" name="customize" optional="true"/>
471
            <sequential>
472
                <echo>No tests executed.</echo>
473
            </sequential>
474
        </macrodef>
475
    </target>
476
    <target depends="-init-macrodef-junit" if="${junit.available}" name="-init-macrodef-junit-impl">
477
        <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
478
            <attribute default="${includes}" name="includes"/>
479
            <attribute default="${excludes}" name="excludes"/>
480
            <attribute default="**" name="testincludes"/>
481
            <attribute default="" name="testmethods"/>
482
            <element implicit="true" name="customize" optional="true"/>
483
            <sequential>
484
                <j2seproject3:junit excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
485
                    <customize/>
486
                </j2seproject3:junit>
487
            </sequential>
488
        </macrodef>
489
    </target>
490
    <target depends="-init-macrodef-testng" if="${testng.available}" name="-init-macrodef-testng-impl">
491
        <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
492
            <attribute default="${includes}" name="includes"/>
493
            <attribute default="${excludes}" name="excludes"/>
494
            <attribute default="**" name="testincludes"/>
495
            <attribute default="" name="testmethods"/>
496
            <element implicit="true" name="customize" optional="true"/>
497
            <sequential>
498
                <j2seproject3:testng excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
499
                    <customize/>
500
                </j2seproject3:testng>
501
            </sequential>
502
        </macrodef>
503
    </target>
504
    <target depends="-init-macrodef-test-impl,-init-macrodef-junit-impl,-init-macrodef-testng-impl" name="-init-macrodef-test">
505
        <macrodef name="test" uri="http://www.netbeans.org/ns/j2se-project/3">
506
            <attribute default="${includes}" name="includes"/>
507
            <attribute default="${excludes}" name="excludes"/>
508
            <attribute default="**" name="testincludes"/>
509
            <attribute default="" name="testmethods"/>
510
            <sequential>
511
                <j2seproject3:test-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
512
                    <customize>
513
                        <classpath>
514
                            <path path="${run.test.classpath}"/>
515
                        </classpath>
516
                        <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
517
                        <jvmarg line="${run.jvmargs}"/>
518
                        <jvmarg line="${run.jvmargs.ide}"/>
519
                    </customize>
520
                </j2seproject3:test-impl>
521
            </sequential>
522
        </macrodef>
523
    </target>
524
    <target if="${junit.available}" name="-init-macrodef-junit-debug" unless="${nb.junit.batch}">
525
        <macrodef name="junit-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
526
            <attribute default="${includes}" name="includes"/>
527
            <attribute default="${excludes}" name="excludes"/>
528
            <attribute default="**" name="testincludes"/>
529
            <attribute default="" name="testmethods"/>
530
            <element name="customize" optional="true"/>
531
            <sequential>
532
                <property name="junit.forkmode" value="perTest"/>
533
                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
534
                    <test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/>
535
                    <syspropertyset>
536
                        <propertyref prefix="test-sys-prop."/>
537
                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
538
                    </syspropertyset>
539
                    <formatter type="brief" usefile="false"/>
540
                    <formatter type="xml"/>
541
                    <jvmarg value="-ea"/>
542
                    <jvmarg line="${debug-args-line}"/>
543
                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
544
                    <customize/>
545
                </junit>
546
            </sequential>
547
        </macrodef>
548
    </target>
549
    <target depends="-init-test-properties" if="${nb.junit.batch}" name="-init-macrodef-junit-debug-batch">
550
        <macrodef name="junit-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
551
            <attribute default="${includes}" name="includes"/>
552
            <attribute default="${excludes}" name="excludes"/>
553
            <attribute default="**" name="testincludes"/>
554
            <attribute default="" name="testmethods"/>
555
            <element name="customize" optional="true"/>
556
            <sequential>
557
                <property name="junit.forkmode" value="perTest"/>
558
                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
559
                    <batchtest todir="${build.test.results.dir}">
560
                        <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
561
                            <filename name="@{testincludes}"/>
562
                        </fileset>
563
                        <fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}">
564
                            <filename name="${test.binarytestincludes}"/>
565
                        </fileset>
566
                    </batchtest>
567
                    <syspropertyset>
568
                        <propertyref prefix="test-sys-prop."/>
569
                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
570
                    </syspropertyset>
571
                    <formatter type="brief" usefile="false"/>
572
                    <formatter type="xml"/>
573
                    <jvmarg value="-ea"/>
574
                    <jvmarg line="${debug-args-line}"/>
575
                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
576
                    <customize/>
577
                </junit>
578
            </sequential>
579
        </macrodef>
580
    </target>
581
    <target depends="-init-macrodef-junit-debug,-init-macrodef-junit-debug-batch" if="${junit.available}" name="-init-macrodef-junit-debug-impl">
582
        <macrodef name="test-debug-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
583
            <attribute default="${includes}" name="includes"/>
584
            <attribute default="${excludes}" name="excludes"/>
585
            <attribute default="**" name="testincludes"/>
586
            <attribute default="" name="testmethods"/>
587
            <element implicit="true" name="customize" optional="true"/>
588
            <sequential>
589
                <j2seproject3:junit-debug excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
590
                    <customize/>
591
                </j2seproject3:junit-debug>
592
            </sequential>
593
        </macrodef>
594
    </target>
595
    <target if="${testng.available}" name="-init-macrodef-testng-debug">
596
        <macrodef name="testng-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
597
            <attribute default="${main.class}" name="testClass"/>
598
            <attribute default="" name="testMethod"/>
599
            <element name="customize2" optional="true"/>
600
            <sequential>
601
                <condition else="-testclass @{testClass}" property="test.class.or.method" value="-methods @{testClass}.@{testMethod}">
602
                    <isset property="test.method"/>
603
                </condition>
604
                <condition else="-suitename GroovyJavaDemo -testname @{testClass} ${test.class.or.method}" property="testng.cmd.args" value="@{testClass}">
605
                    <matches pattern=".*\.xml" string="@{testClass}"/>
606
                </condition>
607
                <delete dir="${build.test.results.dir}" quiet="true"/>
608
                <mkdir dir="${build.test.results.dir}"/>
609
                <j2seproject3:debug classname="org.testng.TestNG" classpath="${debug.test.classpath}">
610
                    <customize>
611
                        <customize2/>
612
                        <jvmarg value="-ea"/>
613
                        <arg line="${testng.debug.mode}"/>
614
                        <arg line="-d ${build.test.results.dir}"/>
615
                        <arg line="-listener org.testng.reporters.VerboseReporter"/>
616
                        <arg line="${testng.cmd.args}"/>
617
                    </customize>
618
                </j2seproject3:debug>
619
            </sequential>
620
        </macrodef>
621
    </target>
622
    <target depends="-init-macrodef-testng-debug" if="${testng.available}" name="-init-macrodef-testng-debug-impl">
623
        <macrodef name="testng-debug-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
624
            <attribute default="${main.class}" name="testClass"/>
625
            <attribute default="" name="testMethod"/>
626
            <element implicit="true" name="customize2" optional="true"/>
627
            <sequential>
628
                <j2seproject3:testng-debug testClass="@{testClass}" testMethod="@{testMethod}">
629
                    <customize2/>
630
                </j2seproject3:testng-debug>
631
            </sequential>
632
        </macrodef>
633
    </target>
634
    <target depends="-init-macrodef-junit-debug-impl" if="${junit.available}" name="-init-macrodef-test-debug-junit">
635
        <macrodef name="test-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
636
            <attribute default="${includes}" name="includes"/>
637
            <attribute default="${excludes}" name="excludes"/>
638
            <attribute default="**" name="testincludes"/>
639
            <attribute default="" name="testmethods"/>
640
            <attribute default="${main.class}" name="testClass"/>
641
            <attribute default="" name="testMethod"/>
642
            <sequential>
643
                <j2seproject3:test-debug-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
644
                    <customize>
645
                        <classpath>
646
                            <path path="${run.test.classpath}"/>
647
                        </classpath>
648
                        <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
649
                        <jvmarg line="${run.jvmargs}"/>
650
                        <jvmarg line="${run.jvmargs.ide}"/>
651
                    </customize>
652
                </j2seproject3:test-debug-impl>
653
            </sequential>
654
        </macrodef>
655
    </target>
656
    <target depends="-init-macrodef-testng-debug-impl" if="${testng.available}" name="-init-macrodef-test-debug-testng">
657
        <macrodef name="test-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
658
            <attribute default="${includes}" name="includes"/>
659
            <attribute default="${excludes}" name="excludes"/>
660
            <attribute default="**" name="testincludes"/>
661
            <attribute default="" name="testmethods"/>
662
            <attribute default="${main.class}" name="testClass"/>
663
            <attribute default="" name="testMethod"/>
664
            <sequential>
665
                <j2seproject3:testng-debug-impl testClass="@{testClass}" testMethod="@{testMethod}">
666
                    <customize2>
667
                        <syspropertyset>
668
                            <propertyref prefix="test-sys-prop."/>
669
                            <mapper from="test-sys-prop.*" to="*" type="glob"/>
670
                        </syspropertyset>
671
                    </customize2>
672
                </j2seproject3:testng-debug-impl>
673
            </sequential>
674
        </macrodef>
675
    </target>
676
    <target depends="-init-macrodef-test-debug-junit,-init-macrodef-test-debug-testng" name="-init-macrodef-test-debug"/>
677
    <!--
678
                pre NB7.2 profiling section; consider it deprecated
679
            -->
680
    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check" if="profiler.info.jvmargs.agent" name="profile-init"/>
681
    <target if="profiler.info.jvmargs.agent" name="-profile-pre-init">
682
        <!-- Empty placeholder for easier customization. -->
683
        <!-- You can override this target in the ../build.xml file. -->
684
    </target>
685
    <target if="profiler.info.jvmargs.agent" name="-profile-post-init">
686
        <!-- Empty placeholder for easier customization. -->
687
        <!-- You can override this target in the ../build.xml file. -->
688
    </target>
689
    <target if="profiler.info.jvmargs.agent" name="-profile-init-macrodef-profile">
690
        <macrodef name="resolve">
691
            <attribute name="name"/>
692
            <attribute name="value"/>
693
            <sequential>
694
                <property name="@{name}" value="${env.@{value}}"/>
695
            </sequential>
696
        </macrodef>
697
        <macrodef name="profile">
698
            <attribute default="${main.class}" name="classname"/>
699
            <element name="customize" optional="true"/>
700
            <sequential>
701
                <property environment="env"/>
702
                <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
703
                <java classname="@{classname}" dir="${profiler.info.dir}" failonerror="${java.failonerror}" fork="true" jvm="${profiler.info.jvm}">
704
                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
705
                    <jvmarg value="${profiler.info.jvmargs.agent}"/>
706
                    <jvmarg line="${profiler.info.jvmargs}"/>
707
                    <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
708
                    <arg line="${application.args}"/>
709
                    <classpath>
710
                        <path path="${run.classpath}"/>
711
                    </classpath>
712
                    <syspropertyset>
713
                        <propertyref prefix="run-sys-prop."/>
714
                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
715
                    </syspropertyset>
716
                    <customize/>
717
                </java>
718
            </sequential>
719
        </macrodef>
720
    </target>
721
    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile" if="profiler.info.jvmargs.agent" name="-profile-init-check">
722
        <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail>
723
        <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
724
    </target>
725
    <!--
726
                end of pre NB7.2 profiling section
727
            -->
228
    <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
728
    <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
229
        <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
729
        <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
230
            <attribute default="${main.class}" name="name"/>
730
            <attribute default="${main.class}" name="name"/>
Lines 275-286 Link Here
275
            <attribute default="${debug.classpath}" name="classpath"/>
775
            <attribute default="${debug.classpath}" name="classpath"/>
276
            <element name="customize" optional="true"/>
776
            <element name="customize" optional="true"/>
277
            <sequential>
777
            <sequential>
278
                <java classname="@{classname}" dir="${work.dir}" fork="true">
778
                <java classname="@{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true">
779
                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
279
                    <jvmarg line="${debug-args-line}"/>
780
                    <jvmarg line="${debug-args-line}"/>
280
                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
781
                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
281
                    <jvmarg value="-Dfile.encoding=${source.encoding}"/>
782
                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
282
                    <redirector errorencoding="${source.encoding}" inputencoding="${source.encoding}" outputencoding="${source.encoding}"/>
783
                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
283
                    <jvmarg line="${run.jvmargs}"/>
784
                    <jvmarg line="${run.jvmargs}"/>
785
                    <jvmarg line="${run.jvmargs.ide}"/>
284
                    <classpath>
786
                    <classpath>
285
                        <path path="@{classpath}"/>
787
                        <path path="@{classpath}"/>
286
                    </classpath>
788
                    </classpath>
Lines 297-308 Link Here
297
        <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
799
        <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
298
            <attribute default="${main.class}" name="classname"/>
800
            <attribute default="${main.class}" name="classname"/>
299
            <attribute default="${run.classpath}" name="classpath"/>
801
            <attribute default="${run.classpath}" name="classpath"/>
802
            <attribute default="jvm" name="jvm"/>
300
            <element name="customize" optional="true"/>
803
            <element name="customize" optional="true"/>
301
            <sequential>
804
            <sequential>
302
                <java classname="@{classname}" dir="${work.dir}" fork="true">
805
                <java classname="@{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true">
303
                    <jvmarg value="-Dfile.encoding=${source.encoding}"/>
806
                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
304
                    <redirector errorencoding="${source.encoding}" inputencoding="${source.encoding}" outputencoding="${source.encoding}"/>
807
                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
808
                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
305
                    <jvmarg line="${run.jvmargs}"/>
809
                    <jvmarg line="${run.jvmargs}"/>
810
                    <jvmarg line="${run.jvmargs.ide}"/>
306
                    <classpath>
811
                    <classpath>
307
                        <path path="@{classpath}"/>
812
                        <path path="@{classpath}"/>
308
                    </classpath>
813
                    </classpath>
Lines 315-334 Link Here
315
            </sequential>
820
            </sequential>
316
        </macrodef>
821
        </macrodef>
317
    </target>
822
    </target>
823
    <target name="-init-macrodef-copylibs">
824
        <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
825
            <attribute default="${manifest.file}" name="manifest"/>
826
            <element name="customize" optional="true"/>
827
            <sequential>
828
                <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
829
                <pathconvert property="run.classpath.without.build.classes.dir">
830
                    <path path="${run.classpath}"/>
831
                    <map from="${build.classes.dir.resolved}" to=""/>
832
                </pathconvert>
833
                <pathconvert pathsep=" " property="jar.classpath">
834
                    <path path="${run.classpath.without.build.classes.dir}"/>
835
                    <chainedmapper>
836
                        <flattenmapper/>
837
                        <filtermapper>
838
                            <replacestring from=" " to="%20"/>
839
                        </filtermapper>
840
                        <globmapper from="*" to="lib/*"/>
841
                    </chainedmapper>
842
                </pathconvert>
843
                <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
844
                <copylibs compress="${jar.compress}" excludeFromCopy="${copylibs.excludes}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" rebase="${copylibs.rebase}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
845
                    <fileset dir="${build.classes.dir}" excludes="${dist.archive.excludes}"/>
846
                    <manifest>
847
                        <attribute name="Class-Path" value="${jar.classpath}"/>
848
                        <customize/>
849
                    </manifest>
850
                </copylibs>
851
            </sequential>
852
        </macrodef>
853
    </target>
318
    <target name="-init-presetdef-jar">
854
    <target name="-init-presetdef-jar">
319
        <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
855
        <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
320
            <jar compress="${jar.compress}" jarfile="${dist.jar}">
856
            <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}">
321
                <j2seproject1:fileset dir="${build.classes.dir}"/>
857
                <j2seproject1:fileset dir="${build.classes.dir}" excludes="${dist.archive.excludes}"/>
322
            </jar>
858
            </jar>
323
        </presetdef>
859
        </presetdef>
324
    </target>
860
    </target>
325
    <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-junit,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar" name="init"/>
861
    <target name="-init-ap-cmdline-properties">
862
        <property name="annotation.processing.enabled" value="true"/>
863
        <property name="annotation.processing.processors.list" value=""/>
864
        <property name="annotation.processing.processor.options" value=""/>
865
        <property name="annotation.processing.run.all.processors" value="true"/>
866
        <property name="javac.processorpath" value="${javac.classpath}"/>
867
        <property name="javac.test.processorpath" value="${javac.test.classpath}"/>
868
        <condition property="ap.supported.internal" value="true">
869
            <not>
870
                <matches pattern="1\.[0-5](\..*)?" string="${javac.source}"/>
871
            </not>
872
        </condition>
873
    </target>
874
    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-ap-cmdline-supported">
875
        <condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}">
876
            <isfalse value="${annotation.processing.run.all.processors}"/>
877
        </condition>
878
        <condition else="" property="ap.proc.none.internal" value="-proc:none">
879
            <isfalse value="${annotation.processing.enabled}"/>
880
        </condition>
881
    </target>
882
    <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline">
883
        <property name="ap.cmd.line.internal" value=""/>
884
    </target>
885
    <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-test,-init-macrodef-test-debug,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar,-init-ap-cmdline" name="init"/>
326
    <!--
886
    <!--
327
                ===================
887
                ===================
328
                COMPILATION SECTION
888
                COMPILATION SECTION
329
                ===================
889
                ===================
330
            -->
890
            -->
331
    <target depends="init" name="deps-jar" unless="no.deps"/>
891
    <target name="-deps-jar-init" unless="built-jar.properties">
892
        <property location="${build.dir}/built-jar.properties" name="built-jar.properties"/>
893
        <delete file="${built-jar.properties}" quiet="true"/>
894
    </target>
895
    <target if="already.built.jar.${basedir}" name="-warn-already-built-jar">
896
        <echo level="warn" message="Cycle detected: GroovyJavaDemo was already built"/>
897
    </target>
898
    <target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps">
899
        <mkdir dir="${build.dir}"/>
900
        <touch file="${built-jar.properties}" verbose="false"/>
901
        <property file="${built-jar.properties}" prefix="already.built.jar."/>
902
        <antcall target="-warn-already-built-jar"/>
903
        <propertyfile file="${built-jar.properties}">
904
            <entry key="${basedir}" value=""/>
905
        </propertyfile>
906
    </target>
332
    <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
907
    <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
333
    <target depends="init" name="-check-automatic-build">
908
    <target depends="init" name="-check-automatic-build">
334
        <available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/>
909
        <available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/>
Lines 351-362 Link Here
351
        </pathconvert>
926
        </pathconvert>
352
        <j2seproject3:depend srcdir="${src.dir}:${build.generated.subdirs}"/>
927
        <j2seproject3:depend srcdir="${src.dir}:${build.generated.subdirs}"/>
353
    </target>
928
    </target>
354
    <target depends="init,deps-jar,-pre-pre-compile,-pre-compile,-compile-depend" if="have.sources" name="-do-compile">
929
    <target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile">
355
        <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
930
        <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
356
        <copy todir="${build.classes.dir}">
931
        <copy todir="${build.classes.dir}">
357
            <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
932
            <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
358
        </copy>
933
        </copy>
359
    </target>
934
    </target>
935
    <target if="has.persistence.xml" name="-copy-persistence-xml">
936
        <mkdir dir="${build.classes.dir}/META-INF"/>
937
        <copy todir="${build.classes.dir}/META-INF">
938
            <fileset dir="${meta.inf.dir}" includes="persistence.xml orm.xml"/>
939
        </copy>
940
    </target>
360
    <target name="-post-compile">
941
    <target name="-post-compile">
361
        <!-- Empty placeholder for easier customization. -->
942
        <!-- Empty placeholder for easier customization. -->
362
        <!-- You can override this target in the ../build.xml file. -->
943
        <!-- You can override this target in the ../build.xml file. -->
Lines 389-445 Link Here
389
        <!-- Empty placeholder for easier customization. -->
970
        <!-- Empty placeholder for easier customization. -->
390
        <!-- You can override this target in the ../build.xml file. -->
971
        <!-- You can override this target in the ../build.xml file. -->
391
    </target>
972
    </target>
392
    <target depends="init,compile,-pre-pre-jar,-pre-jar" name="-do-jar-without-manifest" unless="manifest.available">
973
    <target depends="init" if="do.archive" name="-do-jar-create-manifest" unless="manifest.available">
393
        <j2seproject1:jar/>
974
        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
394
    </target>
975
        <touch file="${tmp.manifest.file}" verbose="false"/>
395
    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class">
396
        <j2seproject1:jar manifest="${manifest.file}"/>
397
    </target>
976
    </target>
398
    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class" name="-do-jar-with-mainclass" unless="manifest.available+main.class+mkdist.available">
977
    <target depends="init" if="do.archive+manifest.available" name="-do-jar-copy-manifest">
399
        <j2seproject1:jar manifest="${manifest.file}">
978
        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
400
            <j2seproject1:manifest>
979
        <copy file="${manifest.file}" tofile="${tmp.manifest.file}"/>
401
                <j2seproject1:attribute name="Main-Class" value="${main.class}"/>
980
    </target>
402
            </j2seproject1:manifest>
981
    <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+main.class.available" name="-do-jar-set-mainclass">
403
        </j2seproject1:jar>
982
        <manifest file="${tmp.manifest.file}" mode="update">
404
        <echo>To run this application from the command line without Ant, try:</echo>
983
            <attribute name="Main-Class" value="${main.class}"/>
984
        </manifest>
985
    </target>
986
    <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+profile.available" name="-do-jar-set-profile">
987
        <manifest file="${tmp.manifest.file}" mode="update">
988
            <attribute name="Profile" value="${javac.profile}"/>
989
        </manifest>
990
    </target>
991
    <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+splashscreen.available" name="-do-jar-set-splashscreen">
992
        <basename file="${application.splash}" property="splashscreen.basename"/>
993
        <mkdir dir="${build.classes.dir}/META-INF"/>
994
        <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
995
        <manifest file="${tmp.manifest.file}" mode="update">
996
            <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
997
        </manifest>
998
    </target>
999
    <target depends="init,-init-macrodef-copylibs,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen" if="do.mkdist" name="-do-jar-copylibs">
1000
        <j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
1001
        <echo level="info">To run this application from the command line without Ant, try:</echo>
1002
        <property location="${dist.jar}" name="dist.jar.resolved"/>
1003
        <echo level="info">java -jar "${dist.jar.resolved}"</echo>
1004
    </target>
1005
    <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen" if="do.archive" name="-do-jar-jar" unless="do.mkdist">
1006
        <j2seproject1:jar manifest="${tmp.manifest.file}"/>
405
        <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
1007
        <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
406
        <property location="${dist.jar}" name="dist.jar.resolved"/>
1008
        <property location="${dist.jar}" name="dist.jar.resolved"/>
407
        <pathconvert property="run.classpath.with.dist.jar">
1009
        <pathconvert property="run.classpath.with.dist.jar">
408
            <path path="${run.classpath}"/>
1010
            <path path="${run.classpath}"/>
409
            <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
1011
            <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
410
        </pathconvert>
1012
        </pathconvert>
411
        <echo>java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
1013
        <condition else="" property="jar.usage.message" value="To run this application from the command line without Ant, try:${line.separator}${platform.java} -cp ${run.classpath.with.dist.jar} ${main.class}">
1014
            <isset property="main.class.available"/>
1015
        </condition>
1016
        <condition else="debug" property="jar.usage.level" value="info">
1017
            <isset property="main.class.available"/>
1018
        </condition>
1019
        <echo level="${jar.usage.level}" message="${jar.usage.message}"/>
412
    </target>
1020
    </target>
413
    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class+mkdist.available" name="-do-jar-with-libraries">
1021
    <target depends="-do-jar-copylibs" if="do.archive" name="-do-jar-delete-manifest">
414
        <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
1022
        <delete>
415
        <pathconvert property="run.classpath.without.build.classes.dir">
1023
            <fileset file="${tmp.manifest.file}"/>
416
            <path path="${run.classpath}"/>
1024
        </delete>
417
            <map from="${build.classes.dir.resolved}" to=""/>
418
        </pathconvert>
419
        <pathconvert pathsep=" " property="jar.classpath">
420
            <path path="${run.classpath.without.build.classes.dir}"/>
421
            <chainedmapper>
422
                <flattenmapper/>
423
                <globmapper from="*" to="lib/*"/>
424
            </chainedmapper>
425
        </pathconvert>
426
        <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
427
        <copylibs compress="${jar.compress}" jarfile="${dist.jar}" manifest="${manifest.file}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
428
            <fileset dir="${build.classes.dir}"/>
429
            <manifest>
430
                <attribute name="Main-Class" value="${main.class}"/>
431
                <attribute name="Class-Path" value="${jar.classpath}"/>
432
            </manifest>
433
        </copylibs>
434
        <echo>To run this application from the command line without Ant, try:</echo>
435
        <property location="${dist.jar}" name="dist.jar.resolved"/>
436
        <echo>java -jar "${dist.jar.resolved}"</echo>
437
    </target>
1025
    </target>
1026
    <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen,-do-jar-jar,-do-jar-delete-manifest" name="-do-jar-without-libraries"/>
1027
    <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen,-do-jar-copylibs,-do-jar-delete-manifest" name="-do-jar-with-libraries"/>
438
    <target name="-post-jar">
1028
    <target name="-post-jar">
439
        <!-- Empty placeholder for easier customization. -->
1029
        <!-- Empty placeholder for easier customization. -->
440
        <!-- You can override this target in the ../build.xml file. -->
1030
        <!-- You can override this target in the ../build.xml file. -->
441
    </target>
1031
    </target>
442
    <target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-post-jar" description="Build JAR." name="jar"/>
1032
    <target depends="init,compile,-pre-jar,-do-jar-without-libraries,-do-jar-with-libraries,-post-jar" name="-do-jar"/>
1033
    <target depends="init,compile,-pre-jar,-do-jar,-post-jar" description="Build JAR." name="jar"/>
443
    <!--
1034
    <!--
444
                =================
1035
                =================
445
                EXECUTION SECTION
1036
                EXECUTION SECTION
Lines 455-465 Link Here
455
    <target name="-do-not-recompile">
1046
    <target name="-do-not-recompile">
456
        <property name="javac.includes.binary" value=""/>
1047
        <property name="javac.includes.binary" value=""/>
457
    </target>
1048
    </target>
458
    <target depends="init,-do-not-recompile,compile-single" name="run-single">
1049
    <target depends="init,compile-single" name="run-single">
459
        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
1050
        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
460
        <j2seproject1:java classname="${run.class}"/>
1051
        <j2seproject1:java classname="${run.class}"/>
461
    </target>
1052
    </target>
462
    <target depends="init,-do-not-recompile,compile-test-single" name="run-test-with-main">
1053
    <target depends="init,compile-test-single" name="run-test-with-main">
463
        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
1054
        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
464
        <j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
1055
        <j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
465
    </target>
1056
    </target>
Lines 490-501 Link Here
490
        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
1081
        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
491
        <j2seproject3:debug classname="${debug.class}"/>
1082
        <j2seproject3:debug classname="${debug.class}"/>
492
    </target>
1083
    </target>
493
    <target depends="init,-do-not-recompile,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
1084
    <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
494
    <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
1085
    <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
495
        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
1086
        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
496
        <j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
1087
        <j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
497
    </target>
1088
    </target>
498
    <target depends="init,-do-not-recompile,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/>
1089
    <target depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/>
499
    <target depends="init" name="-pre-debug-fix">
1090
    <target depends="init" name="-pre-debug-fix">
500
        <fail unless="fix.includes">Must set fix.includes</fail>
1091
        <fail unless="fix.includes">Must set fix.includes</fail>
501
        <property name="javac.includes" value="${fix.includes}.java"/>
1092
        <property name="javac.includes" value="${fix.includes}.java"/>
Lines 505-527 Link Here
505
    </target>
1096
    </target>
506
    <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
1097
    <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
507
    <!--
1098
    <!--
1099
                =================
1100
                PROFILING SECTION
1101
                =================
1102
            -->
1103
    <!--
1104
                pre NB7.2 profiler integration
1105
            -->
1106
    <target depends="profile-init,compile" description="Profile a project in the IDE." if="profiler.info.jvmargs.agent" name="-profile-pre72">
1107
        <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
1108
        <nbprofiledirect>
1109
            <classpath>
1110
                <path path="${run.classpath}"/>
1111
            </classpath>
1112
        </nbprofiledirect>
1113
        <profile/>
1114
    </target>
1115
    <target depends="profile-init,compile-single" description="Profile a selected class in the IDE." if="profiler.info.jvmargs.agent" name="-profile-single-pre72">
1116
        <fail unless="profile.class">Must select one file in the IDE or set profile.class</fail>
1117
        <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
1118
        <nbprofiledirect>
1119
            <classpath>
1120
                <path path="${run.classpath}"/>
1121
            </classpath>
1122
        </nbprofiledirect>
1123
        <profile classname="${profile.class}"/>
1124
    </target>
1125
    <target depends="profile-init,compile-single" if="profiler.info.jvmargs.agent" name="-profile-applet-pre72">
1126
        <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
1127
        <nbprofiledirect>
1128
            <classpath>
1129
                <path path="${run.classpath}"/>
1130
            </classpath>
1131
        </nbprofiledirect>
1132
        <profile classname="sun.applet.AppletViewer">
1133
            <customize>
1134
                <arg value="${applet.url}"/>
1135
            </customize>
1136
        </profile>
1137
    </target>
1138
    <target depends="profile-init,compile-test-single" if="profiler.info.jvmargs.agent" name="-profile-test-single-pre72">
1139
        <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
1140
        <nbprofiledirect>
1141
            <classpath>
1142
                <path path="${run.test.classpath}"/>
1143
            </classpath>
1144
        </nbprofiledirect>
1145
        <junit dir="${profiler.info.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" jvm="${profiler.info.jvm}" showoutput="true">
1146
            <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
1147
            <jvmarg value="${profiler.info.jvmargs.agent}"/>
1148
            <jvmarg line="${profiler.info.jvmargs}"/>
1149
            <test name="${profile.class}"/>
1150
            <classpath>
1151
                <path path="${run.test.classpath}"/>
1152
            </classpath>
1153
            <syspropertyset>
1154
                <propertyref prefix="test-sys-prop."/>
1155
                <mapper from="test-sys-prop.*" to="*" type="glob"/>
1156
            </syspropertyset>
1157
            <formatter type="brief" usefile="false"/>
1158
            <formatter type="xml"/>
1159
        </junit>
1160
    </target>
1161
    <!--
1162
                end of pre NB72 profiling section
1163
            -->
1164
    <target if="netbeans.home" name="-profile-check">
1165
        <condition property="profiler.configured">
1166
            <or>
1167
                <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-agentpath:"/>
1168
                <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-javaagent:"/>
1169
            </or>
1170
        </condition>
1171
    </target>
1172
    <target depends="-profile-check,-profile-pre72" description="Profile a project in the IDE." if="profiler.configured" name="profile" unless="profiler.info.jvmargs.agent">
1173
        <startprofiler/>
1174
        <antcall target="run"/>
1175
    </target>
1176
    <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">
1177
        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
1178
        <startprofiler/>
1179
        <antcall target="run-single"/>
1180
    </target>
1181
    <target depends="-profile-test-single-pre72" description="Profile a selected test in the IDE." name="profile-test-single"/>
1182
    <target depends="-profile-check" description="Profile a selected test in the IDE." if="profiler.configured" name="profile-test" unless="profiler.info.jvmargs">
1183
        <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
1184
        <startprofiler/>
1185
        <antcall target="test-single"/>
1186
    </target>
1187
    <target depends="-profile-check" description="Profile a selected class in the IDE." if="profiler.configured" name="profile-test-with-main">
1188
        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
1189
        <startprofiler/>
1190
        <antcal target="run-test-with-main"/>
1191
    </target>
1192
    <target depends="-profile-check,-profile-applet-pre72" if="profiler.configured" name="profile-applet" unless="profiler.info.jvmargs.agent">
1193
        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
1194
        <startprofiler/>
1195
        <antcall target="run-applet"/>
1196
    </target>
1197
    <!--
508
                ===============
1198
                ===============
509
                JAVADOC SECTION
1199
                JAVADOC SECTION
510
                ===============
1200
                ===============
511
            -->
1201
            -->
512
    <target depends="init" name="-javadoc-build">
1202
    <target depends="init" if="have.sources" name="-javadoc-build">
513
        <mkdir dir="${dist.javadoc.dir}"/>
1203
        <mkdir dir="${dist.javadoc.dir}"/>
514
        <javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
1204
        <condition else="" property="javadoc.endorsed.classpath.cmd.line.arg" value="-J${endorsed.classpath.cmd.line.arg}">
1205
            <and>
1206
                <isset property="endorsed.classpath.cmd.line.arg"/>
1207
                <not>
1208
                    <equals arg1="${endorsed.classpath.cmd.line.arg}" arg2=""/>
1209
                </not>
1210
            </and>
1211
        </condition>
1212
        <condition else="" property="bug5101868workaround" value="*.java">
1213
            <matches pattern="1\.[56](\..*)?" string="${java.version}"/>
1214
        </condition>
1215
        <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}">
515
            <classpath>
1216
            <classpath>
516
                <path path="${javac.classpath}"/>
1217
                <path path="${javac.classpath}"/>
517
            </classpath>
1218
            </classpath>
518
            <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
1219
            <fileset dir="${src.dir}" excludes="${bug5101868workaround},${excludes}" includes="${includes}">
519
                <filename name="**/*.java"/>
1220
                <filename name="**/*.java"/>
520
            </fileset>
1221
            </fileset>
521
            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
1222
            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
522
                <include name="**/*.java"/>
1223
                <include name="**/*.java"/>
1224
                <exclude name="*.java"/>
523
            </fileset>
1225
            </fileset>
1226
            <arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/>
524
        </javadoc>
1227
        </javadoc>
1228
        <copy todir="${dist.javadoc.dir}">
1229
            <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
1230
                <filename name="**/doc-files/**"/>
1231
            </fileset>
1232
            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
1233
                <include name="**/doc-files/**"/>
1234
            </fileset>
1235
        </copy>
525
    </target>
1236
    </target>
526
    <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
1237
    <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
527
        <nbbrowse file="${dist.javadoc.dir}/index.html"/>
1238
        <nbbrowse file="${dist.javadoc.dir}/index.html"/>
Lines 529-535 Link Here
529
    <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
1240
    <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
530
    <!--
1241
    <!--
531
                =========================
1242
                =========================
532
                JUNIT COMPILATION SECTION
1243
                TEST COMPILATION SECTION
533
                =========================
1244
                =========================
534
            -->
1245
            -->
535
    <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
1246
    <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
Lines 542-549 Link Here
542
    <target if="do.depend.true" name="-compile-test-depend">
1253
    <target if="do.depend.true" name="-compile-test-depend">
543
        <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
1254
        <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
544
    </target>
1255
    </target>
545
    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
1256
    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
546
        <j2seproject3:javac classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
1257
        <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" processorpath="${javac.test.processorpath}" srcdir="${test.src.dir}"/>
547
        <copy todir="${build.test.classes.dir}">
1258
        <copy todir="${build.test.classes.dir}">
548
            <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
1259
            <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
549
        </copy>
1260
        </copy>
Lines 557-566 Link Here
557
        <!-- Empty placeholder for easier customization. -->
1268
        <!-- Empty placeholder for easier customization. -->
558
        <!-- You can override this target in the ../build.xml file. -->
1269
        <!-- You can override this target in the ../build.xml file. -->
559
    </target>
1270
    </target>
560
    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
1271
    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
561
        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
1272
        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
562
        <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
1273
        <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
563
        <j2seproject3:javac classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" sourcepath="${test.src.dir}" srcdir="${test.src.dir}"/>
1274
        <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" processorpath="${javac.test.processorpath}" sourcepath="${test.src.dir}" srcdir="${test.src.dir}"/>
564
        <copy todir="${build.test.classes.dir}">
1275
        <copy todir="${build.test.classes.dir}">
565
            <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
1276
            <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
566
        </copy>
1277
        </copy>
Lines 572-585 Link Here
572
    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
1283
    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
573
    <!--
1284
    <!--
574
                =======================
1285
                =======================
575
                JUNIT EXECUTION SECTION
1286
                TEST EXECUTION SECTION
576
                =======================
1287
                =======================
577
            -->
1288
            -->
578
    <target depends="init" if="have.tests" name="-pre-test-run">
1289
    <target depends="init" if="have.tests" name="-pre-test-run">
579
        <mkdir dir="${build.test.results.dir}"/>
1290
        <mkdir dir="${build.test.results.dir}"/>
580
    </target>
1291
    </target>
581
    <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
1292
    <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
582
        <j2seproject3:junit testincludes="**/*Test.java"/>
1293
        <j2seproject3:test includes="${includes}" testincludes="**/*Test.java"/>
583
    </target>
1294
    </target>
584
    <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
1295
    <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
585
        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
1296
        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
Lines 592-630 Link Here
592
    </target>
1303
    </target>
593
    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
1304
    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
594
        <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
1305
        <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
595
        <j2seproject3:junit excludes="" includes="${test.includes}"/>
1306
        <j2seproject3:test excludes="" includes="${test.includes}" testincludes="${test.includes}"/>
596
    </target>
1307
    </target>
597
    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
1308
    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
598
        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
1309
        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
599
    </target>
1310
    </target>
600
    <target depends="init,-do-not-recompile,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/>
1311
    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/>
1312
    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single-method">
1313
        <fail unless="test.class">Must select some files in the IDE or set test.class</fail>
1314
        <fail unless="test.method">Must select some method in the IDE or set test.method</fail>
1315
        <j2seproject3:test excludes="" includes="${javac.includes}" testincludes="${test.class}" testmethods="${test.method}"/>
1316
    </target>
1317
    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single-method" if="have.tests" name="-post-test-run-single-method">
1318
        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
1319
    </target>
1320
    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single-method,-post-test-run-single-method" description="Run single unit test." name="test-single-method"/>
601
    <!--
1321
    <!--
602
                =======================
1322
                =======================
603
                JUNIT DEBUGGING SECTION
1323
                TEST DEBUGGING SECTION
604
                =======================
1324
                =======================
605
            -->
1325
            -->
606
    <target depends="init,compile-test" if="have.tests" name="-debug-start-debuggee-test">
1326
    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test">
607
        <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
1327
        <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
608
        <property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/>
1328
        <j2seproject3:test-debug excludes="" includes="${javac.includes}" testClass="${test.class}" testincludes="${javac.includes}"/>
609
        <delete file="${test.report.file}"/>
1329
    </target>
610
        <mkdir dir="${build.test.results.dir}"/>
1330
    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test-method">
611
        <j2seproject3:debug classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner" classpath="${ant.home}/lib/ant.jar:${ant.home}/lib/ant-junit.jar:${debug.test.classpath}">
1331
        <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
612
            <customize>
1332
        <fail unless="test.method">Must select some method in the IDE or set test.method</fail>
613
                <syspropertyset>
1333
        <j2seproject3:test-debug excludes="" includes="${javac.includes}" testClass="${test.class}" testMethod="${test.method}" testincludes="${test.class}" testmethods="${test.method}"/>
614
                    <propertyref prefix="test-sys-prop."/>
615
                    <mapper from="test-sys-prop.*" to="*" type="glob"/>
616
                </syspropertyset>
617
                <arg value="${test.class}"/>
618
                <arg value="showoutput=true"/>
619
                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/>
620
                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/>
621
            </customize>
622
        </j2seproject3:debug>
623
    </target>
1334
    </target>
624
    <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
1335
    <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
625
        <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
1336
        <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
626
    </target>
1337
    </target>
627
    <target depends="init,-do-not-recompile,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
1338
    <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
1339
    <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test-method" name="debug-test-method"/>
628
    <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
1340
    <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
629
        <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
1341
        <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
630
    </target>
1342
    </target>
Lines 661-674 Link Here
661
                CLEANUP SECTION
1373
                CLEANUP SECTION
662
                ===============
1374
                ===============
663
            -->
1375
            -->
664
    <target depends="init" name="deps-clean" unless="no.deps"/>
1376
    <target name="-deps-clean-init" unless="built-clean.properties">
1377
        <property location="${build.dir}/built-clean.properties" name="built-clean.properties"/>
1378
        <delete file="${built-clean.properties}" quiet="true"/>
1379
    </target>
1380
    <target if="already.built.clean.${basedir}" name="-warn-already-built-clean">
1381
        <echo level="warn" message="Cycle detected: GroovyJavaDemo was already built"/>
1382
    </target>
1383
    <target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps">
1384
        <mkdir dir="${build.dir}"/>
1385
        <touch file="${built-clean.properties}" verbose="false"/>
1386
        <property file="${built-clean.properties}" prefix="already.built.clean."/>
1387
        <antcall target="-warn-already-built-clean"/>
1388
        <propertyfile file="${built-clean.properties}">
1389
            <entry key="${basedir}" value=""/>
1390
        </propertyfile>
1391
    </target>
665
    <target depends="init" name="-do-clean">
1392
    <target depends="init" name="-do-clean">
666
        <delete dir="${build.dir}"/>
1393
        <delete dir="${build.dir}"/>
667
        <delete dir="${dist.dir}"/>
1394
        <delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/>
668
    </target>
1395
    </target>
669
    <target name="-post-clean">
1396
    <target name="-post-clean">
670
        <!-- Empty placeholder for easier customization. -->
1397
        <!-- Empty placeholder for easier customization. -->
671
        <!-- You can override this target in the ../build.xml file. -->
1398
        <!-- You can override this target in the ../build.xml file. -->
672
    </target>
1399
    </target>
673
    <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
1400
    <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
1401
    <target name="-check-call-dep">
1402
        <property file="${call.built.properties}" prefix="already.built."/>
1403
        <condition property="should.call.dep">
1404
            <and>
1405
                <not>
1406
                    <isset property="already.built.${call.subproject}"/>
1407
                </not>
1408
                <available file="${call.script}"/>
1409
            </and>
1410
        </condition>
1411
    </target>
1412
    <target depends="-check-call-dep" if="should.call.dep" name="-maybe-call-dep">
1413
        <ant antfile="${call.script}" inheritall="false" target="${call.target}">
1414
            <propertyset>
1415
                <propertyref prefix="transfer."/>
1416
                <mapper from="transfer.*" to="*" type="glob"/>
1417
            </propertyset>
1418
        </ant>
1419
    </target>
674
</project>
1420
</project>
(-)a/groovy.samples/sample_src/GroovyJavaDemo/nbproject/genfiles.properties (-6 / +6 lines)
Lines 3-11 Link Here
3
build.xml.stylesheet.CRC32=958a1d3e@1.24.0.45
3
build.xml.stylesheet.CRC32=958a1d3e@1.24.0.45
4
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
4
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
5
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
5
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
6
nbproject/build-impl.xml.data.CRC32=68ef7ca2
6
nbproject/build-impl.xml.data.CRC32=0af7d1bc
7
nbproject/build-impl.xml.script.CRC32=3983e373
7
nbproject/build-impl.xml.script.CRC32=ad58d3d7
8
nbproject/build-impl.xml.stylesheet.CRC32=7ae93da6@1.24.0.45
8
nbproject/build-impl.xml.stylesheet.CRC32=05530350@1.79.1.48
9
nbproject/groovy-build.xml.data.CRC32=68ef7ca2
9
nbproject/groovy-build.xml.data.CRC32=0af7d1bc
10
nbproject/groovy-build.xml.script.CRC32=3bbde5d0
10
nbproject/groovy-build.xml.script.CRC32=66297360
11
nbproject/groovy-build.xml.stylesheet.CRC32=c99f72ec@1.7
11
nbproject/groovy-build.xml.stylesheet.CRC32=28d0e1f2@1.11.1
(-)a/groovy.samples/sample_src/GroovyJavaDemo/nbproject/groovy-build.xml (-12 / +32 lines)
Lines 3-8 Link Here
3
*** GENERATED FROM project.xml - DO NOT EDIT  ***
3
*** GENERATED FROM project.xml - DO NOT EDIT  ***
4
***         EDIT ../build.xml INSTEAD         ***
4
***         EDIT ../build.xml INSTEAD         ***
5
5
6
        
6
        -->
7
        -->
7
<project xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc">
8
<project xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc">
8
    <target name="-groovy-init-macrodef-javac">
9
    <target name="-groovy-init-macrodef-javac">
Lines 13-24 Link Here
13
            <attribute name="includes" default="${includes}"/>
14
            <attribute name="includes" default="${includes}"/>
14
            <attribute name="excludes" default="${excludes}"/>
15
            <attribute name="excludes" default="${excludes}"/>
15
            <attribute name="debug" default="${javac.debug}"/>
16
            <attribute name="debug" default="${javac.debug}"/>
16
            <attribute name="sourcepath" default="/does/not/exist"/>
17
            <attribute name="sourcepath" default="${empty.dir}"/>
17
            <attribute name="gensrcdir" default="/does/not/exist"/>
18
            <attribute name="gensrcdir" default="${empty.dir}"/>
19
            <attribute name="processorpath" default="${javac.processorpath}"/>
20
            <attribute name="apgeneratedsrcdir" default="${build.generated.sources.dir}/ap-source-output"/>
18
            <element name="customize" optional="true"/>
21
            <element name="customize" optional="true"/>
19
            <sequential>
22
            <sequential>
20
                <taskdef name="groovyc" classpath="${javac.classpath}" classname="org.codehaus.groovy.ant.Groovyc"/>
23
                <taskdef name="groovyc" classpath="${javac.classpath}" classname="org.codehaus.groovy.ant.Groovyc"/>
21
                <groovyc srcdir="@{srcdir}" sourcepath="@{sourcepath}" destdir="@{destdir}" encoding="${source.encoding}" includes="@{includes}" excludes="@{excludes}">
24
                <property name="empty.dir" location="${build.dir}/empty"/>
25
                <mkdir dir="${empty.dir}"/>
26
                <groovyc srcdir="@{srcdir}" sourcepath="@{sourcepath}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" includeAntRuntime="false" fork="true">
22
                    <src>
27
                    <src>
23
                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
28
                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
24
                            <include name="*"/>
29
                            <include name="*"/>
Lines 27-41 Link Here
27
                    <classpath>
32
                    <classpath>
28
                        <path path="@{classpath}"/>
33
                        <path path="@{classpath}"/>
29
                    </classpath>
34
                    </classpath>
30
                    <javac srcdir="@{srcdir}" sourcepath="@{sourcepath}" destdir="@{destdir}" debug="@{debug}" deprecation="${javac.deprecation}" encoding="${source.encoding}" source="${javac.source}" target="${javac.target}" includes="@{includes}" excludes="@{excludes}" includeantruntime="false">
35
                    <javac debug="@{debug}" deprecation="${javac.deprecation}" encoding="${source.encoding}" source="${javac.source}" target="${javac.target}">
31
                        <src>
32
                            <dirset dir="@{gensrcdir}" erroronmissingdir="false">
33
                                <include name="*"/>
34
                            </dirset>
35
                        </src>
36
                        <classpath>
37
                            <path path="@{classpath}"/>
38
                        </classpath>
39
                        <compilerarg line="${javac.compilerargs} ${javac.compilerargs.jaxws}"/>
36
                        <compilerarg line="${javac.compilerargs} ${javac.compilerargs.jaxws}"/>
40
                        <customize/>
37
                        <customize/>
41
                    </javac>
38
                    </javac>
Lines 70-73 Link Here
70
            </sequential>
67
            </sequential>
71
        </macrodef>
68
        </macrodef>
72
    </target>
69
    </target>
70
    <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run-with-groovy">
71
        <j2seproject3:test testincludes=""/>
72
    </target>
73
    <target depends="init,compile-test,-pre-test-run,-do-test-run-with-groovy" if="have.tests" name="-post-test-run-with-groovy">
74
        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
75
    </target>
76
    <target depends="init,compile-test,-pre-test-run,-do-test-run-with-groovy,test-report,-post-test-run-with-groovy,-test-browse" description="Run unit tests." name="test-with-groovy"/>
77
    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single-groovy">
78
        <fail unless="test.binarytestincludes">Must select some files in the IDE or set test.includes</fail>
79
        <j2seproject3:test testincludes=""/>
80
    </target>
81
    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single-groovy" if="have.tests" name="-post-test-run-single-groovy">
82
        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
83
    </target>
84
    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single-groovy,-post-test-run-single-groovy" description="Run single unit test." name="test-single-groovy"/>
85
    <target depends="init,compile-test-single,-pre-test-run-single,-debug-start-debugger-test" name="-do-test-debug-single-groovy">
86
        <fail unless="test.binarytestincludes">Must select some files in the IDE or set test.binarytestincludes</fail>
87
        <j2seproject3:test-debug testincludes=""/>
88
    </target>
89
    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-debug-single-groovy" if="have.tests" name="-post-test-debug-single-groovy">
90
        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
91
    </target>
92
    <target depends="init,compile-test-single,-pre-test-run-single,-debug-start-debugger-test,-do-test-debug-single-groovy,-post-test-debug-single-groovy" name="debug-test-with-groovy"/>
73
</project>
93
</project>
(-)a/groovy.samples/sample_src/GroovyJavaDemo/nbproject/project.properties (-2 / +2 lines)
Lines 65-72 Link Here
65
# Space-separated list of extra javac options
65
# Space-separated list of extra javac options
66
javac.compilerargs=
66
javac.compilerargs=
67
javac.deprecation=false
67
javac.deprecation=false
68
javac.source=1.5
68
javac.source=1.8
69
javac.target=1.5
69
javac.target=1.8
70
javac.test.classpath=\
70
javac.test.classpath=\
71
    ${javac.classpath}:\
71
    ${javac.classpath}:\
72
    ${build.classes.dir}:\
72
    ${build.classes.dir}:\
(-)a/groovy.samples/sample_src/NBProjectGenerators/nbproject/build-impl.xml (-109 / +849 lines)
Lines 12-26 Link Here
12
  - execution
12
  - execution
13
  - debugging
13
  - debugging
14
  - javadoc
14
  - javadoc
15
  - junit compilation
15
  - test compilation
16
  - junit execution
16
  - test execution
17
  - junit debugging
17
  - test debugging
18
  - applet
18
  - applet
19
  - cleanup
19
  - cleanup
20
20
21
        -->
21
        -->
22
<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="NBProjectGenerators-impl">
22
<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="NBProjectGenerators-impl">
23
    <import file="groovy-build.xml"/>
23
    <import file="groovy-build.xml"/>
24
    <fail message="Please build using Ant 1.8.0 or higher.">
25
        <condition>
26
            <not>
27
                <antversion atleast="1.8.0"/>
28
            </not>
29
        </condition>
30
    </fail>
24
    <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
31
    <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
25
    <!-- 
32
    <!-- 
26
                ======================
33
                ======================
Lines 48-67 Link Here
48
        <property file="nbproject/project.properties"/>
55
        <property file="nbproject/project.properties"/>
49
    </target>
56
    </target>
50
    <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init">
57
    <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init">
58
        <property name="platform.java" value="${java.home}/bin/java"/>
51
        <available file="${manifest.file}" property="manifest.available"/>
59
        <available file="${manifest.file}" property="manifest.available"/>
52
        <condition property="manifest.available+main.class">
60
        <condition property="splashscreen.available">
53
            <and>
61
            <and>
54
                <isset property="manifest.available"/>
62
                <not>
63
                    <equals arg1="${application.splash}" arg2="" trim="true"/>
64
                </not>
65
                <available file="${application.splash}"/>
66
            </and>
67
        </condition>
68
        <condition property="main.class.available">
69
            <and>
55
                <isset property="main.class"/>
70
                <isset property="main.class"/>
56
                <not>
71
                <not>
57
                    <equals arg1="${main.class}" arg2="" trim="true"/>
72
                    <equals arg1="${main.class}" arg2="" trim="true"/>
58
                </not>
73
                </not>
59
            </and>
74
            </and>
60
        </condition>
75
        </condition>
61
        <condition property="manifest.available+main.class+mkdist.available">
76
        <condition property="profile.available">
62
            <and>
77
            <and>
63
                <istrue value="${manifest.available+main.class}"/>
78
                <isset property="javac.profile"/>
79
                <length length="0" string="${javac.profile}" when="greater"/>
80
                <matches pattern="1\.[89](\..*)?" string="${javac.source}"/>
81
            </and>
82
        </condition>
83
        <condition property="do.archive">
84
            <or>
85
                <not>
86
                    <istrue value="${jar.archive.disabled}"/>
87
                </not>
88
                <istrue value="${not.archive.disabled}"/>
89
            </or>
90
        </condition>
91
        <condition property="do.mkdist">
92
            <and>
93
                <isset property="do.archive"/>
64
                <isset property="libs.CopyLibs.classpath"/>
94
                <isset property="libs.CopyLibs.classpath"/>
95
                <not>
96
                    <istrue value="${mkdist.disabled}"/>
97
                </not>
98
            </and>
99
        </condition>
100
        <condition property="do.archive+manifest.available">
101
            <and>
102
                <isset property="manifest.available"/>
103
                <istrue value="${do.archive}"/>
104
            </and>
105
        </condition>
106
        <condition property="do.archive+main.class.available">
107
            <and>
108
                <isset property="main.class.available"/>
109
                <istrue value="${do.archive}"/>
110
            </and>
111
        </condition>
112
        <condition property="do.archive+splashscreen.available">
113
            <and>
114
                <isset property="splashscreen.available"/>
115
                <istrue value="${do.archive}"/>
116
            </and>
117
        </condition>
118
        <condition property="do.archive+profile.available">
119
            <and>
120
                <isset property="profile.available"/>
121
                <istrue value="${do.archive}"/>
65
            </and>
122
            </and>
66
        </condition>
123
        </condition>
67
        <condition property="have.tests">
124
        <condition property="have.tests">
Lines 85-90 Link Here
85
            </and>
142
            </and>
86
        </condition>
143
        </condition>
87
        <property name="run.jvmargs" value=""/>
144
        <property name="run.jvmargs" value=""/>
145
        <property name="run.jvmargs.ide" value=""/>
88
        <property name="javac.compilerargs" value=""/>
146
        <property name="javac.compilerargs" value=""/>
89
        <property name="work.dir" value="${basedir}"/>
147
        <property name="work.dir" value="${basedir}"/>
90
        <condition property="no.deps">
148
        <condition property="no.deps">
Lines 96-101 Link Here
96
        <property name="javadoc.preview" value="true"/>
154
        <property name="javadoc.preview" value="true"/>
97
        <property name="application.args" value=""/>
155
        <property name="application.args" value=""/>
98
        <property name="source.encoding" value="${file.encoding}"/>
156
        <property name="source.encoding" value="${file.encoding}"/>
157
        <property name="runtime.encoding" value="${source.encoding}"/>
99
        <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
158
        <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
100
            <and>
159
            <and>
101
                <isset property="javadoc.encoding"/>
160
                <isset property="javadoc.encoding"/>
Lines 111-122 Link Here
111
        <condition property="do.depend.true">
170
        <condition property="do.depend.true">
112
            <istrue value="${do.depend}"/>
171
            <istrue value="${do.depend}"/>
113
        </condition>
172
        </condition>
114
        <condition else="" property="javac.compilerargs.jaxws" value="-Djava.endorsed.dirs='${jaxws.endorsed.dir}'">
173
        <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
174
        <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
115
            <and>
175
            <and>
116
                <isset property="jaxws.endorsed.dir"/>
176
                <isset property="endorsed.classpath"/>
117
                <available file="nbproject/jaxws-build.xml"/>
177
                <not>
178
                    <equals arg1="${endorsed.classpath}" arg2="" trim="true"/>
179
                </not>
118
            </and>
180
            </and>
119
        </condition>
181
        </condition>
182
        <condition else="" property="javac.profile.cmd.line.arg" value="-profile ${javac.profile}">
183
            <isset property="profile.available"/>
184
        </condition>
185
        <condition else="false" property="jdkBug6558476">
186
            <and>
187
                <matches pattern="1\.[56]" string="${java.specification.version}"/>
188
                <not>
189
                    <os family="unix"/>
190
                </not>
191
            </and>
192
        </condition>
193
        <condition else="false" property="javac.fork">
194
            <or>
195
                <istrue value="${jdkBug6558476}"/>
196
                <istrue value="${javac.external.vm}"/>
197
            </or>
198
        </condition>
199
        <property name="jar.index" value="false"/>
200
        <property name="jar.index.metainf" value="${jar.index}"/>
201
        <property name="copylibs.rebase" value="true"/>
202
        <available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
203
        <condition property="junit.available">
204
            <or>
205
                <available classname="org.junit.Test" classpath="${run.test.classpath}"/>
206
                <available classname="junit.framework.Test" classpath="${run.test.classpath}"/>
207
            </or>
208
        </condition>
209
        <condition property="testng.available">
210
            <available classname="org.testng.annotations.Test" classpath="${run.test.classpath}"/>
211
        </condition>
212
        <condition property="junit+testng.available">
213
            <and>
214
                <istrue value="${junit.available}"/>
215
                <istrue value="${testng.available}"/>
216
            </and>
217
        </condition>
218
        <condition else="testng" property="testng.mode" value="mixed">
219
            <istrue value="${junit+testng.available}"/>
220
        </condition>
221
        <condition else="" property="testng.debug.mode" value="-mixed">
222
            <istrue value="${junit+testng.available}"/>
223
        </condition>
224
        <property name="java.failonerror" value="true"/>
120
    </target>
225
    </target>
121
    <target name="-post-init">
226
    <target name="-post-init">
122
        <!-- Empty placeholder for easier customization. -->
227
        <!-- Empty placeholder for easier customization. -->
Lines 142-160 Link Here
142
            </sequential>
247
            </sequential>
143
        </macrodef>
248
        </macrodef>
144
    </target>
249
    </target>
145
    <target name="-init-macrodef-javac">
250
    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors">
146
        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
251
        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
147
            <attribute default="${src.dir}" name="srcdir"/>
252
            <attribute default="${src.dir}" name="srcdir"/>
148
            <attribute default="${build.classes.dir}" name="destdir"/>
253
            <attribute default="${build.classes.dir}" name="destdir"/>
149
            <attribute default="${javac.classpath}" name="classpath"/>
254
            <attribute default="${javac.classpath}" name="classpath"/>
255
            <attribute default="${javac.processorpath}" name="processorpath"/>
256
            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
150
            <attribute default="${includes}" name="includes"/>
257
            <attribute default="${includes}" name="includes"/>
151
            <attribute default="${excludes}" name="excludes"/>
258
            <attribute default="${excludes}" name="excludes"/>
152
            <attribute default="${javac.debug}" name="debug"/>
259
            <attribute default="${javac.debug}" name="debug"/>
153
            <attribute default="/does/not/exist" name="sourcepath"/>
260
            <attribute default="${empty.dir}" name="sourcepath"/>
154
            <attribute default="/does/not/exist" name="gensrcdir"/>
261
            <attribute default="${empty.dir}" name="gensrcdir"/>
155
            <element name="customize" optional="true"/>
262
            <element name="customize" optional="true"/>
156
            <sequential>
263
            <sequential>
157
                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}">
264
                <property location="${build.dir}/empty" name="empty.dir"/>
265
                <mkdir dir="${empty.dir}"/>
266
                <mkdir dir="@{apgeneratedsrcdir}"/>
267
                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
158
                    <src>
268
                    <src>
159
                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
269
                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
160
                            <include name="*"/>
270
                            <include name="*"/>
Lines 163-173 Link Here
163
                    <classpath>
273
                    <classpath>
164
                        <path path="@{classpath}"/>
274
                        <path path="@{classpath}"/>
165
                    </classpath>
275
                    </classpath>
166
                    <compilerarg line="${javac.compilerargs} ${javac.compilerargs.jaxws}"/>
276
                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
277
                    <compilerarg line="${javac.profile.cmd.line.arg}"/>
278
                    <compilerarg line="${javac.compilerargs}"/>
279
                    <compilerarg value="-processorpath"/>
280
                    <compilerarg path="@{processorpath}:${empty.dir}"/>
281
                    <compilerarg line="${ap.processors.internal}"/>
282
                    <compilerarg line="${annotation.processing.processor.options}"/>
283
                    <compilerarg value="-s"/>
284
                    <compilerarg path="@{apgeneratedsrcdir}"/>
285
                    <compilerarg line="${ap.proc.none.internal}"/>
167
                    <customize/>
286
                    <customize/>
168
                </javac>
287
                </javac>
169
            </sequential>
288
            </sequential>
170
        </macrodef>
289
        </macrodef>
290
    </target>
291
    <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
292
        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
293
            <attribute default="${src.dir}" name="srcdir"/>
294
            <attribute default="${build.classes.dir}" name="destdir"/>
295
            <attribute default="${javac.classpath}" name="classpath"/>
296
            <attribute default="${javac.processorpath}" name="processorpath"/>
297
            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
298
            <attribute default="${includes}" name="includes"/>
299
            <attribute default="${excludes}" name="excludes"/>
300
            <attribute default="${javac.debug}" name="debug"/>
301
            <attribute default="${empty.dir}" name="sourcepath"/>
302
            <attribute default="${empty.dir}" name="gensrcdir"/>
303
            <element name="customize" optional="true"/>
304
            <sequential>
305
                <property location="${build.dir}/empty" name="empty.dir"/>
306
                <mkdir dir="${empty.dir}"/>
307
                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
308
                    <src>
309
                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
310
                            <include name="*"/>
311
                        </dirset>
312
                    </src>
313
                    <classpath>
314
                        <path path="@{classpath}"/>
315
                    </classpath>
316
                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
317
                    <compilerarg line="${javac.profile.cmd.line.arg}"/>
318
                    <compilerarg line="${javac.compilerargs}"/>
319
                    <customize/>
320
                </javac>
321
            </sequential>
322
        </macrodef>
323
    </target>
324
    <target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
171
        <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
325
        <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
172
            <attribute default="${src.dir}" name="srcdir"/>
326
            <attribute default="${src.dir}" name="srcdir"/>
173
            <attribute default="${build.classes.dir}" name="destdir"/>
327
            <attribute default="${build.classes.dir}" name="destdir"/>
Lines 184-223 Link Here
184
            <attribute default="${build.classes.dir}" name="destdir"/>
338
            <attribute default="${build.classes.dir}" name="destdir"/>
185
            <sequential>
339
            <sequential>
186
                <fail unless="javac.includes">Must set javac.includes</fail>
340
                <fail unless="javac.includes">Must set javac.includes</fail>
187
                <pathconvert pathsep="," property="javac.includes.binary">
341
                <pathconvert pathsep="${line.separator}" property="javac.includes.binary">
188
                    <path>
342
                    <path>
189
                        <filelist dir="@{destdir}" files="${javac.includes}"/>
343
                        <filelist dir="@{destdir}" files="${javac.includes}"/>
190
                    </path>
344
                    </path>
191
                    <globmapper from="*.java" to="*.class"/>
345
                    <globmapper from="*.java" to="*.class"/>
192
                </pathconvert>
346
                </pathconvert>
347
                <tempfile deleteonexit="true" property="javac.includesfile.binary"/>
348
                <echo file="${javac.includesfile.binary}" message="${javac.includes.binary}"/>
193
                <delete>
349
                <delete>
194
                    <files includes="${javac.includes.binary}"/>
350
                    <files includesfile="${javac.includesfile.binary}"/>
351
                </delete>
352
                <delete>
353
                    <fileset file="${javac.includesfile.binary}"/>
195
                </delete>
354
                </delete>
196
            </sequential>
355
            </sequential>
197
        </macrodef>
356
        </macrodef>
198
    </target>
357
    </target>
199
    <target name="-init-macrodef-junit">
358
    <target if="${junit.available}" name="-init-macrodef-junit-init">
359
        <condition else="false" property="nb.junit.batch" value="true">
360
            <and>
361
                <istrue value="${junit.available}"/>
362
                <not>
363
                    <isset property="test.method"/>
364
                </not>
365
            </and>
366
        </condition>
367
        <condition else="false" property="nb.junit.single" value="true">
368
            <and>
369
                <istrue value="${junit.available}"/>
370
                <isset property="test.method"/>
371
            </and>
372
        </condition>
373
    </target>
374
    <target name="-init-test-properties">
375
        <property name="test.binaryincludes" value="&lt;nothing&gt;"/>
376
        <property name="test.binarytestincludes" value=""/>
377
        <property name="test.binaryexcludes" value=""/>
378
    </target>
379
    <target if="${nb.junit.single}" name="-init-macrodef-junit-single" unless="${nb.junit.batch}">
200
        <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
380
        <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
201
            <attribute default="${includes}" name="includes"/>
381
            <attribute default="${includes}" name="includes"/>
202
            <attribute default="${excludes}" name="excludes"/>
382
            <attribute default="${excludes}" name="excludes"/>
203
            <attribute default="**" name="testincludes"/>
383
            <attribute default="**" name="testincludes"/>
384
            <attribute default="" name="testmethods"/>
385
            <element name="customize" optional="true"/>
204
            <sequential>
386
            <sequential>
205
                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true">
387
                <property name="junit.forkmode" value="perTest"/>
206
                    <batchtest todir="${build.test.results.dir}"/>
388
                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
207
                    <classpath>
389
                    <test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/>
208
                        <path path="${run.test.classpath}"/>
209
                    </classpath>
210
                    <syspropertyset>
390
                    <syspropertyset>
211
                        <propertyref prefix="test-sys-prop."/>
391
                        <propertyref prefix="test-sys-prop."/>
212
                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
392
                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
213
                    </syspropertyset>
393
                    </syspropertyset>
214
                    <formatter type="brief" usefile="false"/>
394
                    <formatter type="brief" usefile="false"/>
215
                    <formatter type="xml"/>
395
                    <formatter type="xml"/>
216
                    <jvmarg line="${run.jvmargs}"/>
396
                    <jvmarg value="-ea"/>
397
                    <customize/>
217
                </junit>
398
                </junit>
218
            </sequential>
399
            </sequential>
219
        </macrodef>
400
        </macrodef>
220
    </target>
401
    </target>
402
    <target depends="-init-test-properties" if="${nb.junit.batch}" name="-init-macrodef-junit-batch" unless="${nb.junit.single}">
403
        <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
404
            <attribute default="${includes}" name="includes"/>
405
            <attribute default="${excludes}" name="excludes"/>
406
            <attribute default="**" name="testincludes"/>
407
            <attribute default="" name="testmethods"/>
408
            <element name="customize" optional="true"/>
409
            <sequential>
410
                <property name="junit.forkmode" value="perTest"/>
411
                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
412
                    <batchtest todir="${build.test.results.dir}">
413
                        <fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}">
414
                            <filename name="${test.binarytestincludes}"/>
415
                        </fileset>
416
                    </batchtest>
417
                    <syspropertyset>
418
                        <propertyref prefix="test-sys-prop."/>
419
                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
420
                    </syspropertyset>
421
                    <formatter type="brief" usefile="false"/>
422
                    <formatter type="xml"/>
423
                    <jvmarg value="-ea"/>
424
                    <customize/>
425
                </junit>
426
            </sequential>
427
        </macrodef>
428
    </target>
429
    <target depends="-init-macrodef-junit-init,-init-macrodef-junit-single, -init-macrodef-junit-batch" if="${junit.available}" name="-init-macrodef-junit"/>
430
    <target if="${testng.available}" name="-init-macrodef-testng">
431
        <macrodef name="testng" uri="http://www.netbeans.org/ns/j2se-project/3">
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
                <condition else="" property="testng.methods.arg" value="@{testincludes}.@{testmethods}">
439
                    <isset property="test.method"/>
440
                </condition>
441
                <union id="test.set"/>
442
                <taskdef classname="org.testng.TestNGAntTask" classpath="${run.test.classpath}" name="testng"/>
443
                <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="NBProjectGenerators" testname="TestNG tests" workingDir="${work.dir}">
444
                    <xmlfileset dir="${build.test.classes.dir}" includes="@{testincludes}"/>
445
                    <propertyset>
446
                        <propertyref prefix="test-sys-prop."/>
447
                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
448
                    </propertyset>
449
                    <customize/>
450
                </testng>
451
            </sequential>
452
        </macrodef>
453
    </target>
454
    <target name="-init-macrodef-test-impl">
455
        <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
456
            <attribute default="${includes}" name="includes"/>
457
            <attribute default="${excludes}" name="excludes"/>
458
            <attribute default="**" name="testincludes"/>
459
            <attribute default="" name="testmethods"/>
460
            <element implicit="true" name="customize" optional="true"/>
461
            <sequential>
462
                <echo>No tests executed.</echo>
463
            </sequential>
464
        </macrodef>
465
    </target>
466
    <target depends="-init-macrodef-junit" if="${junit.available}" name="-init-macrodef-junit-impl">
467
        <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
468
            <attribute default="${includes}" name="includes"/>
469
            <attribute default="${excludes}" name="excludes"/>
470
            <attribute default="**" name="testincludes"/>
471
            <attribute default="" name="testmethods"/>
472
            <element implicit="true" name="customize" optional="true"/>
473
            <sequential>
474
                <j2seproject3:junit excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
475
                    <customize/>
476
                </j2seproject3:junit>
477
            </sequential>
478
        </macrodef>
479
    </target>
480
    <target depends="-init-macrodef-testng" if="${testng.available}" name="-init-macrodef-testng-impl">
481
        <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
482
            <attribute default="${includes}" name="includes"/>
483
            <attribute default="${excludes}" name="excludes"/>
484
            <attribute default="**" name="testincludes"/>
485
            <attribute default="" name="testmethods"/>
486
            <element implicit="true" name="customize" optional="true"/>
487
            <sequential>
488
                <j2seproject3:testng excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
489
                    <customize/>
490
                </j2seproject3:testng>
491
            </sequential>
492
        </macrodef>
493
    </target>
494
    <target depends="-init-macrodef-test-impl,-init-macrodef-junit-impl,-init-macrodef-testng-impl" name="-init-macrodef-test">
495
        <macrodef name="test" uri="http://www.netbeans.org/ns/j2se-project/3">
496
            <attribute default="${includes}" name="includes"/>
497
            <attribute default="${excludes}" name="excludes"/>
498
            <attribute default="**" name="testincludes"/>
499
            <attribute default="" name="testmethods"/>
500
            <sequential>
501
                <j2seproject3:test-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
502
                    <customize>
503
                        <classpath>
504
                            <path path="${run.test.classpath}"/>
505
                        </classpath>
506
                        <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
507
                        <jvmarg line="${run.jvmargs}"/>
508
                        <jvmarg line="${run.jvmargs.ide}"/>
509
                    </customize>
510
                </j2seproject3:test-impl>
511
            </sequential>
512
        </macrodef>
513
    </target>
514
    <target if="${junit.available}" name="-init-macrodef-junit-debug" unless="${nb.junit.batch}">
515
        <macrodef name="junit-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
516
            <attribute default="${includes}" name="includes"/>
517
            <attribute default="${excludes}" name="excludes"/>
518
            <attribute default="**" name="testincludes"/>
519
            <attribute default="" name="testmethods"/>
520
            <element name="customize" optional="true"/>
521
            <sequential>
522
                <property name="junit.forkmode" value="perTest"/>
523
                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
524
                    <test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/>
525
                    <syspropertyset>
526
                        <propertyref prefix="test-sys-prop."/>
527
                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
528
                    </syspropertyset>
529
                    <formatter type="brief" usefile="false"/>
530
                    <formatter type="xml"/>
531
                    <jvmarg value="-ea"/>
532
                    <jvmarg line="${debug-args-line}"/>
533
                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
534
                    <customize/>
535
                </junit>
536
            </sequential>
537
        </macrodef>
538
    </target>
539
    <target depends="-init-test-properties" if="${nb.junit.batch}" name="-init-macrodef-junit-debug-batch">
540
        <macrodef name="junit-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
541
            <attribute default="${includes}" name="includes"/>
542
            <attribute default="${excludes}" name="excludes"/>
543
            <attribute default="**" name="testincludes"/>
544
            <attribute default="" name="testmethods"/>
545
            <element name="customize" optional="true"/>
546
            <sequential>
547
                <property name="junit.forkmode" value="perTest"/>
548
                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
549
                    <batchtest todir="${build.test.results.dir}">
550
                        <fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}">
551
                            <filename name="${test.binarytestincludes}"/>
552
                        </fileset>
553
                    </batchtest>
554
                    <syspropertyset>
555
                        <propertyref prefix="test-sys-prop."/>
556
                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
557
                    </syspropertyset>
558
                    <formatter type="brief" usefile="false"/>
559
                    <formatter type="xml"/>
560
                    <jvmarg value="-ea"/>
561
                    <jvmarg line="${debug-args-line}"/>
562
                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
563
                    <customize/>
564
                </junit>
565
            </sequential>
566
        </macrodef>
567
    </target>
568
    <target depends="-init-macrodef-junit-debug,-init-macrodef-junit-debug-batch" if="${junit.available}" name="-init-macrodef-junit-debug-impl">
569
        <macrodef name="test-debug-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
570
            <attribute default="${includes}" name="includes"/>
571
            <attribute default="${excludes}" name="excludes"/>
572
            <attribute default="**" name="testincludes"/>
573
            <attribute default="" name="testmethods"/>
574
            <element implicit="true" name="customize" optional="true"/>
575
            <sequential>
576
                <j2seproject3:junit-debug excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
577
                    <customize/>
578
                </j2seproject3:junit-debug>
579
            </sequential>
580
        </macrodef>
581
    </target>
582
    <target if="${testng.available}" name="-init-macrodef-testng-debug">
583
        <macrodef name="testng-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
584
            <attribute default="${main.class}" name="testClass"/>
585
            <attribute default="" name="testMethod"/>
586
            <element name="customize2" optional="true"/>
587
            <sequential>
588
                <condition else="-testclass @{testClass}" property="test.class.or.method" value="-methods @{testClass}.@{testMethod}">
589
                    <isset property="test.method"/>
590
                </condition>
591
                <condition else="-suitename NBProjectGenerators -testname @{testClass} ${test.class.or.method}" property="testng.cmd.args" value="@{testClass}">
592
                    <matches pattern=".*\.xml" string="@{testClass}"/>
593
                </condition>
594
                <delete dir="${build.test.results.dir}" quiet="true"/>
595
                <mkdir dir="${build.test.results.dir}"/>
596
                <j2seproject3:debug classname="org.testng.TestNG" classpath="${debug.test.classpath}">
597
                    <customize>
598
                        <customize2/>
599
                        <jvmarg value="-ea"/>
600
                        <arg line="${testng.debug.mode}"/>
601
                        <arg line="-d ${build.test.results.dir}"/>
602
                        <arg line="-listener org.testng.reporters.VerboseReporter"/>
603
                        <arg line="${testng.cmd.args}"/>
604
                    </customize>
605
                </j2seproject3:debug>
606
            </sequential>
607
        </macrodef>
608
    </target>
609
    <target depends="-init-macrodef-testng-debug" if="${testng.available}" name="-init-macrodef-testng-debug-impl">
610
        <macrodef name="testng-debug-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
611
            <attribute default="${main.class}" name="testClass"/>
612
            <attribute default="" name="testMethod"/>
613
            <element implicit="true" name="customize2" optional="true"/>
614
            <sequential>
615
                <j2seproject3:testng-debug testClass="@{testClass}" testMethod="@{testMethod}">
616
                    <customize2/>
617
                </j2seproject3:testng-debug>
618
            </sequential>
619
        </macrodef>
620
    </target>
621
    <target depends="-init-macrodef-junit-debug-impl" if="${junit.available}" name="-init-macrodef-test-debug-junit">
622
        <macrodef name="test-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
623
            <attribute default="${includes}" name="includes"/>
624
            <attribute default="${excludes}" name="excludes"/>
625
            <attribute default="**" name="testincludes"/>
626
            <attribute default="" name="testmethods"/>
627
            <attribute default="${main.class}" name="testClass"/>
628
            <attribute default="" name="testMethod"/>
629
            <sequential>
630
                <j2seproject3:test-debug-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
631
                    <customize>
632
                        <classpath>
633
                            <path path="${run.test.classpath}"/>
634
                        </classpath>
635
                        <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
636
                        <jvmarg line="${run.jvmargs}"/>
637
                        <jvmarg line="${run.jvmargs.ide}"/>
638
                    </customize>
639
                </j2seproject3:test-debug-impl>
640
            </sequential>
641
        </macrodef>
642
    </target>
643
    <target depends="-init-macrodef-testng-debug-impl" if="${testng.available}" name="-init-macrodef-test-debug-testng">
644
        <macrodef name="test-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
645
            <attribute default="${includes}" name="includes"/>
646
            <attribute default="${excludes}" name="excludes"/>
647
            <attribute default="**" name="testincludes"/>
648
            <attribute default="" name="testmethods"/>
649
            <attribute default="${main.class}" name="testClass"/>
650
            <attribute default="" name="testMethod"/>
651
            <sequential>
652
                <j2seproject3:testng-debug-impl testClass="@{testClass}" testMethod="@{testMethod}">
653
                    <customize2>
654
                        <syspropertyset>
655
                            <propertyref prefix="test-sys-prop."/>
656
                            <mapper from="test-sys-prop.*" to="*" type="glob"/>
657
                        </syspropertyset>
658
                    </customize2>
659
                </j2seproject3:testng-debug-impl>
660
            </sequential>
661
        </macrodef>
662
    </target>
663
    <target depends="-init-macrodef-test-debug-junit,-init-macrodef-test-debug-testng" name="-init-macrodef-test-debug"/>
664
    <!--
665
                pre NB7.2 profiling section; consider it deprecated
666
            -->
667
    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check" if="profiler.info.jvmargs.agent" name="profile-init"/>
668
    <target if="profiler.info.jvmargs.agent" name="-profile-pre-init">
669
        <!-- Empty placeholder for easier customization. -->
670
        <!-- You can override this target in the ../build.xml file. -->
671
    </target>
672
    <target if="profiler.info.jvmargs.agent" name="-profile-post-init">
673
        <!-- Empty placeholder for easier customization. -->
674
        <!-- You can override this target in the ../build.xml file. -->
675
    </target>
676
    <target if="profiler.info.jvmargs.agent" name="-profile-init-macrodef-profile">
677
        <macrodef name="resolve">
678
            <attribute name="name"/>
679
            <attribute name="value"/>
680
            <sequential>
681
                <property name="@{name}" value="${env.@{value}}"/>
682
            </sequential>
683
        </macrodef>
684
        <macrodef name="profile">
685
            <attribute default="${main.class}" name="classname"/>
686
            <element name="customize" optional="true"/>
687
            <sequential>
688
                <property environment="env"/>
689
                <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
690
                <java classname="@{classname}" dir="${profiler.info.dir}" failonerror="${java.failonerror}" fork="true" jvm="${profiler.info.jvm}">
691
                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
692
                    <jvmarg value="${profiler.info.jvmargs.agent}"/>
693
                    <jvmarg line="${profiler.info.jvmargs}"/>
694
                    <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
695
                    <arg line="${application.args}"/>
696
                    <classpath>
697
                        <path path="${run.classpath}"/>
698
                    </classpath>
699
                    <syspropertyset>
700
                        <propertyref prefix="run-sys-prop."/>
701
                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
702
                    </syspropertyset>
703
                    <customize/>
704
                </java>
705
            </sequential>
706
        </macrodef>
707
    </target>
708
    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile" if="profiler.info.jvmargs.agent" name="-profile-init-check">
709
        <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail>
710
        <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
711
    </target>
712
    <!--
713
                end of pre NB7.2 profiling section
714
            -->
221
    <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
715
    <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
222
        <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
716
        <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
223
            <attribute default="${main.class}" name="name"/>
717
            <attribute default="${main.class}" name="name"/>
Lines 268-279 Link Here
268
            <attribute default="${debug.classpath}" name="classpath"/>
762
            <attribute default="${debug.classpath}" name="classpath"/>
269
            <element name="customize" optional="true"/>
763
            <element name="customize" optional="true"/>
270
            <sequential>
764
            <sequential>
271
                <java classname="@{classname}" dir="${work.dir}" fork="true">
765
                <java classname="@{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true">
766
                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
272
                    <jvmarg line="${debug-args-line}"/>
767
                    <jvmarg line="${debug-args-line}"/>
273
                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
768
                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
274
                    <jvmarg value="-Dfile.encoding=${source.encoding}"/>
769
                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
275
                    <redirector errorencoding="${source.encoding}" inputencoding="${source.encoding}" outputencoding="${source.encoding}"/>
770
                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
276
                    <jvmarg line="${run.jvmargs}"/>
771
                    <jvmarg line="${run.jvmargs}"/>
772
                    <jvmarg line="${run.jvmargs.ide}"/>
277
                    <classpath>
773
                    <classpath>
278
                        <path path="@{classpath}"/>
774
                        <path path="@{classpath}"/>
279
                    </classpath>
775
                    </classpath>
Lines 290-301 Link Here
290
        <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
786
        <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
291
            <attribute default="${main.class}" name="classname"/>
787
            <attribute default="${main.class}" name="classname"/>
292
            <attribute default="${run.classpath}" name="classpath"/>
788
            <attribute default="${run.classpath}" name="classpath"/>
789
            <attribute default="jvm" name="jvm"/>
293
            <element name="customize" optional="true"/>
790
            <element name="customize" optional="true"/>
294
            <sequential>
791
            <sequential>
295
                <java classname="@{classname}" dir="${work.dir}" fork="true">
792
                <java classname="@{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true">
296
                    <jvmarg value="-Dfile.encoding=${source.encoding}"/>
793
                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
297
                    <redirector errorencoding="${source.encoding}" inputencoding="${source.encoding}" outputencoding="${source.encoding}"/>
794
                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
795
                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
298
                    <jvmarg line="${run.jvmargs}"/>
796
                    <jvmarg line="${run.jvmargs}"/>
797
                    <jvmarg line="${run.jvmargs.ide}"/>
299
                    <classpath>
798
                    <classpath>
300
                        <path path="@{classpath}"/>
799
                        <path path="@{classpath}"/>
301
                    </classpath>
800
                    </classpath>
Lines 308-327 Link Here
308
            </sequential>
807
            </sequential>
309
        </macrodef>
808
        </macrodef>
310
    </target>
809
    </target>
810
    <target name="-init-macrodef-copylibs">
811
        <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
812
            <attribute default="${manifest.file}" name="manifest"/>
813
            <element name="customize" optional="true"/>
814
            <sequential>
815
                <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
816
                <pathconvert property="run.classpath.without.build.classes.dir">
817
                    <path path="${run.classpath}"/>
818
                    <map from="${build.classes.dir.resolved}" to=""/>
819
                </pathconvert>
820
                <pathconvert pathsep=" " property="jar.classpath">
821
                    <path path="${run.classpath.without.build.classes.dir}"/>
822
                    <chainedmapper>
823
                        <flattenmapper/>
824
                        <filtermapper>
825
                            <replacestring from=" " to="%20"/>
826
                        </filtermapper>
827
                        <globmapper from="*" to="lib/*"/>
828
                    </chainedmapper>
829
                </pathconvert>
830
                <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
831
                <copylibs compress="${jar.compress}" excludeFromCopy="${copylibs.excludes}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" rebase="${copylibs.rebase}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
832
                    <fileset dir="${build.classes.dir}" excludes="${dist.archive.excludes}"/>
833
                    <manifest>
834
                        <attribute name="Class-Path" value="${jar.classpath}"/>
835
                        <customize/>
836
                    </manifest>
837
                </copylibs>
838
            </sequential>
839
        </macrodef>
840
    </target>
311
    <target name="-init-presetdef-jar">
841
    <target name="-init-presetdef-jar">
312
        <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
842
        <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
313
            <jar compress="${jar.compress}" jarfile="${dist.jar}">
843
            <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}">
314
                <j2seproject1:fileset dir="${build.classes.dir}"/>
844
                <j2seproject1:fileset dir="${build.classes.dir}" excludes="${dist.archive.excludes}"/>
315
            </jar>
845
            </jar>
316
        </presetdef>
846
        </presetdef>
317
    </target>
847
    </target>
318
    <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-junit,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar" name="init"/>
848
    <target name="-init-ap-cmdline-properties">
849
        <property name="annotation.processing.enabled" value="true"/>
850
        <property name="annotation.processing.processors.list" value=""/>
851
        <property name="annotation.processing.processor.options" value=""/>
852
        <property name="annotation.processing.run.all.processors" value="true"/>
853
        <property name="javac.processorpath" value="${javac.classpath}"/>
854
        <property name="javac.test.processorpath" value="${javac.test.classpath}"/>
855
        <condition property="ap.supported.internal" value="true">
856
            <not>
857
                <matches pattern="1\.[0-5](\..*)?" string="${javac.source}"/>
858
            </not>
859
        </condition>
860
    </target>
861
    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-ap-cmdline-supported">
862
        <condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}">
863
            <isfalse value="${annotation.processing.run.all.processors}"/>
864
        </condition>
865
        <condition else="" property="ap.proc.none.internal" value="-proc:none">
866
            <isfalse value="${annotation.processing.enabled}"/>
867
        </condition>
868
    </target>
869
    <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline">
870
        <property name="ap.cmd.line.internal" value=""/>
871
    </target>
872
    <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-test,-init-macrodef-test-debug,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar,-init-ap-cmdline" name="init"/>
319
    <!--
873
    <!--
320
                ===================
874
                ===================
321
                COMPILATION SECTION
875
                COMPILATION SECTION
322
                ===================
876
                ===================
323
            -->
877
            -->
324
    <target depends="init" name="deps-jar" unless="no.deps"/>
878
    <target name="-deps-jar-init" unless="built-jar.properties">
879
        <property location="${build.dir}/built-jar.properties" name="built-jar.properties"/>
880
        <delete file="${built-jar.properties}" quiet="true"/>
881
    </target>
882
    <target if="already.built.jar.${basedir}" name="-warn-already-built-jar">
883
        <echo level="warn" message="Cycle detected: NBProjectGenerators was already built"/>
884
    </target>
885
    <target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps">
886
        <mkdir dir="${build.dir}"/>
887
        <touch file="${built-jar.properties}" verbose="false"/>
888
        <property file="${built-jar.properties}" prefix="already.built.jar."/>
889
        <antcall target="-warn-already-built-jar"/>
890
        <propertyfile file="${built-jar.properties}">
891
            <entry key="${basedir}" value=""/>
892
        </propertyfile>
893
    </target>
325
    <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
894
    <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
326
    <target depends="init" name="-check-automatic-build">
895
    <target depends="init" name="-check-automatic-build">
327
        <available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/>
896
        <available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/>
Lines 344-355 Link Here
344
        </pathconvert>
913
        </pathconvert>
345
        <j2seproject3:depend srcdir="${src.dir}:${build.generated.subdirs}"/>
914
        <j2seproject3:depend srcdir="${src.dir}:${build.generated.subdirs}"/>
346
    </target>
915
    </target>
347
    <target depends="init,deps-jar,-pre-pre-compile,-pre-compile,-compile-depend" if="have.sources" name="-do-compile">
916
    <target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile">
348
        <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
917
        <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
349
        <copy todir="${build.classes.dir}">
918
        <copy todir="${build.classes.dir}">
350
            <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
919
            <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
351
        </copy>
920
        </copy>
352
    </target>
921
    </target>
922
    <target if="has.persistence.xml" name="-copy-persistence-xml">
923
        <mkdir dir="${build.classes.dir}/META-INF"/>
924
        <copy todir="${build.classes.dir}/META-INF">
925
            <fileset dir="${meta.inf.dir}" includes="persistence.xml orm.xml"/>
926
        </copy>
927
    </target>
353
    <target name="-post-compile">
928
    <target name="-post-compile">
354
        <!-- Empty placeholder for easier customization. -->
929
        <!-- Empty placeholder for easier customization. -->
355
        <!-- You can override this target in the ../build.xml file. -->
930
        <!-- You can override this target in the ../build.xml file. -->
Lines 382-438 Link Here
382
        <!-- Empty placeholder for easier customization. -->
957
        <!-- Empty placeholder for easier customization. -->
383
        <!-- You can override this target in the ../build.xml file. -->
958
        <!-- You can override this target in the ../build.xml file. -->
384
    </target>
959
    </target>
385
    <target depends="init,compile,-pre-pre-jar,-pre-jar" name="-do-jar-without-manifest" unless="manifest.available">
960
    <target depends="init" if="do.archive" name="-do-jar-create-manifest" unless="manifest.available">
386
        <j2seproject1:jar/>
961
        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
387
    </target>
962
        <touch file="${tmp.manifest.file}" verbose="false"/>
388
    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class">
389
        <j2seproject1:jar manifest="${manifest.file}"/>
390
    </target>
963
    </target>
391
    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class" name="-do-jar-with-mainclass" unless="manifest.available+main.class+mkdist.available">
964
    <target depends="init" if="do.archive+manifest.available" name="-do-jar-copy-manifest">
392
        <j2seproject1:jar manifest="${manifest.file}">
965
        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
393
            <j2seproject1:manifest>
966
        <copy file="${manifest.file}" tofile="${tmp.manifest.file}"/>
394
                <j2seproject1:attribute name="Main-Class" value="${main.class}"/>
967
    </target>
395
            </j2seproject1:manifest>
968
    <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+main.class.available" name="-do-jar-set-mainclass">
396
        </j2seproject1:jar>
969
        <manifest file="${tmp.manifest.file}" mode="update">
397
        <echo>To run this application from the command line without Ant, try:</echo>
970
            <attribute name="Main-Class" value="${main.class}"/>
971
        </manifest>
972
    </target>
973
    <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+profile.available" name="-do-jar-set-profile">
974
        <manifest file="${tmp.manifest.file}" mode="update">
975
            <attribute name="Profile" value="${javac.profile}"/>
976
        </manifest>
977
    </target>
978
    <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+splashscreen.available" name="-do-jar-set-splashscreen">
979
        <basename file="${application.splash}" property="splashscreen.basename"/>
980
        <mkdir dir="${build.classes.dir}/META-INF"/>
981
        <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
982
        <manifest file="${tmp.manifest.file}" mode="update">
983
            <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
984
        </manifest>
985
    </target>
986
    <target depends="init,-init-macrodef-copylibs,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen" if="do.mkdist" name="-do-jar-copylibs">
987
        <j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
988
        <echo level="info">To run this application from the command line without Ant, try:</echo>
989
        <property location="${dist.jar}" name="dist.jar.resolved"/>
990
        <echo level="info">java -jar "${dist.jar.resolved}"</echo>
991
    </target>
992
    <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen" if="do.archive" name="-do-jar-jar" unless="do.mkdist">
993
        <j2seproject1:jar manifest="${tmp.manifest.file}"/>
398
        <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
994
        <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
399
        <property location="${dist.jar}" name="dist.jar.resolved"/>
995
        <property location="${dist.jar}" name="dist.jar.resolved"/>
400
        <pathconvert property="run.classpath.with.dist.jar">
996
        <pathconvert property="run.classpath.with.dist.jar">
401
            <path path="${run.classpath}"/>
997
            <path path="${run.classpath}"/>
402
            <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
998
            <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
403
        </pathconvert>
999
        </pathconvert>
404
        <echo>java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
1000
        <condition else="" property="jar.usage.message" value="To run this application from the command line without Ant, try:${line.separator}${platform.java} -cp ${run.classpath.with.dist.jar} ${main.class}">
1001
            <isset property="main.class.available"/>
1002
        </condition>
1003
        <condition else="debug" property="jar.usage.level" value="info">
1004
            <isset property="main.class.available"/>
1005
        </condition>
1006
        <echo level="${jar.usage.level}" message="${jar.usage.message}"/>
405
    </target>
1007
    </target>
406
    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class+mkdist.available" name="-do-jar-with-libraries">
1008
    <target depends="-do-jar-copylibs" if="do.archive" name="-do-jar-delete-manifest">
407
        <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
1009
        <delete>
408
        <pathconvert property="run.classpath.without.build.classes.dir">
1010
            <fileset file="${tmp.manifest.file}"/>
409
            <path path="${run.classpath}"/>
1011
        </delete>
410
            <map from="${build.classes.dir.resolved}" to=""/>
411
        </pathconvert>
412
        <pathconvert pathsep=" " property="jar.classpath">
413
            <path path="${run.classpath.without.build.classes.dir}"/>
414
            <chainedmapper>
415
                <flattenmapper/>
416
                <globmapper from="*" to="lib/*"/>
417
            </chainedmapper>
418
        </pathconvert>
419
        <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
420
        <copylibs compress="${jar.compress}" jarfile="${dist.jar}" manifest="${manifest.file}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
421
            <fileset dir="${build.classes.dir}"/>
422
            <manifest>
423
                <attribute name="Main-Class" value="${main.class}"/>
424
                <attribute name="Class-Path" value="${jar.classpath}"/>
425
            </manifest>
426
        </copylibs>
427
        <echo>To run this application from the command line without Ant, try:</echo>
428
        <property location="${dist.jar}" name="dist.jar.resolved"/>
429
        <echo>java -jar "${dist.jar.resolved}"</echo>
430
    </target>
1012
    </target>
1013
    <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen,-do-jar-jar,-do-jar-delete-manifest" name="-do-jar-without-libraries"/>
1014
    <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen,-do-jar-copylibs,-do-jar-delete-manifest" name="-do-jar-with-libraries"/>
431
    <target name="-post-jar">
1015
    <target name="-post-jar">
432
        <!-- Empty placeholder for easier customization. -->
1016
        <!-- Empty placeholder for easier customization. -->
433
        <!-- You can override this target in the ../build.xml file. -->
1017
        <!-- You can override this target in the ../build.xml file. -->
434
    </target>
1018
    </target>
435
    <target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-post-jar" description="Build JAR." name="jar"/>
1019
    <target depends="init,compile,-pre-jar,-do-jar-without-libraries,-do-jar-with-libraries,-post-jar" name="-do-jar"/>
1020
    <target depends="init,compile,-pre-jar,-do-jar,-post-jar" description="Build JAR." name="jar"/>
436
    <!--
1021
    <!--
437
                =================
1022
                =================
438
                EXECUTION SECTION
1023
                EXECUTION SECTION
Lines 448-458 Link Here
448
    <target name="-do-not-recompile">
1033
    <target name="-do-not-recompile">
449
        <property name="javac.includes.binary" value=""/>
1034
        <property name="javac.includes.binary" value=""/>
450
    </target>
1035
    </target>
451
    <target depends="init,-do-not-recompile,compile-single" name="run-single">
1036
    <target depends="init,compile-single" name="run-single">
452
        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
1037
        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
453
        <j2seproject1:java classname="${run.class}"/>
1038
        <j2seproject1:java classname="${run.class}"/>
454
    </target>
1039
    </target>
455
    <target depends="init,-do-not-recompile,compile-test-single" name="run-test-with-main">
1040
    <target depends="init,compile-test-single" name="run-test-with-main">
456
        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
1041
        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
457
        <j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
1042
        <j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
458
    </target>
1043
    </target>
Lines 483-494 Link Here
483
        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
1068
        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
484
        <j2seproject3:debug classname="${debug.class}"/>
1069
        <j2seproject3:debug classname="${debug.class}"/>
485
    </target>
1070
    </target>
486
    <target depends="init,-do-not-recompile,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
1071
    <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
487
    <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
1072
    <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
488
        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
1073
        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
489
        <j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
1074
        <j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
490
    </target>
1075
    </target>
491
    <target depends="init,-do-not-recompile,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/>
1076
    <target depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/>
492
    <target depends="init" name="-pre-debug-fix">
1077
    <target depends="init" name="-pre-debug-fix">
493
        <fail unless="fix.includes">Must set fix.includes</fail>
1078
        <fail unless="fix.includes">Must set fix.includes</fail>
494
        <property name="javac.includes" value="${fix.includes}.java"/>
1079
        <property name="javac.includes" value="${fix.includes}.java"/>
Lines 498-520 Link Here
498
    </target>
1083
    </target>
499
    <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
1084
    <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
500
    <!--
1085
    <!--
1086
                =================
1087
                PROFILING SECTION
1088
                =================
1089
            -->
1090
    <!--
1091
                pre NB7.2 profiler integration
1092
            -->
1093
    <target depends="profile-init,compile" description="Profile a project in the IDE." if="profiler.info.jvmargs.agent" name="-profile-pre72">
1094
        <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
1095
        <nbprofiledirect>
1096
            <classpath>
1097
                <path path="${run.classpath}"/>
1098
            </classpath>
1099
        </nbprofiledirect>
1100
        <profile/>
1101
    </target>
1102
    <target depends="profile-init,compile-single" description="Profile a selected class in the IDE." if="profiler.info.jvmargs.agent" name="-profile-single-pre72">
1103
        <fail unless="profile.class">Must select one file in the IDE or set profile.class</fail>
1104
        <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
1105
        <nbprofiledirect>
1106
            <classpath>
1107
                <path path="${run.classpath}"/>
1108
            </classpath>
1109
        </nbprofiledirect>
1110
        <profile classname="${profile.class}"/>
1111
    </target>
1112
    <target depends="profile-init,compile-single" if="profiler.info.jvmargs.agent" name="-profile-applet-pre72">
1113
        <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
1114
        <nbprofiledirect>
1115
            <classpath>
1116
                <path path="${run.classpath}"/>
1117
            </classpath>
1118
        </nbprofiledirect>
1119
        <profile classname="sun.applet.AppletViewer">
1120
            <customize>
1121
                <arg value="${applet.url}"/>
1122
            </customize>
1123
        </profile>
1124
    </target>
1125
    <target depends="profile-init,compile-test-single" if="profiler.info.jvmargs.agent" name="-profile-test-single-pre72">
1126
        <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
1127
        <nbprofiledirect>
1128
            <classpath>
1129
                <path path="${run.test.classpath}"/>
1130
            </classpath>
1131
        </nbprofiledirect>
1132
        <junit dir="${profiler.info.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" jvm="${profiler.info.jvm}" showoutput="true">
1133
            <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
1134
            <jvmarg value="${profiler.info.jvmargs.agent}"/>
1135
            <jvmarg line="${profiler.info.jvmargs}"/>
1136
            <test name="${profile.class}"/>
1137
            <classpath>
1138
                <path path="${run.test.classpath}"/>
1139
            </classpath>
1140
            <syspropertyset>
1141
                <propertyref prefix="test-sys-prop."/>
1142
                <mapper from="test-sys-prop.*" to="*" type="glob"/>
1143
            </syspropertyset>
1144
            <formatter type="brief" usefile="false"/>
1145
            <formatter type="xml"/>
1146
        </junit>
1147
    </target>
1148
    <!--
1149
                end of pre NB72 profiling section
1150
            -->
1151
    <target if="netbeans.home" name="-profile-check">
1152
        <condition property="profiler.configured">
1153
            <or>
1154
                <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-agentpath:"/>
1155
                <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-javaagent:"/>
1156
            </or>
1157
        </condition>
1158
    </target>
1159
    <target depends="-profile-check,-profile-pre72" description="Profile a project in the IDE." if="profiler.configured" name="profile" unless="profiler.info.jvmargs.agent">
1160
        <startprofiler/>
1161
        <antcall target="run"/>
1162
    </target>
1163
    <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">
1164
        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
1165
        <startprofiler/>
1166
        <antcall target="run-single"/>
1167
    </target>
1168
    <target depends="-profile-test-single-pre72" description="Profile a selected test in the IDE." name="profile-test-single"/>
1169
    <target depends="-profile-check" description="Profile a selected test in the IDE." if="profiler.configured" name="profile-test" unless="profiler.info.jvmargs">
1170
        <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
1171
        <startprofiler/>
1172
        <antcall target="test-single"/>
1173
    </target>
1174
    <target depends="-profile-check" description="Profile a selected class in the IDE." if="profiler.configured" name="profile-test-with-main">
1175
        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
1176
        <startprofiler/>
1177
        <antcal target="run-test-with-main"/>
1178
    </target>
1179
    <target depends="-profile-check,-profile-applet-pre72" if="profiler.configured" name="profile-applet" unless="profiler.info.jvmargs.agent">
1180
        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
1181
        <startprofiler/>
1182
        <antcall target="run-applet"/>
1183
    </target>
1184
    <!--
501
                ===============
1185
                ===============
502
                JAVADOC SECTION
1186
                JAVADOC SECTION
503
                ===============
1187
                ===============
504
            -->
1188
            -->
505
    <target depends="init" name="-javadoc-build">
1189
    <target depends="init" if="have.sources" name="-javadoc-build">
506
        <mkdir dir="${dist.javadoc.dir}"/>
1190
        <mkdir dir="${dist.javadoc.dir}"/>
507
        <javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
1191
        <condition else="" property="javadoc.endorsed.classpath.cmd.line.arg" value="-J${endorsed.classpath.cmd.line.arg}">
1192
            <and>
1193
                <isset property="endorsed.classpath.cmd.line.arg"/>
1194
                <not>
1195
                    <equals arg1="${endorsed.classpath.cmd.line.arg}" arg2=""/>
1196
                </not>
1197
            </and>
1198
        </condition>
1199
        <condition else="" property="bug5101868workaround" value="*.java">
1200
            <matches pattern="1\.[56](\..*)?" string="${java.version}"/>
1201
        </condition>
1202
        <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}">
508
            <classpath>
1203
            <classpath>
509
                <path path="${javac.classpath}"/>
1204
                <path path="${javac.classpath}"/>
510
            </classpath>
1205
            </classpath>
511
            <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
1206
            <fileset dir="${src.dir}" excludes="${bug5101868workaround},${excludes}" includes="${includes}">
512
                <filename name="**/*.java"/>
1207
                <filename name="**/*.java"/>
513
            </fileset>
1208
            </fileset>
514
            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
1209
            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
515
                <include name="**/*.java"/>
1210
                <include name="**/*.java"/>
1211
                <exclude name="*.java"/>
516
            </fileset>
1212
            </fileset>
1213
            <arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/>
517
        </javadoc>
1214
        </javadoc>
1215
        <copy todir="${dist.javadoc.dir}">
1216
            <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
1217
                <filename name="**/doc-files/**"/>
1218
            </fileset>
1219
            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
1220
                <include name="**/doc-files/**"/>
1221
            </fileset>
1222
        </copy>
518
    </target>
1223
    </target>
519
    <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
1224
    <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
520
        <nbbrowse file="${dist.javadoc.dir}/index.html"/>
1225
        <nbbrowse file="${dist.javadoc.dir}/index.html"/>
Lines 522-528 Link Here
522
    <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
1227
    <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
523
    <!--
1228
    <!--
524
                =========================
1229
                =========================
525
                JUNIT COMPILATION SECTION
1230
                TEST COMPILATION SECTION
526
                =========================
1231
                =========================
527
            -->
1232
            -->
528
    <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
1233
    <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
Lines 535-542 Link Here
535
    <target if="do.depend.true" name="-compile-test-depend">
1240
    <target if="do.depend.true" name="-compile-test-depend">
536
        <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir=""/>
1241
        <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir=""/>
537
    </target>
1242
    </target>
538
    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
1243
    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
539
        <j2seproject3:javac classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" srcdir=""/>
1244
        <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" processorpath="${javac.test.processorpath}" srcdir=""/>
540
        <copy todir="${build.test.classes.dir}"/>
1245
        <copy todir="${build.test.classes.dir}"/>
541
    </target>
1246
    </target>
542
    <target name="-post-compile-test">
1247
    <target name="-post-compile-test">
Lines 548-557 Link Here
548
        <!-- Empty placeholder for easier customization. -->
1253
        <!-- Empty placeholder for easier customization. -->
549
        <!-- You can override this target in the ../build.xml file. -->
1254
        <!-- You can override this target in the ../build.xml file. -->
550
    </target>
1255
    </target>
551
    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
1256
    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
552
        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
1257
        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
553
        <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
1258
        <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
554
        <j2seproject3:javac classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" sourcepath="" srcdir=""/>
1259
        <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" processorpath="${javac.test.processorpath}" sourcepath="" srcdir=""/>
555
        <copy todir="${build.test.classes.dir}"/>
1260
        <copy todir="${build.test.classes.dir}"/>
556
    </target>
1261
    </target>
557
    <target name="-post-compile-test-single">
1262
    <target name="-post-compile-test-single">
Lines 561-574 Link Here
561
    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
1266
    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
562
    <!--
1267
    <!--
563
                =======================
1268
                =======================
564
                JUNIT EXECUTION SECTION
1269
                TEST EXECUTION SECTION
565
                =======================
1270
                =======================
566
            -->
1271
            -->
567
    <target depends="init" if="have.tests" name="-pre-test-run">
1272
    <target depends="init" if="have.tests" name="-pre-test-run">
568
        <mkdir dir="${build.test.results.dir}"/>
1273
        <mkdir dir="${build.test.results.dir}"/>
569
    </target>
1274
    </target>
570
    <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
1275
    <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
571
        <j2seproject3:junit testincludes="**/*Test.java"/>
1276
        <j2seproject3:test includes="${includes}" testincludes="**/*Test.java"/>
572
    </target>
1277
    </target>
573
    <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
1278
    <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
574
        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
1279
        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
Lines 581-619 Link Here
581
    </target>
1286
    </target>
582
    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
1287
    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
583
        <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
1288
        <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
584
        <j2seproject3:junit excludes="" includes="${test.includes}"/>
1289
        <j2seproject3:test excludes="" includes="${test.includes}" testincludes="${test.includes}"/>
585
    </target>
1290
    </target>
586
    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
1291
    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
587
        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
1292
        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
588
    </target>
1293
    </target>
589
    <target depends="init,-do-not-recompile,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/>
1294
    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/>
1295
    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single-method">
1296
        <fail unless="test.class">Must select some files in the IDE or set test.class</fail>
1297
        <fail unless="test.method">Must select some method in the IDE or set test.method</fail>
1298
        <j2seproject3:test excludes="" includes="${javac.includes}" testincludes="${test.class}" testmethods="${test.method}"/>
1299
    </target>
1300
    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single-method" if="have.tests" name="-post-test-run-single-method">
1301
        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
1302
    </target>
1303
    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single-method,-post-test-run-single-method" description="Run single unit test." name="test-single-method"/>
590
    <!--
1304
    <!--
591
                =======================
1305
                =======================
592
                JUNIT DEBUGGING SECTION
1306
                TEST DEBUGGING SECTION
593
                =======================
1307
                =======================
594
            -->
1308
            -->
595
    <target depends="init,compile-test" if="have.tests" name="-debug-start-debuggee-test">
1309
    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test">
596
        <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
1310
        <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
597
        <property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/>
1311
        <j2seproject3:test-debug excludes="" includes="${javac.includes}" testClass="${test.class}" testincludes="${javac.includes}"/>
598
        <delete file="${test.report.file}"/>
1312
    </target>
599
        <mkdir dir="${build.test.results.dir}"/>
1313
    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test-method">
600
        <j2seproject3:debug classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner" classpath="${ant.home}/lib/ant.jar:${ant.home}/lib/ant-junit.jar:${debug.test.classpath}">
1314
        <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
601
            <customize>
1315
        <fail unless="test.method">Must select some method in the IDE or set test.method</fail>
602
                <syspropertyset>
1316
        <j2seproject3:test-debug excludes="" includes="${javac.includes}" testClass="${test.class}" testMethod="${test.method}" testincludes="${test.class}" testmethods="${test.method}"/>
603
                    <propertyref prefix="test-sys-prop."/>
604
                    <mapper from="test-sys-prop.*" to="*" type="glob"/>
605
                </syspropertyset>
606
                <arg value="${test.class}"/>
607
                <arg value="showoutput=true"/>
608
                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/>
609
                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/>
610
            </customize>
611
        </j2seproject3:debug>
612
    </target>
1317
    </target>
613
    <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
1318
    <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
614
        <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
1319
        <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
615
    </target>
1320
    </target>
616
    <target depends="init,-do-not-recompile,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
1321
    <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
1322
    <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test-method" name="debug-test-method"/>
617
    <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
1323
    <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
618
        <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
1324
        <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
619
    </target>
1325
    </target>
Lines 650-663 Link Here
650
                CLEANUP SECTION
1356
                CLEANUP SECTION
651
                ===============
1357
                ===============
652
            -->
1358
            -->
653
    <target depends="init" name="deps-clean" unless="no.deps"/>
1359
    <target name="-deps-clean-init" unless="built-clean.properties">
1360
        <property location="${build.dir}/built-clean.properties" name="built-clean.properties"/>
1361
        <delete file="${built-clean.properties}" quiet="true"/>
1362
    </target>
1363
    <target if="already.built.clean.${basedir}" name="-warn-already-built-clean">
1364
        <echo level="warn" message="Cycle detected: NBProjectGenerators was already built"/>
1365
    </target>
1366
    <target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps">
1367
        <mkdir dir="${build.dir}"/>
1368
        <touch file="${built-clean.properties}" verbose="false"/>
1369
        <property file="${built-clean.properties}" prefix="already.built.clean."/>
1370
        <antcall target="-warn-already-built-clean"/>
1371
        <propertyfile file="${built-clean.properties}">
1372
            <entry key="${basedir}" value=""/>
1373
        </propertyfile>
1374
    </target>
654
    <target depends="init" name="-do-clean">
1375
    <target depends="init" name="-do-clean">
655
        <delete dir="${build.dir}"/>
1376
        <delete dir="${build.dir}"/>
656
        <delete dir="${dist.dir}"/>
1377
        <delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/>
657
    </target>
1378
    </target>
658
    <target name="-post-clean">
1379
    <target name="-post-clean">
659
        <!-- Empty placeholder for easier customization. -->
1380
        <!-- Empty placeholder for easier customization. -->
660
        <!-- You can override this target in the ../build.xml file. -->
1381
        <!-- You can override this target in the ../build.xml file. -->
661
    </target>
1382
    </target>
662
    <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
1383
    <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
1384
    <target name="-check-call-dep">
1385
        <property file="${call.built.properties}" prefix="already.built."/>
1386
        <condition property="should.call.dep">
1387
            <and>
1388
                <not>
1389
                    <isset property="already.built.${call.subproject}"/>
1390
                </not>
1391
                <available file="${call.script}"/>
1392
            </and>
1393
        </condition>
1394
    </target>
1395
    <target depends="-check-call-dep" if="should.call.dep" name="-maybe-call-dep">
1396
        <ant antfile="${call.script}" inheritall="false" target="${call.target}">
1397
            <propertyset>
1398
                <propertyref prefix="transfer."/>
1399
                <mapper from="transfer.*" to="*" type="glob"/>
1400
            </propertyset>
1401
        </ant>
1402
    </target>
663
</project>
1403
</project>
(-)a/groovy.samples/sample_src/NBProjectGenerators/nbproject/genfiles.properties (-6 / +6 lines)
Lines 3-11 Link Here
3
build.xml.stylesheet.CRC32=958a1d3e@1.24.0.45
3
build.xml.stylesheet.CRC32=958a1d3e@1.24.0.45
4
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
4
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
5
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
5
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
6
nbproject/build-impl.xml.data.CRC32=097c205d
6
nbproject/build-impl.xml.data.CRC32=061cc033
7
nbproject/build-impl.xml.script.CRC32=22561cd7
7
nbproject/build-impl.xml.script.CRC32=034c5bb9
8
nbproject/build-impl.xml.stylesheet.CRC32=7ae93da6@1.24.0.45
8
nbproject/build-impl.xml.stylesheet.CRC32=05530350@1.79.1.48
9
nbproject/groovy-build.xml.data.CRC32=097c205d
9
nbproject/groovy-build.xml.data.CRC32=061cc033
10
nbproject/groovy-build.xml.script.CRC32=3bbde5d0
10
nbproject/groovy-build.xml.script.CRC32=66297360
11
nbproject/groovy-build.xml.stylesheet.CRC32=c99f72ec@1.7
11
nbproject/groovy-build.xml.stylesheet.CRC32=28d0e1f2@1.11.1
(-)a/groovy.samples/sample_src/NBProjectGenerators/nbproject/groovy-build.xml (-12 / +32 lines)
Lines 3-8 Link Here
3
*** GENERATED FROM project.xml - DO NOT EDIT  ***
3
*** GENERATED FROM project.xml - DO NOT EDIT  ***
4
***         EDIT ../build.xml INSTEAD         ***
4
***         EDIT ../build.xml INSTEAD         ***
5
5
6
        
6
        -->
7
        -->
7
<project xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc">
8
<project xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc">
8
    <target name="-groovy-init-macrodef-javac">
9
    <target name="-groovy-init-macrodef-javac">
Lines 13-24 Link Here
13
            <attribute name="includes" default="${includes}"/>
14
            <attribute name="includes" default="${includes}"/>
14
            <attribute name="excludes" default="${excludes}"/>
15
            <attribute name="excludes" default="${excludes}"/>
15
            <attribute name="debug" default="${javac.debug}"/>
16
            <attribute name="debug" default="${javac.debug}"/>
16
            <attribute name="sourcepath" default="/does/not/exist"/>
17
            <attribute name="sourcepath" default="${empty.dir}"/>
17
            <attribute name="gensrcdir" default="/does/not/exist"/>
18
            <attribute name="gensrcdir" default="${empty.dir}"/>
19
            <attribute name="processorpath" default="${javac.processorpath}"/>
20
            <attribute name="apgeneratedsrcdir" default="${build.generated.sources.dir}/ap-source-output"/>
18
            <element name="customize" optional="true"/>
21
            <element name="customize" optional="true"/>
19
            <sequential>
22
            <sequential>
20
                <taskdef name="groovyc" classpath="${javac.classpath}" classname="org.codehaus.groovy.ant.Groovyc"/>
23
                <taskdef name="groovyc" classpath="${javac.classpath}" classname="org.codehaus.groovy.ant.Groovyc"/>
21
                <groovyc srcdir="@{srcdir}" sourcepath="@{sourcepath}" destdir="@{destdir}" encoding="${source.encoding}" includes="@{includes}" excludes="@{excludes}">
24
                <property name="empty.dir" location="${build.dir}/empty"/>
25
                <mkdir dir="${empty.dir}"/>
26
                <groovyc srcdir="@{srcdir}" sourcepath="@{sourcepath}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" includeAntRuntime="false" fork="true">
22
                    <src>
27
                    <src>
23
                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
28
                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
24
                            <include name="*"/>
29
                            <include name="*"/>
Lines 27-41 Link Here
27
                    <classpath>
32
                    <classpath>
28
                        <path path="@{classpath}"/>
33
                        <path path="@{classpath}"/>
29
                    </classpath>
34
                    </classpath>
30
                    <javac srcdir="@{srcdir}" sourcepath="@{sourcepath}" destdir="@{destdir}" debug="@{debug}" deprecation="${javac.deprecation}" encoding="${source.encoding}" source="${javac.source}" target="${javac.target}" includes="@{includes}" excludes="@{excludes}" includeantruntime="false">
35
                    <javac debug="@{debug}" deprecation="${javac.deprecation}" encoding="${source.encoding}" source="${javac.source}" target="${javac.target}">
31
                        <src>
32
                            <dirset dir="@{gensrcdir}" erroronmissingdir="false">
33
                                <include name="*"/>
34
                            </dirset>
35
                        </src>
36
                        <classpath>
37
                            <path path="@{classpath}"/>
38
                        </classpath>
39
                        <compilerarg line="${javac.compilerargs} ${javac.compilerargs.jaxws}"/>
36
                        <compilerarg line="${javac.compilerargs} ${javac.compilerargs.jaxws}"/>
40
                        <customize/>
37
                        <customize/>
41
                    </javac>
38
                    </javac>
Lines 70-73 Link Here
70
            </sequential>
67
            </sequential>
71
        </macrodef>
68
        </macrodef>
72
    </target>
69
    </target>
70
    <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run-with-groovy">
71
        <j2seproject3:test testincludes=""/>
72
    </target>
73
    <target depends="init,compile-test,-pre-test-run,-do-test-run-with-groovy" if="have.tests" name="-post-test-run-with-groovy">
74
        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
75
    </target>
76
    <target depends="init,compile-test,-pre-test-run,-do-test-run-with-groovy,test-report,-post-test-run-with-groovy,-test-browse" description="Run unit tests." name="test-with-groovy"/>
77
    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single-groovy">
78
        <fail unless="test.binarytestincludes">Must select some files in the IDE or set test.includes</fail>
79
        <j2seproject3:test testincludes=""/>
80
    </target>
81
    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single-groovy" if="have.tests" name="-post-test-run-single-groovy">
82
        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
83
    </target>
84
    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single-groovy,-post-test-run-single-groovy" description="Run single unit test." name="test-single-groovy"/>
85
    <target depends="init,compile-test-single,-pre-test-run-single,-debug-start-debugger-test" name="-do-test-debug-single-groovy">
86
        <fail unless="test.binarytestincludes">Must select some files in the IDE or set test.binarytestincludes</fail>
87
        <j2seproject3:test-debug testincludes=""/>
88
    </target>
89
    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-debug-single-groovy" if="have.tests" name="-post-test-debug-single-groovy">
90
        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
91
    </target>
92
    <target depends="init,compile-test-single,-pre-test-run-single,-debug-start-debugger-test,-do-test-debug-single-groovy,-post-test-debug-single-groovy" name="debug-test-with-groovy"/>
73
</project>
93
</project>
(-)a/groovy.samples/sample_src/NBProjectGenerators/nbproject/project.properties (-2 / +2 lines)
Lines 66-73 Link Here
66
# Space-separated list of extra javac options
66
# Space-separated list of extra javac options
67
javac.compilerargs=
67
javac.compilerargs=
68
javac.deprecation=false
68
javac.deprecation=false
69
javac.source=1.5
69
javac.source=1.8
70
javac.target=1.5
70
javac.target=1.8
71
javac.test.classpath=\
71
javac.test.classpath=\
72
    ${javac.classpath}:\
72
    ${javac.classpath}:\
73
    ${build.classes.dir}:\
73
    ${build.classes.dir}:\

Return to bug 267729