]> git.mxchange.org Git - jjobs-war.git/blob - nbproject/build-impl.xml
c076a7ca77a8ab7c39fc9388a3eab629ecc20461
[jjobs-war.git] / nbproject / build-impl.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3         *** GENERATED FROM project.xml - DO NOT EDIT  ***
4         ***         EDIT ../build.xml INSTEAD         ***
5
6         For the purpose of easier reading the script
7         is divided into following sections:
8         - initialization
9         - compilation
10         - dist
11         - execution
12         - debugging
13         - javadoc
14         - test compilation
15         - test execution
16         - test debugging
17         - cleanup
18
19         -->
20 <project xmlns:webproject1="http://www.netbeans.org/ns/web-project/1" xmlns:webproject2="http://www.netbeans.org/ns/web-project/2" xmlns:webproject3="http://www.netbeans.org/ns/web-project/3" basedir=".." default="default" name="jjobs-war-impl">
21     <import file="ant-deploy.xml"/>
22     <fail message="Please build using Ant 1.7.1 or higher.">
23         <condition>
24             <not>
25                 <antversion atleast="1.7.1"/>
26             </not>
27         </condition>
28     </fail>
29     <target depends="dist,javadoc" description="Build whole project." name="default"/>
30     <!--
31                 INITIALIZATION SECTION
32             -->
33     <target name="-pre-init">
34         <!-- Empty placeholder for easier customization. -->
35         <!-- You can override this target in the ../build.xml file. -->
36     </target>
37     <target depends="-pre-init" name="-init-private">
38         <property file="nbproject/private/private.properties"/>
39     </target>
40     <target name="-pre-init-libraries">
41         <property location="./lib/nblibraries.properties" name="libraries.path"/>
42         <dirname file="${libraries.path}" property="libraries.dir.nativedirsep"/>
43         <pathconvert dirsep="/" property="libraries.dir">
44             <path path="${libraries.dir.nativedirsep}"/>
45         </pathconvert>
46         <basename file="${libraries.path}" property="libraries.basename" suffix=".properties"/>
47         <available file="${libraries.dir}/${libraries.basename}-private.properties" property="private.properties.available"/>
48     </target>
49     <target depends="-pre-init-libraries" if="private.properties.available" name="-init-private-libraries">
50         <loadproperties encoding="ISO-8859-1" srcfile="${libraries.dir}/${libraries.basename}-private.properties">
51             <filterchain>
52                 <replacestring from="$${base}" to="${libraries.dir}"/>
53                 <escapeunicode/>
54             </filterchain>
55         </loadproperties>
56     </target>
57     <target depends="-pre-init,-init-private,-init-private-libraries" name="-init-libraries">
58         <loadproperties encoding="ISO-8859-1" srcfile="${libraries.path}">
59             <filterchain>
60                 <replacestring from="$${base}" to="${libraries.dir}"/>
61                 <escapeunicode/>
62             </filterchain>
63         </loadproperties>
64     </target>
65     <target depends="-pre-init,-init-private,-init-libraries" name="-init-user">
66         <property file="${user.properties.file}"/>
67         <!-- The two properties below are usually overridden -->
68         <!-- by the active platform. Just a fallback. -->
69         <property name="default.javac.source" value="1.4"/>
70         <property name="default.javac.target" value="1.4"/>
71     </target>
72     <target depends="-pre-init,-init-private,-init-libraries,-init-user" name="-init-project">
73         <property file="nbproject/project.properties"/>
74     </target>
75     <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" if="dist.ear.dir" name="-do-ear-init"/>
76     <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-init-macrodef-property" name="-do-init">
77         <condition property="have.tests">
78             <or>
79                 <available file="${test.src.dir}"/>
80             </or>
81         </condition>
82         <condition property="have.sources">
83             <or>
84                 <available file="${src.dir}"/>
85             </or>
86         </condition>
87         <condition property="netbeans.home+have.tests">
88             <and>
89                 <isset property="netbeans.home"/>
90                 <isset property="have.tests"/>
91             </and>
92         </condition>
93         <condition property="no.javadoc.preview">
94             <isfalse value="${javadoc.preview}"/>
95         </condition>
96         <property name="javac.compilerargs" value=""/>
97         <condition property="no.deps">
98             <and>
99                 <istrue value="${no.dependencies}"/>
100             </and>
101         </condition>
102         <condition property="no.dist.ear.dir">
103             <not>
104                 <isset property="dist.ear.dir"/>
105             </not>
106         </condition>
107         <property name="build.web.excludes" value="${build.classes.excludes}"/>
108         <condition property="do.compile.jsps">
109             <istrue value="${compile.jsps}"/>
110         </condition>
111         <condition property="do.debug.server">
112             <or>
113                 <not>
114                     <isset property="debug.server"/>
115                 </not>
116                 <istrue value="${debug.server}"/>
117                 <and>
118                     <not>
119                         <istrue value="${debug.server}"/>
120                     </not>
121                     <not>
122                         <istrue value="${debug.client}"/>
123                     </not>
124                 </and>
125             </or>
126         </condition>
127         <condition property="do.debug.client">
128             <istrue value="${debug.client}"/>
129         </condition>
130         <condition property="do.display.browser">
131             <istrue value="${display.browser}"/>
132         </condition>
133         <condition property="do.display.browser.debug.old">
134             <and>
135                 <isset property="do.display.browser"/>
136                 <not>
137                     <isset property="do.debug.client"/>
138                 </not>
139                 <not>
140                     <isset property="browser.context"/>
141                 </not>
142             </and>
143         </condition>
144         <condition property="do.display.browser.debug">
145             <and>
146                 <isset property="do.display.browser"/>
147                 <not>
148                     <isset property="do.debug.client"/>
149                 </not>
150                 <isset property="browser.context"/>
151             </and>
152         </condition>
153         <available file="${conf.dir}/MANIFEST.MF" property="has.custom.manifest"/>
154         <available file="${persistence.xml.dir}/persistence.xml" property="has.persistence.xml"/>
155         <condition property="do.war.package.with.custom.manifest">
156             <isset property="has.custom.manifest"/>
157         </condition>
158         <condition property="do.war.package.without.custom.manifest">
159             <not>
160                 <isset property="has.custom.manifest"/>
161             </not>
162         </condition>
163         <condition property="do.tmp.war.package.with.custom.manifest">
164             <and>
165                 <isset property="has.custom.manifest"/>
166                 <or>
167                     <isfalse value="${directory.deployment.supported}"/>
168                     <isset property="dist.ear.dir"/>
169                 </or>
170             </and>
171         </condition>
172         <condition property="do.tmp.war.package.without.custom.manifest">
173             <and>
174                 <not>
175                     <isset property="has.custom.manifest"/>
176                 </not>
177                 <or>
178                     <isfalse value="${directory.deployment.supported}"/>
179                     <isset property="dist.ear.dir"/>
180                 </or>
181             </and>
182         </condition>
183         <condition property="do.tmp.war.package">
184             <or>
185                 <isfalse value="${directory.deployment.supported}"/>
186                 <isset property="dist.ear.dir"/>
187             </or>
188         </condition>
189         <property name="build.meta.inf.dir" value="${build.web.dir}/META-INF"/>
190         <condition else="" property="application.args.param" value="${application.args}">
191             <and>
192                 <isset property="application.args"/>
193                 <not>
194                     <equals arg1="${application.args}" arg2="" trim="true"/>
195                 </not>
196             </and>
197         </condition>
198         <property name="source.encoding" value="${file.encoding}"/>
199         <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
200             <and>
201                 <isset property="javadoc.encoding"/>
202                 <not>
203                     <equals arg1="${javadoc.encoding}" arg2=""/>
204                 </not>
205             </and>
206         </condition>
207         <property name="javadoc.encoding.used" value="${source.encoding}"/>
208         <property name="includes" value="**"/>
209         <property name="excludes" value=""/>
210         <property name="runmain.jvmargs" value=""/>
211         <condition else="false" property="jdkBug6558476">
212             <and>
213                 <matches pattern="1\.[56]" string="${java.specification.version}"/>
214                 <not>
215                     <os family="unix"/>
216                 </not>
217             </and>
218         </condition>
219         <property name="javac.fork" value="${jdkBug6558476}"/>
220         <condition property="junit.available">
221             <or>
222                 <available classname="org.junit.Test" classpath="${run.test.classpath}"/>
223                 <available classname="junit.framework.Test" classpath="${run.test.classpath}"/>
224             </or>
225         </condition>
226         <condition property="testng.available">
227             <available classname="org.testng.annotations.Test" classpath="${run.test.classpath}"/>
228         </condition>
229         <condition property="junit+testng.available">
230             <and>
231                 <istrue value="${junit.available}"/>
232                 <istrue value="${testng.available}"/>
233             </and>
234         </condition>
235         <condition else="testng" property="testng.mode" value="mixed">
236             <istrue value="${junit+testng.available}"/>
237         </condition>
238         <condition else="" property="testng.debug.mode" value="-mixed">
239             <istrue value="${junit+testng.available}"/>
240         </condition>
241     </target>
242     <target depends="init" name="-init-cos" unless="deploy.on.save">
243         <condition property="deploy.on.save" value="true">
244             <or>
245                 <istrue value="${j2ee.deploy.on.save}"/>
246                 <istrue value="${j2ee.compile.on.save}"/>
247             </or>
248         </condition>
249     </target>
250     <target name="-post-init">
251         <!-- Empty placeholder for easier customization. -->
252         <!-- You can override this target in the ../build.xml file. -->
253     </target>
254     <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-do-init" name="-init-check">
255         <fail unless="src.dir">Must set src.dir</fail>
256         <fail unless="test.src.dir">Must set test.src.dir</fail>
257         <fail unless="build.dir">Must set build.dir</fail>
258         <fail unless="build.web.dir">Must set build.web.dir</fail>
259         <fail unless="build.generated.dir">Must set build.generated.dir</fail>
260         <fail unless="dist.dir">Must set dist.dir</fail>
261         <fail unless="build.classes.dir">Must set build.classes.dir</fail>
262         <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
263         <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
264         <fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
265         <fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
266         <fail unless="dist.war">Must set dist.war</fail>
267         <condition property="missing.j2ee.server.home">
268             <and>
269                 <matches pattern="j2ee.server.home" string="${j2ee.platform.classpath}"/>
270                 <not>
271                     <isset property="j2ee.server.home"/>
272                 </not>
273             </and>
274         </condition>
275         <fail if="missing.j2ee.server.home">
276 The Java EE server classpath is not correctly set up - server home directory is missing.
277 Either open the project in the IDE and assign the server or setup the server classpath manually.
278 For example like this:
279    ant -Dj2ee.server.home=&lt;app_server_installation_directory&gt;
280                 </fail>
281         <fail unless="j2ee.platform.classpath">
282 The Java EE server classpath is not correctly set up. Your active server type is ${j2ee.server.type}.
283 Either open the project in the IDE and assign the server or setup the server classpath manually.
284 For example like this:
285    ant -Duser.properties.file=&lt;path_to_property_file&gt; (where you put the property "j2ee.platform.classpath" in a .properties file)
286 or ant -Dj2ee.platform.classpath=&lt;server_classpath&gt; (where no properties file is used)
287                 </fail>
288     </target>
289     <target name="-init-macrodef-property">
290         <macrodef name="property" uri="http://www.netbeans.org/ns/web-project/1">
291             <attribute name="name"/>
292             <attribute name="value"/>
293             <sequential>
294                 <property name="@{name}" value="${@{value}}"/>
295             </sequential>
296         </macrodef>
297     </target>
298     <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors">
299         <macrodef name="javac" uri="http://www.netbeans.org/ns/web-project/2">
300             <attribute default="${src.dir}" name="srcdir"/>
301             <attribute default="${build.classes.dir}" name="destdir"/>
302             <attribute default="${javac.classpath}:${j2ee.platform.classpath}" name="classpath"/>
303             <attribute default="${javac.processorpath}" name="processorpath"/>
304             <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
305             <attribute default="${includes}" name="includes"/>
306             <attribute default="${excludes}" name="excludes"/>
307             <attribute default="${javac.debug}" name="debug"/>
308             <attribute default="${empty.dir}" name="gensrcdir"/>
309             <element name="customize" optional="true"/>
310             <sequential>
311                 <property location="${build.dir}/empty" name="empty.dir"/>
312                 <mkdir dir="${empty.dir}"/>
313                 <mkdir dir="@{apgeneratedsrcdir}"/>
314                 <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" srcdir="@{srcdir}" target="${javac.target}">
315                     <src>
316                         <dirset dir="@{gensrcdir}" erroronmissingdir="false">
317                             <include name="*"/>
318                         </dirset>
319                     </src>
320                     <classpath>
321                         <path path="@{classpath}"/>
322                     </classpath>
323                     <compilerarg line="${javac.compilerargs}"/>
324                     <compilerarg value="-processorpath"/>
325                     <compilerarg path="@{processorpath}:${empty.dir}"/>
326                     <compilerarg line="${ap.processors.internal}"/>
327                     <compilerarg value="-s"/>
328                     <compilerarg path="@{apgeneratedsrcdir}"/>
329                     <compilerarg line="${ap.proc.none.internal}"/>
330                     <customize/>
331                 </javac>
332             </sequential>
333         </macrodef>
334     </target>
335     <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
336         <macrodef name="javac" uri="http://www.netbeans.org/ns/web-project/2">
337             <attribute default="${src.dir}" name="srcdir"/>
338             <attribute default="${build.classes.dir}" name="destdir"/>
339             <attribute default="${javac.classpath}:${j2ee.platform.classpath}" name="classpath"/>
340             <attribute default="${javac.processorpath}" name="processorpath"/>
341             <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
342             <attribute default="${includes}" name="includes"/>
343             <attribute default="${excludes}" name="excludes"/>
344             <attribute default="${javac.debug}" name="debug"/>
345             <attribute default="${empty.dir}" name="gensrcdir"/>
346             <element name="customize" optional="true"/>
347             <sequential>
348                 <property location="${build.dir}/empty" name="empty.dir"/>
349                 <mkdir dir="${empty.dir}"/>
350                 <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" includeantruntime="false" includes="@{includes}" source="${javac.source}" srcdir="@{srcdir}" target="${javac.target}">
351                     <src>
352                         <dirset dir="@{gensrcdir}" erroronmissingdir="false">
353                             <include name="*"/>
354                         </dirset>
355                     </src>
356                     <classpath>
357                         <path path="@{classpath}"/>
358                     </classpath>
359                     <compilerarg line="${javac.compilerargs}"/>
360                     <customize/>
361                 </javac>
362             </sequential>
363         </macrodef>
364     </target>
365     <target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
366         <macrodef name="depend" uri="http://www.netbeans.org/ns/web-project/2">
367             <attribute default="${src.dir}" name="srcdir"/>
368             <attribute default="${build.classes.dir}" name="destdir"/>
369             <attribute default="${javac.classpath}:${j2ee.platform.classpath}" name="classpath"/>
370             <sequential>
371                 <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">
372                     <classpath>
373                         <path path="@{classpath}"/>
374                     </classpath>
375                 </depend>
376             </sequential>
377         </macrodef>
378         <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/web-project/2">
379             <attribute default="${build.classes.dir}" name="destdir"/>
380             <sequential>
381                 <fail unless="javac.includes">Must set javac.includes</fail>
382                 <pathconvert pathsep="${line.separator}" property="javac.includes.binary">
383                     <path>
384                         <filelist dir="@{destdir}" files="${javac.includes}"/>
385                     </path>
386                     <globmapper from="*.java" to="*.class"/>
387                 </pathconvert>
388                 <tempfile deleteonexit="true" property="javac.includesfile.binary"/>
389                 <echo file="${javac.includesfile.binary}" message="${javac.includes.binary}"/>
390                 <delete>
391                     <files includesfile="${javac.includesfile.binary}"/>
392                 </delete>
393                 <delete file="${javac.includesfile.binary}"/>
394             </sequential>
395         </macrodef>
396     </target>
397     <target if="${junit.available}" name="-init-macrodef-junit-init">
398         <condition else="false" property="nb.junit.batch" value="true">
399             <and>
400                 <istrue value="${junit.available}"/>
401                 <not>
402                     <isset property="test.method"/>
403                 </not>
404             </and>
405         </condition>
406         <condition else="false" property="nb.junit.single" value="true">
407             <and>
408                 <istrue value="${junit.available}"/>
409                 <isset property="test.method"/>
410             </and>
411         </condition>
412     </target>
413     <target name="-init-test-properties">
414         <property name="test.binaryincludes" value="&lt;nothing&gt;"/>
415         <property name="test.binarytestincludes" value=""/>
416         <property name="test.binaryexcludes" value=""/>
417     </target>
418     <target if="${nb.junit.single}" name="-init-macrodef-junit-single" unless="${nb.junit.batch}">
419         <macrodef name="junit" uri="http://www.netbeans.org/ns/web-project/2">
420             <attribute default="${includes}" name="includes"/>
421             <attribute default="${excludes}" name="excludes"/>
422             <attribute default="**" name="testincludes"/>
423             <attribute default="" name="testmethods"/>
424             <element name="customize" optional="true"/>
425             <sequential>
426                 <junit dir="${basedir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true" tempdir="${java.io.tmpdir}">
427                     <test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/>
428                     <syspropertyset>
429                         <propertyref prefix="test-sys-prop."/>
430                         <mapper from="test-sys-prop.*" to="*" type="glob"/>
431                     </syspropertyset>
432                     <formatter type="brief" usefile="false"/>
433                     <formatter type="xml"/>
434                     <jvmarg value="-ea"/>
435                     <customize/>
436                 </junit>
437             </sequential>
438         </macrodef>
439     </target>
440     <target depends="-init-test-properties" if="${nb.junit.batch}" name="-init-macrodef-junit-batch" unless="${nb.junit.single}">
441         <macrodef name="junit" uri="http://www.netbeans.org/ns/web-project/2">
442             <attribute default="${includes}" name="includes"/>
443             <attribute default="${excludes}" name="excludes"/>
444             <attribute default="**" name="testincludes"/>
445             <attribute default="" name="testmethods"/>
446             <element name="customize" optional="true"/>
447             <sequential>
448                 <property name="run.jvmargs.ide" value=""/>
449                 <junit dir="${basedir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true" tempdir="${build.dir}">
450                     <batchtest todir="${build.test.results.dir}">
451                         <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
452                             <filename name="@{testincludes}"/>
453                         </fileset>
454                         <fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}">
455                             <filename name="${test.binarytestincludes}"/>
456                         </fileset>
457                     </batchtest>
458                     <syspropertyset>
459                         <propertyref prefix="test-sys-prop."/>
460                         <mapper from="test-sys-prop.*" to="*" type="glob"/>
461                     </syspropertyset>
462                     <formatter type="brief" usefile="false"/>
463                     <formatter type="xml"/>
464                     <jvmarg value="-ea"/>
465                     <jvmarg line="${run.jvmargs.ide}"/>
466                     <customize/>
467                 </junit>
468             </sequential>
469         </macrodef>
470     </target>
471     <target depends="-init-macrodef-junit-init,-init-macrodef-junit-single, -init-macrodef-junit-batch" if="${junit.available}" name="-init-macrodef-junit"/>
472     <target if="${testng.available}" name="-init-macrodef-testng">
473         <macrodef name="testng" uri="http://www.netbeans.org/ns/web-project/2">
474             <attribute default="${includes}" name="includes"/>
475             <attribute default="${excludes}" name="excludes"/>
476             <attribute default="**" name="testincludes"/>
477             <attribute default="" name="testmethods"/>
478             <element name="customize" optional="true"/>
479             <sequential>
480                 <condition else="" property="testng.methods.arg" value="@{testincludes}.@{testmethods}">
481                     <isset property="test.method"/>
482                 </condition>
483                 <union id="test.set">
484                     <fileset dir="${test.src.dir}" excludes="@{excludes},**/*.xml,${excludes}" includes="@{includes}">
485                         <filename name="@{testincludes}"/>
486                     </fileset>
487                 </union>
488                 <taskdef classname="org.testng.TestNGAntTask" classpath="${run.test.classpath}" name="testng"/>
489                 <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="jjobs-war" testname="TestNG tests" workingDir="${basedir}">
490                     <xmlfileset dir="${build.test.classes.dir}" includes="@{testincludes}"/>
491                     <propertyset>
492                         <propertyref prefix="test-sys-prop."/>
493                         <mapper from="test-sys-prop.*" to="*" type="glob"/>
494                     </propertyset>
495                     <customize/>
496                 </testng>
497             </sequential>
498         </macrodef>
499     </target>
500     <target name="-init-macrodef-test-impl">
501         <macrodef name="test-impl" uri="http://www.netbeans.org/ns/web-project/2">
502             <attribute default="${includes}" name="includes"/>
503             <attribute default="${excludes}" name="excludes"/>
504             <attribute default="**" name="testincludes"/>
505             <attribute default="" name="testmethods"/>
506             <element implicit="true" name="customize" optional="true"/>
507             <sequential>
508                 <echo>No tests executed.</echo>
509             </sequential>
510         </macrodef>
511     </target>
512     <target depends="-init-macrodef-junit" if="${junit.available}" name="-init-macrodef-junit-impl">
513         <macrodef name="test-impl" uri="http://www.netbeans.org/ns/web-project/2">
514             <attribute default="${includes}" name="includes"/>
515             <attribute default="${excludes}" name="excludes"/>
516             <attribute default="**" name="testincludes"/>
517             <attribute default="" name="testmethods"/>
518             <element implicit="true" name="customize" optional="true"/>
519             <sequential>
520                 <webproject2:junit excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
521                     <customize/>
522                 </webproject2:junit>
523             </sequential>
524         </macrodef>
525     </target>
526     <target depends="-init-macrodef-testng" if="${testng.available}" name="-init-macrodef-testng-impl">
527         <macrodef name="test-impl" uri="http://www.netbeans.org/ns/web-project/2">
528             <attribute default="${includes}" name="includes"/>
529             <attribute default="${excludes}" name="excludes"/>
530             <attribute default="**" name="testincludes"/>
531             <attribute default="" name="testmethods"/>
532             <element implicit="true" name="customize" optional="true"/>
533             <sequential>
534                 <webproject2:testng excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
535                     <customize/>
536                 </webproject2:testng>
537             </sequential>
538         </macrodef>
539     </target>
540     <target depends="-init-macrodef-test-impl,-init-macrodef-junit-impl,-init-macrodef-testng-impl" name="-init-macrodef-test">
541         <macrodef name="test" uri="http://www.netbeans.org/ns/web-project/2">
542             <attribute default="${includes}" name="includes"/>
543             <attribute default="${excludes}" name="excludes"/>
544             <attribute default="**" name="testincludes"/>
545             <attribute default="" name="testmethods"/>
546             <sequential>
547                 <webproject2:test-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
548                     <customize>
549                         <classpath>
550                             <path path="${run.test.classpath}:${j2ee.platform.classpath}:${j2ee.platform.embeddableejb.classpath}"/>
551                         </classpath>
552                         <jvmarg line="${runmain.jvmargs}"/>
553                     </customize>
554                 </webproject2:test-impl>
555             </sequential>
556         </macrodef>
557     </target>
558     <target if="${junit.available}" name="-init-macrodef-junit-debug" unless="${nb.junit.batch}">
559         <macrodef name="junit-debug" uri="http://www.netbeans.org/ns/web-project/2">
560             <attribute default="${includes}" name="includes"/>
561             <attribute default="${excludes}" name="excludes"/>
562             <attribute default="**" name="testincludes"/>
563             <attribute default="" name="testmethods"/>
564             <element name="customize" optional="true"/>
565             <sequential>
566                 <junit dir="${basedir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true" tempdir="${java.io.tmpdir}">
567                     <test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/>
568                     <syspropertyset>
569                         <propertyref prefix="test-sys-prop."/>
570                         <mapper from="test-sys-prop.*" to="*" type="glob"/>
571                     </syspropertyset>
572                     <formatter type="brief" usefile="false"/>
573                     <formatter type="xml"/>
574                     <jvmarg value="-ea"/>
575                     <jvmarg line="${debug-args-line}"/>
576                     <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
577                     <customize/>
578                 </junit>
579             </sequential>
580         </macrodef>
581     </target>
582     <target depends="-init-test-properties" if="${nb.junit.batch}" name="-init-macrodef-junit-debug-batch">
583         <macrodef name="junit-debug" uri="http://www.netbeans.org/ns/web-project/2">
584             <attribute default="${includes}" name="includes"/>
585             <attribute default="${excludes}" name="excludes"/>
586             <attribute default="**" name="testincludes"/>
587             <attribute default="" name="testmethods"/>
588             <element name="customize" optional="true"/>
589             <sequential>
590                 <property name="run.jvmargs.ide" value=""/>
591                 <junit dir="${basedir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true" tempdir="${build.dir}">
592                     <batchtest todir="${build.test.results.dir}">
593                         <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
594                             <filename name="@{testincludes}"/>
595                         </fileset>
596                         <fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}">
597                             <filename name="${test.binarytestincludes}"/>
598                         </fileset>
599                     </batchtest>
600                     <syspropertyset>
601                         <propertyref prefix="test-sys-prop."/>
602                         <mapper from="test-sys-prop.*" to="*" type="glob"/>
603                     </syspropertyset>
604                     <formatter type="brief" usefile="false"/>
605                     <formatter type="xml"/>
606                     <jvmarg value="-ea"/>
607                     <jvmarg line="${run.jvmargs.ide}"/>
608                     <jvmarg line="${debug-args-line}"/>
609                     <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
610                     <customize/>
611                 </junit>
612             </sequential>
613         </macrodef>
614     </target>
615     <target depends="-init-macrodef-junit-debug,-init-macrodef-junit-debug-batch" if="${junit.available}" name="-init-macrodef-junit-debug-impl">
616         <macrodef name="test-debug-impl" uri="http://www.netbeans.org/ns/web-project/2">
617             <attribute default="${includes}" name="includes"/>
618             <attribute default="${excludes}" name="excludes"/>
619             <attribute default="**" name="testincludes"/>
620             <attribute default="" name="testmethods"/>
621             <element implicit="true" name="customize" optional="true"/>
622             <sequential>
623                 <webproject2:junit-debug excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
624                     <customize/>
625                 </webproject2:junit-debug>
626             </sequential>
627         </macrodef>
628     </target>
629     <target if="${testng.available}" name="-init-macrodef-testng-debug">
630         <macrodef name="testng-debug" uri="http://www.netbeans.org/ns/web-project/2">
631             <attribute default="${main.class}" name="testClass"/>
632             <attribute default="" name="testMethod"/>
633             <element name="customize2" optional="true"/>
634             <sequential>
635                 <condition else="-testclass @{testClass}" property="test.class.or.method" value="-methods @{testClass}.@{testMethod}">
636                     <isset property="test.method"/>
637                 </condition>
638                 <condition else="-suitename jjobs-war -testname @{testClass} ${test.class.or.method}" property="testng.cmd.args" value="@{testClass}">
639                     <matches pattern=".*\.xml" string="@{testClass}"/>
640                 </condition>
641                 <delete dir="${build.test.results.dir}" quiet="true"/>
642                 <mkdir dir="${build.test.results.dir}"/>
643                 <webproject1:debug args="${testng.cmd.args}" classname="org.testng.TestNG" classpath="${debug.test.classpath}:${j2ee.platform.embeddableejb.classpath}">
644                     <customize>
645                         <customize2/>
646                         <jvmarg value="-ea"/>
647                         <arg line="${testng.debug.mode}"/>
648                         <arg line="-d ${build.test.results.dir}"/>
649                         <arg line="-listener org.testng.reporters.VerboseReporter"/>
650                     </customize>
651                 </webproject1:debug>
652             </sequential>
653         </macrodef>
654     </target>
655     <target depends="-init-macrodef-testng-debug" if="${testng.available}" name="-init-macrodef-testng-debug-impl">
656         <macrodef name="testng-debug-impl" uri="http://www.netbeans.org/ns/web-project/2">
657             <attribute default="${main.class}" name="testClass"/>
658             <attribute default="" name="testMethod"/>
659             <element implicit="true" name="customize2" optional="true"/>
660             <sequential>
661                 <webproject2:testng-debug testClass="@{testClass}" testMethod="@{testMethod}">
662                     <customize2/>
663                 </webproject2:testng-debug>
664             </sequential>
665         </macrodef>
666     </target>
667     <target depends="-init-macrodef-junit-debug-impl" if="${junit.available}" name="-init-macrodef-test-debug-junit">
668         <macrodef name="test-debug" uri="http://www.netbeans.org/ns/web-project/2">
669             <attribute default="${includes}" name="includes"/>
670             <attribute default="${excludes}" name="excludes"/>
671             <attribute default="**" name="testincludes"/>
672             <attribute default="" name="testmethods"/>
673             <attribute default="${main.class}" name="testClass"/>
674             <attribute default="" name="testMethod"/>
675             <sequential>
676                 <webproject2:test-debug-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
677                     <customize>
678                         <classpath>
679                             <path path="${run.test.classpath}:${j2ee.platform.classpath}:${j2ee.platform.embeddableejb.classpath}"/>
680                         </classpath>
681                         <jvmarg line="${runmain.jvmargs}"/>
682                     </customize>
683                 </webproject2:test-debug-impl>
684             </sequential>
685         </macrodef>
686     </target>
687     <target depends="-init-macrodef-testng-debug-impl" if="${testng.available}" name="-init-macrodef-test-debug-testng">
688         <macrodef name="test-debug" uri="http://www.netbeans.org/ns/web-project/2">
689             <attribute default="${includes}" name="includes"/>
690             <attribute default="${excludes}" name="excludes"/>
691             <attribute default="**" name="testincludes"/>
692             <attribute default="" name="testmethods"/>
693             <attribute default="${main.class}" name="testClass"/>
694             <attribute default="" name="testMethod"/>
695             <sequential>
696                 <webproject2:testng-debug-impl testClass="@{testClass}" testMethod="@{testMethod}">
697                     <customize2>
698                         <syspropertyset>
699                             <propertyref prefix="test-sys-prop."/>
700                             <mapper from="test-sys-prop.*" to="*" type="glob"/>
701                         </syspropertyset>
702                     </customize2>
703                 </webproject2:testng-debug-impl>
704             </sequential>
705         </macrodef>
706     </target>
707     <target depends="-init-macrodef-test-debug-junit,-init-macrodef-test-debug-testng" name="-init-macrodef-test-debug"/>
708     <target name="-init-macrodef-java">
709         <macrodef name="java" uri="http://www.netbeans.org/ns/web-project/1">
710             <attribute default="${main.class}" name="classname"/>
711             <attribute default="${debug.classpath}" name="classpath"/>
712             <element name="customize" optional="true"/>
713             <sequential>
714                 <java classname="@{classname}" fork="true">
715                     <jvmarg line="${runmain.jvmargs}"/>
716                     <classpath>
717                         <path path="@{classpath}:${j2ee.platform.classpath}"/>
718                     </classpath>
719                     <syspropertyset>
720                         <propertyref prefix="run-sys-prop."/>
721                         <mapper from="run-sys-prop.*" to="*" type="glob"/>
722                     </syspropertyset>
723                     <customize/>
724                 </java>
725             </sequential>
726         </macrodef>
727     </target>
728     <target name="-init-macrodef-nbjsdebug">
729         <macrodef name="nbjsdebugstart" uri="http://www.netbeans.org/ns/web-project/1">
730             <attribute default="${client.url}" name="webUrl"/>
731             <sequential>
732                 <nbjsdebugstart urlPart="${client.urlPart}" webUrl="@{webUrl}"/>
733             </sequential>
734         </macrodef>
735     </target>
736     <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
737         <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/web-project/1">
738             <attribute default="${main.class}" name="name"/>
739             <attribute default="${debug.classpath}:${j2ee.platform.classpath}" name="classpath"/>
740             <sequential>
741                 <nbjpdastart addressproperty="jpda.address" name="@{name}" transport="${debug-transport}">
742                     <classpath>
743                         <path path="@{classpath}"/>
744                     </classpath>
745                 </nbjpdastart>
746             </sequential>
747         </macrodef>
748         <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/web-project/1">
749             <attribute default="${build.classes.dir}" name="dir"/>
750             <sequential>
751                 <nbjpdareload>
752                     <fileset dir="@{dir}" includes="${fix.classes}">
753                         <include name="${fix.includes}*.class"/>
754                     </fileset>
755                 </nbjpdareload>
756             </sequential>
757         </macrodef>
758         <macrodef name="nbjpdaappreloaded" uri="http://www.netbeans.org/ns/web-project/1">
759             <sequential>
760                 <nbjpdaappreloaded/>
761             </sequential>
762         </macrodef>
763     </target>
764     <target name="-init-debug-args">
765         <property name="version-output" value="java version &quot;${ant.java.version}"/>
766         <condition property="have-jdk-older-than-1.4">
767             <or>
768                 <contains string="${version-output}" substring="java version &quot;1.0"/>
769                 <contains string="${version-output}" substring="java version &quot;1.1"/>
770                 <contains string="${version-output}" substring="java version &quot;1.2"/>
771                 <contains string="${version-output}" substring="java version &quot;1.3"/>
772             </or>
773         </condition>
774         <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
775             <istrue value="${have-jdk-older-than-1.4}"/>
776         </condition>
777         <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
778             <os family="windows"/>
779         </condition>
780         <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}">
781             <isset property="debug.transport"/>
782         </condition>
783     </target>
784     <target depends="-init-debug-args" name="-init-macrodef-debug">
785         <macrodef name="debug" uri="http://www.netbeans.org/ns/web-project/1">
786             <attribute default="${main.class}" name="classname"/>
787             <attribute default="${debug.classpath}:${j2ee.platform.classpath}" name="classpath"/>
788             <attribute default="${application.args.param}" name="args"/>
789             <element name="customize" optional="true"/>
790             <sequential>
791                 <java classname="@{classname}" fork="true">
792                     <jvmarg line="${debug-args-line}"/>
793                     <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
794                     <jvmarg line="${runmain.jvmargs}"/>
795                     <classpath>
796                         <path path="@{classpath}"/>
797                     </classpath>
798                     <syspropertyset>
799                         <propertyref prefix="run-sys-prop."/>
800                         <mapper from="run-sys-prop.*" to="*" type="glob"/>
801                     </syspropertyset>
802                     <arg line="@{args}"/>
803                     <customize/>
804                 </java>
805             </sequential>
806         </macrodef>
807     </target>
808     <target name="-init-taskdefs">
809         <fail unless="libs.CopyLibs.classpath">
810 The libs.CopyLibs.classpath property is not set up.
811 This property must point to 
812 org-netbeans-modules-java-j2seproject-copylibstask.jar file which is part
813 of NetBeans IDE installation and is usually located at 
814 &lt;netbeans_installation&gt;/java&lt;version&gt;/ant/extra folder.
815 Either open the project in the IDE and make sure CopyLibs library
816 exists or setup the property manually. For example like this:
817  ant -Dlibs.CopyLibs.classpath=a/path/to/org-netbeans-modules-java-j2seproject-copylibstask.jar
818                 </fail>
819         <taskdef classpath="${libs.CopyLibs.classpath}" resource="org/netbeans/modules/java/j2seproject/copylibstask/antlib.xml"/>
820     </target>
821     <target name="-init-ap-cmdline-properties">
822         <property name="annotation.processing.enabled" value="true"/>
823         <property name="annotation.processing.processors.list" value=""/>
824         <property name="annotation.processing.run.all.processors" value="true"/>
825         <property name="javac.processorpath" value="${javac.classpath}"/>
826         <property name="javac.test.processorpath" value="${javac.test.classpath}"/>
827         <condition property="ap.supported.internal" value="true">
828             <not>
829                 <matches pattern="1\.[0-5](\..*)?" string="${javac.source}"/>
830             </not>
831         </condition>
832     </target>
833     <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-ap-cmdline-supported">
834         <condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}">
835             <isfalse value="${annotation.processing.run.all.processors}"/>
836         </condition>
837         <condition else="" property="ap.proc.none.internal" value="-proc:none">
838             <isfalse value="${annotation.processing.enabled}"/>
839         </condition>
840     </target>
841     <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline">
842         <property name="ap.cmd.line.internal" value=""/>
843     </target>
844     <!--
845                 pre NB7.2 profiling section; consider it deprecated
846             -->
847     <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-check" if="profiler.info.jvmargs.agent" name="profile-init"/>
848     <target if="profiler.info.jvmargs.agent" name="-profile-pre-init">
849         <!-- Empty placeholder for easier customization. -->
850         <!-- You can override this target in the ../build.xml file. -->
851     </target>
852     <target if="profiler.info.jvmargs.agent" name="-profile-post-init">
853         <!-- Empty placeholder for easier customization. -->
854         <!-- You can override this target in the ../build.xml file. -->
855     </target>
856     <target depends="-profile-pre-init, init, -profile-post-init" if="profiler.info.jvmargs.agent" name="-profile-init-check">
857         <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail>
858         <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
859     </target>
860     <!--
861                 end of pre NB7.2 profiling section
862             -->
863     <target depends="-pre-init,-init-private,-init-libraries,-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-java,-init-macrodef-nbjpda,-init-macrodef-nbjsdebug,-init-macrodef-debug,-init-taskdefs,-init-ap-cmdline" name="init"/>
864     <!--
865                 COMPILATION SECTION
866             -->
867     <target depends="init" if="no.dist.ear.dir" name="deps-module-jar" unless="no.deps">
868         <ant antfile="${project.jjobs-lib}/build.xml" inheritall="false" target="jar">
869             <property name="deploy.on.save" value="false"/>
870         </ant>
871     </target>
872     <target depends="init" if="dist.ear.dir" name="deps-ear-jar" unless="no.deps">
873         <ant antfile="${project.jjobs-lib}/build.xml" inheritall="false" target="jar">
874             <property name="deploy.on.save" value="false"/>
875         </ant>
876     </target>
877     <target depends="init, deps-module-jar, deps-ear-jar" name="deps-jar" unless="no.deps"/>
878     <target depends="init,deps-jar" name="-pre-pre-compile">
879         <mkdir dir="${build.classes.dir}"/>
880     </target>
881     <target name="-pre-compile">
882         <!-- Empty placeholder for easier customization. -->
883         <!-- You can override this target in the ../build.xml file. -->
884     </target>
885     <target name="-copy-webdir">
886         <copy todir="${build.web.dir}">
887             <fileset dir="${web.docbase.dir}" excludes="${build.web.excludes},${excludes}" includes="${includes}"/>
888         </copy>
889         <copy todir="${build.web.dir}/WEB-INF">
890             <fileset dir="${webinf.dir}" excludes="${build.web.excludes}"/>
891         </copy>
892     </target>
893     <target depends="init, deps-jar, -pre-pre-compile, -pre-compile, -copy-manifest, -copy-persistence-xml, -copy-webdir, library-inclusion-in-archive,library-inclusion-in-manifest" if="have.sources" name="-do-compile">
894         <webproject2:javac destdir="${build.classes.dir}" gensrcdir="${build.generated.sources.dir}"/>
895         <copy todir="${build.classes.dir}">
896             <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
897         </copy>
898     </target>
899     <target if="has.custom.manifest" name="-copy-manifest">
900         <mkdir dir="${build.meta.inf.dir}"/>
901         <copy todir="${build.meta.inf.dir}">
902             <fileset dir="${conf.dir}" includes="MANIFEST.MF"/>
903         </copy>
904     </target>
905     <target if="has.persistence.xml" name="-copy-persistence-xml">
906         <mkdir dir="${build.web.dir}/WEB-INF/classes/META-INF"/>
907         <copy todir="${build.web.dir}/WEB-INF/classes/META-INF">
908             <fileset dir="${persistence.xml.dir}" includes="persistence.xml orm.xml"/>
909         </copy>
910     </target>
911     <target name="-post-compile">
912         <!-- Empty placeholder for easier customization. -->
913         <!-- You can override this target in the ../build.xml file. -->
914     </target>
915     <target depends="init,deps-jar,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
916     <target name="-pre-compile-single">
917         <!-- Empty placeholder for easier customization. -->
918         <!-- You can override this target in the ../build.xml file. -->
919     </target>
920     <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
921         <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
922         <webproject2:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}"/>
923         <copy todir="${build.classes.dir}">
924             <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
925         </copy>
926     </target>
927     <target name="-post-compile-single">
928         <!-- Empty placeholder for easier customization. -->
929         <!-- You can override this target in the ../build.xml file. -->
930     </target>
931     <target depends="init,deps-jar,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
932     <property name="jspc.schemas" value="/resources/schemas/"/>
933     <property name="jspc.dtds" value="/resources/dtds/"/>
934     <target depends="compile" description="Test compile JSP pages to expose compilation errors." if="do.compile.jsps" name="compile-jsps">
935         <mkdir dir="${build.generated.dir}/src"/>
936         <java classname="org.netbeans.modules.web.project.ant.JspC" failonerror="true" fork="true">
937             <arg value="-uriroot"/>
938             <arg file="${basedir}/${build.web.dir}"/>
939             <arg value="-d"/>
940             <arg file="${basedir}/${build.generated.dir}/src"/>
941             <arg value="-die1"/>
942             <arg value="-schemas ${jspc.schemas}"/>
943             <arg value="-dtds ${jspc.dtds}"/>
944             <arg value="-compilerSourceVM ${javac.source}"/>
945             <arg value="-compilerTargetVM ${javac.target}"/>
946             <arg value="-javaEncoding ${source.encoding}"/>
947             <arg value="-sysClasspath ${libs.jsp-compilation-syscp.classpath}"/>
948             <classpath path="${java.home}/../lib/tools.jar:${libs.jsp-compiler.classpath}:${libs.jsp-compilation.classpath}"/>
949         </java>
950         <mkdir dir="${build.generated.dir}/classes"/>
951         <webproject2:javac classpath="${build.classes.dir}:${libs.jsp-compilation.classpath}:${javac.classpath}:${j2ee.platform.classpath}" destdir="${build.generated.dir}/classes" srcdir="${build.generated.dir}/src"/>
952     </target>
953     <target depends="compile" if="jsp.includes" name="-do-compile-single-jsp">
954         <fail unless="javac.jsp.includes">Must select some files in the IDE or set javac.jsp.includes</fail>
955         <mkdir dir="${build.generated.dir}/src"/>
956         <java classname="org.netbeans.modules.web.project.ant.JspCSingle" failonerror="true" fork="true">
957             <arg value="-uriroot"/>
958             <arg file="${basedir}/${build.web.dir}"/>
959             <arg value="-d"/>
960             <arg file="${basedir}/${build.generated.dir}/src"/>
961             <arg value="-die1"/>
962             <arg value="-schemas ${jspc.schemas}"/>
963             <arg value="-dtds ${jspc.dtds}"/>
964             <arg value="-sysClasspath ${libs.jsp-compilation-syscp.classpath}"/>
965             <arg value="-jspc.files"/>
966             <arg path="${jsp.includes}"/>
967             <arg value="-compilerSourceVM ${javac.source}"/>
968             <arg value="-compilerTargetVM ${javac.target}"/>
969             <arg value="-javaEncoding ${source.encoding}"/>
970             <classpath path="${java.home}/../lib/tools.jar:${libs.jsp-compiler.classpath}:${libs.jsp-compilation.classpath}"/>
971         </java>
972         <mkdir dir="${build.generated.dir}/classes"/>
973         <webproject2:javac classpath="${build.classes.dir}:${libs.jsp-compilation.classpath}:${javac.classpath}:${j2ee.platform.classpath}" destdir="${build.generated.dir}/classes" srcdir="${build.generated.dir}/src">
974             <customize>
975                 <patternset includes="${javac.jsp.includes}"/>
976             </customize>
977         </webproject2:javac>
978     </target>
979     <target name="compile-single-jsp">
980         <fail unless="jsp.includes">Must select a file in the IDE or set jsp.includes</fail>
981         <antcall target="-do-compile-single-jsp"/>
982     </target>
983     <!--
984                 DIST BUILDING SECTION
985             -->
986     <target name="-pre-dist">
987         <!-- Empty placeholder for easier customization. -->
988         <!-- You can override this target in the ../build.xml file. -->
989     </target>
990     <target depends="init,compile,compile-jsps,-pre-dist" if="do.war.package.without.custom.manifest" name="-do-dist-without-manifest">
991         <dirname file="${dist.war}" property="dist.jar.dir"/>
992         <mkdir dir="${dist.jar.dir}"/>
993         <jar compress="${jar.compress}" jarfile="${dist.war}">
994             <fileset dir="${build.web.dir}" excludes="WEB-INF/classes/.netbeans_*,${dist.archive.excludes}"/>
995         </jar>
996     </target>
997     <target depends="init,compile,compile-jsps,-pre-dist" if="do.war.package.with.custom.manifest" name="-do-dist-with-manifest">
998         <dirname file="${dist.war}" property="dist.jar.dir"/>
999         <mkdir dir="${dist.jar.dir}"/>
1000         <jar compress="${jar.compress}" jarfile="${dist.war}" manifest="${build.meta.inf.dir}/MANIFEST.MF">
1001             <fileset dir="${build.web.dir}" excludes="WEB-INF/classes/.netbeans_*,${dist.archive.excludes}"/>
1002         </jar>
1003     </target>
1004     <target depends="init,compile,compile-jsps,-pre-dist" if="do.tmp.war.package.without.custom.manifest" name="-do-tmp-dist-without-manifest">
1005         <dirname file="${dist.war}" property="dist.jar.dir"/>
1006         <mkdir dir="${dist.jar.dir}"/>
1007         <jar compress="${jar.compress}" jarfile="${dist.war}">
1008             <fileset dir="${build.web.dir}" excludes="WEB-INF/classes/.netbeans_*,${dist.archive.excludes}"/>
1009         </jar>
1010     </target>
1011     <target depends="init,compile,compile-jsps,-pre-dist" if="do.tmp.war.package.with.custom.manifest" name="-do-tmp-dist-with-manifest">
1012         <dirname file="${dist.war}" property="dist.jar.dir"/>
1013         <mkdir dir="${dist.jar.dir}"/>
1014         <jar compress="${jar.compress}" jarfile="${dist.war}" manifest="${build.meta.inf.dir}/MANIFEST.MF">
1015             <fileset dir="${build.web.dir}" excludes="WEB-INF/classes/.netbeans_*,${dist.archive.excludes}"/>
1016         </jar>
1017     </target>
1018     <target depends="init,compile,compile-jsps,-pre-dist,-do-dist-with-manifest,-do-dist-without-manifest" name="do-dist"/>
1019     <target depends="init" if="dist.ear.dir" name="library-inclusion-in-manifest">
1020         <copyfiles files="${reference.jjobs-lib.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
1021         <mkdir dir="${build.web.dir}/META-INF"/>
1022         <manifest file="${build.web.dir}/META-INF/MANIFEST.MF" mode="update"/>
1023     </target>
1024     <target depends="init" name="library-inclusion-in-archive" unless="dist.ear.dir">
1025         <copyfiles files="${reference.jjobs-lib.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
1026     </target>
1027     <target depends="init" if="dist.ear.dir" name="-clean-webinf-lib">
1028         <delete dir="${build.web.dir}/WEB-INF/lib"/>
1029     </target>
1030     <target depends="init,-clean-webinf-lib,compile,compile-jsps,-pre-dist,library-inclusion-in-manifest" if="do.tmp.war.package" name="do-ear-dist">
1031         <dirname file="${dist.ear.war}" property="dist.jar.dir"/>
1032         <mkdir dir="${dist.jar.dir}"/>
1033         <jar compress="${jar.compress}" jarfile="${dist.ear.war}" manifest="${build.web.dir}/META-INF/MANIFEST.MF">
1034             <fileset dir="${build.web.dir}" excludes="WEB-INF/classes/.netbeans_*,${dist.archive.excludes}"/>
1035         </jar>
1036     </target>
1037     <target name="-post-dist">
1038         <!-- Empty placeholder for easier customization. -->
1039         <!-- You can override this target in the ../build.xml file. -->
1040     </target>
1041     <target depends="init,compile,-pre-dist,do-dist,-post-dist" description="Build distribution (WAR)." name="dist"/>
1042     <target depends="init,-clean-webinf-lib,-init-cos,compile,-pre-dist,do-ear-dist,-post-dist" description="Build distribution (WAR) to be packaged into an EAR." name="dist-ear"/>
1043     <!--
1044                 EXECUTION SECTION
1045             -->
1046     <target depends="run-deploy,run-display-browser" description="Deploy to server and show in browser." name="run"/>
1047     <target name="-pre-run-deploy">
1048         <!-- Empty placeholder for easier customization. -->
1049         <!-- You can override this target in the ../build.xml file. -->
1050     </target>
1051     <target name="-post-run-deploy">
1052         <!-- Empty placeholder for easier customization. -->
1053         <!-- You can override this target in the ../build.xml file. -->
1054     </target>
1055     <target name="-pre-nbmodule-run-deploy">
1056         <!-- Empty placeholder for easier customization. -->
1057         <!-- This target can be overriden by NetBeans modules. Don't override it directly, use -pre-run-deploy task instead. -->
1058     </target>
1059     <target name="-post-nbmodule-run-deploy">
1060         <!-- Empty placeholder for easier customization. -->
1061         <!-- This target can be overriden by NetBeans modules. Don't override it directly, use -post-run-deploy task instead. -->
1062     </target>
1063     <target name="-run-deploy-am">
1064         <!-- Task to deploy to the Access Manager runtime. -->
1065     </target>
1066     <target depends="init,-init-cos,compile,compile-jsps,-do-compile-single-jsp,-pre-dist,-do-tmp-dist-with-manifest,-do-tmp-dist-without-manifest,-pre-run-deploy,-pre-nbmodule-run-deploy,-run-deploy-nb,-init-deploy-ant,-deploy-ant,-run-deploy-am,-post-nbmodule-run-deploy,-post-run-deploy,-do-update-breakpoints" name="run-deploy"/>
1067     <target if="netbeans.home" name="-run-deploy-nb">
1068         <nbdeploy clientUrlPart="${client.urlPart}" debugmode="false" forceRedeploy="${forceRedeploy}"/>
1069     </target>
1070     <target name="-init-deploy-ant" unless="netbeans.home">
1071         <property name="deploy.ant.archive" value="${dist.war}"/>
1072         <property name="deploy.ant.docbase.dir" value="${web.docbase.dir}"/>
1073         <property name="deploy.ant.resource.dir" value="${resource.dir}"/>
1074         <property name="deploy.ant.enabled" value="true"/>
1075     </target>
1076     <target depends="dist,-run-undeploy-nb,-init-deploy-ant,-undeploy-ant" name="run-undeploy"/>
1077     <target if="netbeans.home" name="-run-undeploy-nb">
1078         <fail message="Undeploy is not supported from within the IDE"/>
1079     </target>
1080     <target depends="init,-pre-dist,dist,-post-dist" name="verify">
1081         <nbverify file="${dist.war}"/>
1082     </target>
1083     <target depends="run-deploy,-init-display-browser,-display-browser-nb-old,-display-browser-nb,-display-browser-cl" name="run-display-browser"/>
1084     <target if="do.display.browser" name="-init-display-browser">
1085         <condition property="do.display.browser.nb.old">
1086             <and>
1087                 <isset property="netbeans.home"/>
1088                 <not>
1089                     <isset property="browser.context"/>
1090                 </not>
1091             </and>
1092         </condition>
1093         <condition property="do.display.browser.nb">
1094             <and>
1095                 <isset property="netbeans.home"/>
1096                 <isset property="browser.context"/>
1097             </and>
1098         </condition>
1099         <condition property="do.display.browser.cl">
1100             <isset property="deploy.ant.enabled"/>
1101         </condition>
1102     </target>
1103     <target if="do.display.browser.nb.old" name="-display-browser-nb-old">
1104         <nbbrowse url="${client.url}"/>
1105     </target>
1106     <target if="do.display.browser.nb" name="-display-browser-nb">
1107         <nbbrowse context="${browser.context}" url="${client.url}" urlPath="${client.urlPart}"/>
1108     </target>
1109     <target if="do.display.browser.cl" name="-get-browser" unless="browser">
1110         <condition property="browser" value="rundll32">
1111             <os family="windows"/>
1112         </condition>
1113         <condition else="" property="browser.args" value="url.dll,FileProtocolHandler">
1114             <os family="windows"/>
1115         </condition>
1116         <condition property="browser" value="/usr/bin/open">
1117             <os family="mac"/>
1118         </condition>
1119         <property environment="env"/>
1120         <condition property="browser" value="${env.BROWSER}">
1121             <isset property="env.BROWSER"/>
1122         </condition>
1123         <condition property="browser" value="/usr/bin/firefox">
1124             <available file="/usr/bin/firefox"/>
1125         </condition>
1126         <condition property="browser" value="/usr/local/firefox/firefox">
1127             <available file="/usr/local/firefox/firefox"/>
1128         </condition>
1129         <condition property="browser" value="/usr/bin/mozilla">
1130             <available file="/usr/bin/mozilla"/>
1131         </condition>
1132         <condition property="browser" value="/usr/local/mozilla/mozilla">
1133             <available file="/usr/local/mozilla/mozilla"/>
1134         </condition>
1135         <condition property="browser" value="/usr/sfw/lib/firefox/firefox">
1136             <available file="/usr/sfw/lib/firefox/firefox"/>
1137         </condition>
1138         <condition property="browser" value="/opt/csw/bin/firefox">
1139             <available file="/opt/csw/bin/firefox"/>
1140         </condition>
1141         <condition property="browser" value="/usr/sfw/lib/mozilla/mozilla">
1142             <available file="/usr/sfw/lib/mozilla/mozilla"/>
1143         </condition>
1144         <condition property="browser" value="/opt/csw/bin/mozilla">
1145             <available file="/opt/csw/bin/mozilla"/>
1146         </condition>
1147     </target>
1148     <target depends="-get-browser" if="do.display.browser.cl" name="-display-browser-cl">
1149         <fail unless="browser">
1150                     Browser not found, cannot launch the deployed application. Try to set the BROWSER environment variable.
1151                 </fail>
1152         <property name="browse.url" value="${deploy.ant.client.url}${client.urlPart}"/>
1153         <echo>Launching ${browse.url}</echo>
1154         <exec executable="${browser}" spawn="true">
1155             <arg line="${browser.args} ${browse.url}"/>
1156         </exec>
1157     </target>
1158     <target depends="init,-init-cos,compile-single" name="run-main">
1159         <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
1160         <webproject1:java classname="${run.class}"/>
1161     </target>
1162     <target depends="init,compile-test-single,-pre-test-run-single" name="run-test-with-main">
1163         <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
1164         <webproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
1165     </target>
1166     <target depends="init" if="netbeans.home" name="-do-update-breakpoints">
1167         <webproject1:nbjpdaappreloaded/>
1168     </target>
1169     <!--
1170                 DEBUGGING SECTION
1171             -->
1172     <target depends="init,-init-cos,compile,compile-jsps,-do-compile-single-jsp,-pre-dist,-do-tmp-dist-with-manifest,-do-tmp-dist-without-manifest" description="Debug project in IDE." if="netbeans.home" name="debug">
1173         <nbstartserver debugmode="true"/>
1174         <antcall target="connect-debugger"/>
1175         <nbdeploy clientUrlPart="${client.urlPart}" debugmode="true" forceRedeploy="true"/>
1176         <antcall target="debug-display-browser-old"/>
1177         <antcall target="debug-display-browser"/>
1178         <antcall target="connect-client-debugger"/>
1179     </target>
1180     <target if="do.debug.server" name="connect-debugger" unless="is.debugged">
1181         <condition property="listeningcp" value="sourcepath">
1182             <istrue value="${j2ee.compile.on.save}"/>
1183         </condition>
1184         <nbjpdaconnect address="${jpda.address}" host="${jpda.host}" listeningcp="${listeningcp}" name="${name}" transport="${jpda.transport}">
1185             <classpath>
1186                 <path path="${debug.classpath}:${j2ee.platform.classpath}"/>
1187             </classpath>
1188             <sourcepath>
1189                 <path path="${web.docbase.dir}"/>
1190             </sourcepath>
1191         </nbjpdaconnect>
1192     </target>
1193     <target if="do.display.browser.debug.old" name="debug-display-browser-old">
1194         <nbbrowse url="${client.url}"/>
1195     </target>
1196     <target if="do.display.browser.debug" name="debug-display-browser">
1197         <nbbrowse context="${browser.context}" url="${client.url}" urlPath="${client.urlPart}"/>
1198     </target>
1199     <target if="do.debug.client" name="connect-client-debugger">
1200         <webproject1:nbjsdebugstart webUrl="${client.url}"/>
1201     </target>
1202     <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
1203         <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
1204         <webproject1:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
1205     </target>
1206     <target depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/>
1207     <target depends="init,compile,compile-jsps,-do-compile-single-jsp,debug" if="netbeans.home" name="debug-single"/>
1208     <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">
1209         <webproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/>
1210     </target>
1211     <target depends="init" if="netbeans.home" name="-debug-start-debugger">
1212         <webproject1:nbjpdastart name="${debug.class}"/>
1213     </target>
1214     <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">
1215         <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
1216         <webproject1:debug classname="${debug.class}"/>
1217     </target>
1218     <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single-main"/>
1219     <target depends="init" name="-pre-debug-fix">
1220         <fail unless="fix.includes">Must set fix.includes</fail>
1221         <property name="javac.includes" value="${fix.includes}.java"/>
1222     </target>
1223     <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
1224         <webproject1:nbjpdareload/>
1225     </target>
1226     <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
1227     <!--
1228             =================
1229             PROFILING SECTION
1230             =================
1231             -->
1232     <!--
1233                 pre NB7.2 profiling section; consider it deprecated
1234             -->
1235     <target description="Profile a J2EE project in the IDE." if="profiler.info.jvmargs.agent" name="-profile-pre72">
1236         <condition else="start-profiled-server" property="profiler.startserver.target" value="start-profiled-server-extraargs">
1237             <isset property="profiler.info.jvmargs.extra"/>
1238         </condition>
1239         <antcall target="${profiler.startserver.target}"/>
1240         <antcall target="run"/>
1241         <antcall target="-profile-start-loadgen"/>
1242     </target>
1243     <target if="profiler.info.jvmargs.agent" name="start-profiled-server">
1244         <nbstartprofiledserver forceRestart="${profiler.j2ee.serverForceRestart}" javaPlatform="${profiler.info.javaPlatform}" startupTimeout="${profiler.j2ee.serverStartupTimeout}">
1245             <jvmarg value="${profiler.info.jvmargs.agent}"/>
1246             <jvmarg value="${profiler.j2ee.agentID}"/>
1247         </nbstartprofiledserver>
1248     </target>
1249     <target if="profiler.info.jvmargs.agent" name="start-profiled-server-extraargs">
1250         <nbstartprofiledserver forceRestart="${profiler.j2ee.serverForceRestart}" javaPlatform="${profiler.info.javaPlatform}" startupTimeout="${profiler.j2ee.serverStartupTimeout}">
1251             <jvmarg value="${profiler.info.jvmargs.extra}"/>
1252             <jvmarg value="${profiler.info.jvmargs.agent}"/>
1253             <jvmarg value="${profiler.j2ee.agentID}"/>
1254         </nbstartprofiledserver>
1255     </target>
1256     <target depends="profile-init,compile-test-single" if="profiler.info.jvmargs.agent" name="-profile-test-single-pre72">
1257         <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
1258         <nbprofiledirect>
1259             <classpath>
1260                 <path path="${run.test.classpath}"/>
1261                 <path path="${j2ee.platform.classpath}"/>
1262             </classpath>
1263         </nbprofiledirect>
1264         <junit dir="${profiler.info.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" jvm="${profiler.info.jvm}" showoutput="true">
1265             <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
1266             <jvmarg value="${profiler.info.jvmargs.agent}"/>
1267             <jvmarg line="${profiler.info.jvmargs}"/>
1268             <test name="${profile.class}"/>
1269             <classpath>
1270                 <path path="${run.test.classpath}"/>
1271                 <path path="${j2ee.platform.classpath}"/>
1272             </classpath>
1273             <syspropertyset>
1274                 <propertyref prefix="test-sys-prop."/>
1275                 <mapper from="test-sys-prop.*" to="*" type="glob"/>
1276             </syspropertyset>
1277             <formatter type="brief" usefile="false"/>
1278             <formatter type="xml"/>
1279         </junit>
1280     </target>
1281     <target if="netbeans.home" name="-profile-check">
1282         <condition property="profiler.configured">
1283             <or>
1284                 <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-agentpath:"/>
1285                 <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-javaagent:"/>
1286             </or>
1287         </condition>
1288     </target>
1289     <target depends="init,-init-cos,compile,compile-jsps,-do-compile-single-jsp,-pre-dist,-do-tmp-dist-with-manifest,-do-tmp-dist-without-manifest" name="-do-profile">
1290         <startprofiler/>
1291         <nbstartserver profilemode="true"/>
1292         <nbdeploy clientUrlPart="${client.urlPart}" forceRedeploy="true" profilemode="true"/>
1293         <antcall target="debug-display-browser-old"/>
1294         <antcall target="debug-display-browser"/>
1295         <antcall target="-profile-start-loadgen"/>
1296     </target>
1297     <target depends="-profile-check,-profile-pre72" description="Profile a J2EE project in the IDE." if="profiler.configured" name="profile" unless="profiler.info.jvmargs.agent">
1298         <antcall target="-do-profile"/>
1299     </target>
1300     <target depends="-profile-test-single-pre72" name="profile-test-single"/>
1301     <target depends="-profile-check" if="profiler.configured" name="profile-test" unless="profiler.info.jvmargs.agent">
1302         <startprofiler/>
1303         <antcall target="test-single"/>
1304     </target>
1305     <target if="profiler.loadgen.path" name="-profile-start-loadgen">
1306         <loadgenstart path="${profiler.loadgen.path}"/>
1307     </target>
1308     <!--
1309                 JAVADOC SECTION
1310             -->
1311     <target depends="init" if="have.sources" name="javadoc-build">
1312         <mkdir dir="${dist.javadoc.dir}"/>
1313         <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}">
1314             <classpath>
1315                 <path path="${javac.classpath}:${j2ee.platform.classpath}"/>
1316             </classpath>
1317             <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
1318                 <filename name="**/*.java"/>
1319             </fileset>
1320             <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
1321                 <include name="**/*.java"/>
1322             </fileset>
1323         </javadoc>
1324         <copy todir="${dist.javadoc.dir}">
1325             <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
1326                 <filename name="**/doc-files/**"/>
1327             </fileset>
1328             <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
1329                 <include name="**/doc-files/**"/>
1330             </fileset>
1331         </copy>
1332     </target>
1333     <target depends="init,javadoc-build" if="netbeans.home" name="javadoc-browse" unless="no.javadoc.preview">
1334         <nbbrowse file="${dist.javadoc.dir}/index.html"/>
1335     </target>
1336     <target depends="init,javadoc-build,javadoc-browse" description="Build Javadoc." name="javadoc"/>
1337     <!--
1338                 
1339                 TEST COMPILATION SECTION
1340             -->
1341     <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
1342         <mkdir dir="${build.test.classes.dir}"/>
1343         <property name="j2ee.platform.embeddableejb.classpath" value=""/>
1344     </target>
1345     <target name="-pre-compile-test">
1346         <!-- Empty placeholder for easier customization. -->
1347         <!-- You can override this target in the ../build.xml file. -->
1348     </target>
1349     <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test" if="have.tests" name="-do-compile-test">
1350         <webproject2:javac classpath="${javac.test.classpath}:${j2ee.platform.classpath}:${j2ee.platform.embeddableejb.classpath}" debug="true" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
1351         <copy todir="${build.test.classes.dir}">
1352             <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
1353         </copy>
1354     </target>
1355     <target name="-post-compile-test">
1356         <!-- Empty placeholder for easier customization. -->
1357         <!-- You can override this target in the ../build.xml file. -->
1358     </target>
1359     <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
1360     <target name="-pre-compile-test-single">
1361         <!-- Empty placeholder for easier customization. -->
1362         <!-- You can override this target in the ../build.xml file. -->
1363     </target>
1364     <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
1365         <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
1366         <webproject2:javac classpath="${javac.test.classpath}:${j2ee.platform.classpath}:${j2ee.platform.embeddableejb.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" srcdir="${test.src.dir}"/>
1367         <copy todir="${build.test.classes.dir}">
1368             <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
1369         </copy>
1370     </target>
1371     <target name="-post-compile-test-single">
1372         <!-- Empty placeholder for easier customization. -->
1373         <!-- You can override this target in the ../build.xml file. -->
1374     </target>
1375     <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
1376     <!--
1377                 
1378                 TEST EXECUTION SECTION
1379             -->
1380     <target depends="init" if="have.tests" name="-pre-test-run">
1381         <mkdir dir="${build.test.results.dir}"/>
1382     </target>
1383     <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
1384         <webproject2:test includes="${includes}" testincludes="**/*Test.java"/>
1385     </target>
1386     <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
1387         <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
1388     </target>
1389     <target depends="init" if="have.tests" name="test-report"/>
1390     <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
1391     <target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/>
1392     <target depends="init" if="have.tests" name="-pre-test-run-single">
1393         <mkdir dir="${build.test.results.dir}"/>
1394     </target>
1395     <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
1396         <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
1397         <webproject2:test excludes="" includes="${test.includes}" testincludes="${test.includes}"/>
1398     </target>
1399     <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
1400         <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
1401     </target>
1402     <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"/>
1403     <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single-method">
1404         <fail unless="test.class">Must select some files in the IDE or set test.class</fail>
1405         <fail unless="test.method">Must select some method in the IDE or set test.method</fail>
1406         <webproject2:test excludes="" includes="${javac.includes}" testincludes="${test.class}" testmethods="${test.method}"/>
1407     </target>
1408     <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single-method" if="have.tests" name="-post-test-run-single-method">
1409         <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
1410     </target>
1411     <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"/>
1412     <!--
1413                 
1414                 TEST DEBUGGING SECTION
1415             -->
1416     <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test">
1417         <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
1418         <webproject2:test-debug excludes="" includes="${javac.includes}" testClass="${test.class}" testincludes="${javac.includes}"/>
1419     </target>
1420     <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test-method">
1421         <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
1422         <fail unless="test.method">Must select some method in the IDE or set test.method</fail>
1423         <webproject2:test-debug excludes="" includes="${javac.includes}" testClass="${test.class}" testMethod="${test.method}" testincludes="${test.class}" testmethods="${test.method}"/>
1424     </target>
1425     <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
1426         <webproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
1427     </target>
1428     <target depends="init,compile-test,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
1429     <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test-method" name="debug-test-method"/>
1430     <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
1431         <webproject1:nbjpdareload dir="${build.test.classes.dir}"/>
1432     </target>
1433     <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
1434     <!--
1435                 
1436                 CLEANUP SECTION
1437             -->
1438     <target depends="init" name="deps-clean" unless="no.deps">
1439         <ant antfile="${project.jjobs-lib}/build.xml" inheritall="false" target="clean"/>
1440     </target>
1441     <target depends="init" name="do-clean">
1442         <condition property="build.dir.to.clean" value="${build.web.dir}">
1443             <isset property="dist.ear.dir"/>
1444         </condition>
1445         <property name="build.dir.to.clean" value="${build.web.dir}"/>
1446         <delete includeEmptyDirs="true" quiet="true">
1447             <fileset dir="${build.dir.to.clean}/WEB-INF/lib"/>
1448         </delete>
1449         <delete dir="${build.dir}"/>
1450         <available file="${build.dir.to.clean}/WEB-INF/lib" property="status.clean-failed" type="dir"/>
1451         <delete dir="${dist.dir}"/>
1452     </target>
1453     <target depends="do-clean" if="status.clean-failed" name="check-clean">
1454         <echo message="Warning: unable to delete some files in ${build.web.dir}/WEB-INF/lib - they are probably locked by the J2EE server. "/>
1455         <echo level="info" message="To delete all files undeploy the module from Server Registry in Runtime tab and then use Clean again."/>
1456     </target>
1457     <target depends="init" if="netbeans.home" name="undeploy-clean">
1458         <nbundeploy failOnError="false" startServer="false"/>
1459     </target>
1460     <target name="-post-clean">
1461         <!-- Empty placeholder for easier customization. -->
1462         <!-- You can override this target in the ../build.xml file. -->
1463     </target>
1464     <target depends="init,undeploy-clean,deps-clean,do-clean,check-clean,-post-clean" description="Clean build products." name="clean"/>
1465     <target depends="clean" description="Clean build products." name="clean-ear"/>
1466 </project>