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