]> git.mxchange.org Git - jjobs.git/blob - nbproject/build-impl.xml
b9ad2a4817076758c2164d0ed5396d500eb0c370
[jjobs.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
9   - initialization
10   - compilation
11   - dist
12   - execution
13   - debugging
14   - cleanup
15
16 -->
17 <project xmlns:ear2="http://www.netbeans.org/ns/j2ee-earproject/2" basedir=".." default="default" name="jjobs-impl">
18     <import file="ant-deploy.xml"/>
19     <fail message="Please build using Ant 1.7.1 or higher.">
20         <condition>
21             <not>
22                 <antversion atleast="1.7.1"/>
23             </not>
24         </condition>
25     </fail>
26     <target depends="dist" description="Build whole project." name="default"/>
27     <!-- 
28     INITIALIZATION SECTION 
29     -->
30     <target name="pre-init">
31         <!-- Empty placeholder for easier customization. -->
32         <!-- You can override this target in the ../build.xml file. -->
33     </target>
34     <target depends="pre-init" name="init-private">
35         <property file="nbproject/private/private.properties"/>
36     </target>
37     <target depends="pre-init,init-private" name="init-userdir">
38         <property location="${netbeans.user}/build.properties" name="user.properties.file"/>
39     </target>
40     <target depends="pre-init,init-private,init-userdir" name="init-user">
41         <property file="${user.properties.file}"/>
42     </target>
43     <target depends="pre-init,init-private,init-userdir,init-user" name="init-project">
44         <property file="nbproject/project.properties"/>
45     </target>
46     <target depends="pre-init,init-private,init-userdir,init-user,init-project" name="do-init">
47         <!-- The two properties below are usually overridden -->
48         <!-- by the active platform. Just a fallback. -->
49         <property name="default.javac.source" value="1.4"/>
50         <property name="default.javac.target" value="1.4"/>
51         <condition property="do.compile.jsps">
52             <istrue value="${compile.jsps}"/>
53         </condition>
54         <condition property="do.display.browser.old">
55             <and>
56                 <istrue value="${display.browser}"/>
57                 <isset property="client.module.uri"/>
58                 <not>
59                     <isset property="app.client"/>
60                 </not>
61                 <not>
62                     <isset property="browser.context"/>
63                 </not>
64             </and>
65         </condition>
66         <condition property="do.display.browser">
67             <and>
68                 <istrue value="${display.browser}"/>
69                 <isset property="client.module.uri"/>
70                 <not>
71                     <isset property="app.client"/>
72                 </not>
73                 <isset property="browser.context"/>
74             </and>
75         </condition>
76         <available file="${meta.inf}/MANIFEST.MF" property="has.custom.manifest"/>
77         <!--
78                     Variables needed to support directory deployment.
79                 -->
80         <condition property="do.package.with.custom.manifest.not.directory.deploy">
81             <and>
82                 <isset property="has.custom.manifest"/>
83                 <isfalse value="${directory.deployment.supported}"/>
84             </and>
85         </condition>
86         <condition property="do.package.without.custom.manifest.not.directory.deploy">
87             <and>
88                 <not>
89                     <isset property="has.custom.manifest"/>
90                 </not>
91                 <isfalse value="${directory.deployment.supported}"/>
92             </and>
93         </condition>
94         <condition property="do.package.not.directory.deploy">
95             <isfalse value="${directory.deployment.supported}"/>
96         </condition>
97         <!--End Variables needed to support directory deployment.-->
98         <condition else="" property="j2ee.appclient.mainclass.tool.param" value="-mainclass ${main.class}">
99             <and>
100                 <isset property="main.class"/>
101                 <not>
102                     <equals arg1="${main.class}" arg2="" trim="true"/>
103                 </not>
104             </and>
105         </condition>
106         <condition else="" property="j2ee.appclient.jvmoptions.param" value="${j2ee.appclient.jvmoptions}">
107             <and>
108                 <isset property="j2ee.appclient.jvmoptions"/>
109                 <not>
110                     <equals arg1="${j2ee.appclient.jvmoptions}" arg2="" trim="true"/>
111                 </not>
112             </and>
113         </condition>
114         <condition else="" property="application.args.param" value="${application.args}">
115             <and>
116                 <isset property="application.args"/>
117                 <not>
118                     <equals arg1="${application.args}" arg2="" trim="true"/>
119                 </not>
120             </and>
121         </condition>
122         <condition property="can.debug.appclient">
123             <and>
124                 <isset property="netbeans.home"/>
125                 <isset property="app.client"/>
126             </and>
127         </condition>
128         <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
129         <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
130             <and>
131                 <isset property="endorsed.classpath"/>
132                 <length length="0" string="${endorsed.classpath}" when="greater"/>
133             </and>
134         </condition>
135     </target>
136     <target depends="init" name="-init-cos">
137         <condition else="false" property="build.deploy.on.save">
138             <or>
139                 <istrue value="${j2ee.deploy.on.save}"/>
140                 <istrue value="${j2ee.compile.on.save}"/>
141             </or>
142         </condition>
143     </target>
144     <target name="post-init">
145         <!-- Empty placeholder for easier customization. -->
146         <!-- You can override this target in the ../build.xml file. -->
147     </target>
148     <target depends="pre-init,init-private,init-userdir,init-user,init-project,do-init" name="init-check">
149         <fail unless="build.dir">Must set build.dir</fail>
150         <fail unless="build.generated.dir">Must set build.generated.dir</fail>
151         <fail unless="dist.dir">Must set dist.dir</fail>
152         <fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
153         <fail unless="dist.jar">Must set dist.jar</fail>
154     </target>
155     <target name="-init-taskdefs">
156         <fail unless="libs.CopyLibs.classpath">
157 The libs.CopyLibs.classpath property is not set up.
158 This property must point to 
159 org-netbeans-modules-java-j2seproject-copylibstask.jar file which is part
160 of NetBeans IDE installation and is usually located at 
161 &lt;netbeans_installation&gt;/java&lt;version&gt;/ant/extra folder.
162 Either open the project in the IDE and make sure CopyLibs library
163 exists or setup the property manually. For example like this:
164  ant -Dlibs.CopyLibs.classpath=a/path/to/org-netbeans-modules-java-j2seproject-copylibstask.jar
165                 </fail>
166         <taskdef classpath="${libs.CopyLibs.classpath}" resource="org/netbeans/modules/java/j2seproject/copylibstask/antlib.xml"/>
167     </target>
168     <!--
169                 pre NB7.2 profiling section; consider it deprecated
170             -->
171     <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-check" if="profiler.info.jvmargs.agent" name="profile-init"/>
172     <target if="profiler.info.jvmargs.agent" name="-profile-pre-init">
173         <!-- Empty placeholder for easier customization. -->
174         <!-- You can override this target in the ../build.xml file. -->
175     </target>
176     <target if="profiler.info.jvmargs.agent" name="-profile-post-init">
177         <!-- Empty placeholder for easier customization. -->
178         <!-- You can override this target in the ../build.xml file. -->
179     </target>
180     <target depends="-profile-pre-init, init, -profile-post-init" if="profiler.info.jvmargs.agent" name="-profile-init-check">
181         <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail>
182         <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
183     </target>
184     <!--
185                 end of pre NB7.2 profiling section
186             -->
187     <target depends="pre-init,init-private,init-userdir,init-user,init-project,do-init,post-init,init-check,-init-taskdefs" name="init"/>
188     <!--
189     COMPILATION SECTION
190     -->
191     <target depends="init" name="deps-jar" unless="no.deps">
192         <condition property="build.deploy.on.save" value="false">
193             <not>
194                 <isset property="build.deploy.on.save"/>
195             </not>
196         </condition>
197     </target>
198     <target depends="init" name="deps-j2ee-archive" unless="no.deps">
199         <condition property="build.deploy.on.save" value="false">
200             <not>
201                 <isset property="build.deploy.on.save"/>
202             </not>
203         </condition>
204         <ant antfile="${project.addressbook-ejb}/build.xml" inheritall="false" target="dist-ear">
205             <property location="${build.dir}" name="dist.ear.dir"/>
206             <property name="deploy.on.save" value="${build.deploy.on.save}"/>
207         </ant>
208         <ant antfile="${project.jcontacts-ejb}/build.xml" inheritall="false" target="dist-ear">
209             <property location="${build.dir}" name="dist.ear.dir"/>
210             <property name="deploy.on.save" value="${build.deploy.on.save}"/>
211         </ant>
212         <ant antfile="${project.jcore-logger-ejb}/build.xml" inheritall="false" target="dist-ear">
213             <property location="${build.dir}" name="dist.ear.dir"/>
214             <property name="deploy.on.save" value="${build.deploy.on.save}"/>
215         </ant>
216         <ant antfile="${project.jjobs-ejb}/build.xml" inheritall="false" target="dist-ear">
217             <property location="${build.dir}" name="dist.ear.dir"/>
218             <property name="deploy.on.save" value="${build.deploy.on.save}"/>
219         </ant>
220         <ant antfile="${project.jletter-ejb}/build.xml" inheritall="false" target="dist-ear">
221             <property location="${build.dir}" name="dist.ear.dir"/>
222             <property name="deploy.on.save" value="${build.deploy.on.save}"/>
223         </ant>
224         <ant antfile="${project.juser-ejb}/build.xml" inheritall="false" target="dist-ear">
225             <property location="${build.dir}" name="dist.ear.dir"/>
226             <property name="deploy.on.save" value="${build.deploy.on.save}"/>
227         </ant>
228     </target>
229     <target depends="init,deps-jar,deps-j2ee-archive" name="pre-pre-compile"/>
230     <target name="pre-compile">
231         <!-- Empty placeholder for easier customization. -->
232         <!-- You can override this target in the ../build.xml file. -->
233     </target>
234     <target depends="init,deps-jar,pre-pre-compile,pre-compile,-do-compile-deps" name="do-compile">
235         <copy todir="${build.dir}/META-INF">
236             <fileset dir="${meta.inf}"/>
237         </copy>
238     </target>
239     <target depends="init,deps-jar,pre-pre-compile,pre-compile" name="-do-compile-deps">
240         <copyfiles files="${reference.addressbook-ejb.dist-ear}" todir="${build.dir}//"/>
241         <copyfiles files="${reference.jcontacts-ejb.dist-ear}" todir="${build.dir}//"/>
242         <copyfiles files="${reference.jcore-logger-ejb.dist-ear}" todir="${build.dir}//"/>
243         <copyfiles files="${reference.juser-ejb.dist-ear}" todir="${build.dir}//"/>
244         <copyfiles files="${reference.jletter-ejb.dist-ear}" todir="${build.dir}//"/>
245         <copyfiles files="${reference.jjobs-ejb.dist-ear}" todir="${build.dir}//"/>
246     </target>
247     <target name="post-compile">
248         <!-- Empty placeholder for easier customization. -->
249         <!-- You can override this target in the ../build.xml file. -->
250     </target>
251     <target depends="init,deps-jar,pre-pre-compile,pre-compile,do-compile,post-compile" description="Compile project." name="compile"/>
252     <!--
253                 DIST BUILDING SECTION
254             -->
255     <target name="pre-dist">
256         <!-- Empty placeholder for easier customization. -->
257         <!-- You can override this target in the ../build.xml file. -->
258     </target>
259     <target depends="init,compile,pre-dist" name="do-dist-without-manifest" unless="has.custom.manifest">
260         <dirname file="${dist.jar}" property="dist.jar.dir"/>
261         <mkdir dir="${dist.jar.dir}"/>
262         <jar compress="${jar.compress}" jarfile="${dist.jar}">
263             <fileset dir="${build.dir}"/>
264         </jar>
265     </target>
266     <target depends="init,compile,pre-dist" if="has.custom.manifest" name="do-dist-with-manifest">
267         <dirname file="${dist.jar}" property="dist.jar.dir"/>
268         <mkdir dir="${dist.jar.dir}"/>
269         <jar compress="${jar.compress}" jarfile="${dist.jar}" manifest="${meta.inf}/MANIFEST.MF">
270             <fileset dir="${build.dir}"/>
271         </jar>
272     </target>
273     <!--
274                 TARGETS NEEDED TO SUPPORT DIRECTORY DEPLOYMENT
275             -->
276     <target depends="init,compile,pre-dist" if="do.package.without.custom.manifest.not.directory.deploy" name="-do-tmp-dist-without-manifest">
277         <dirname file="${dist.jar}" property="dist.jar.dir"/>
278         <mkdir dir="${dist.jar.dir}"/>
279         <jar compress="${jar.compress}" jarfile="${dist.jar}">
280             <fileset dir="${build.dir}"/>
281         </jar>
282     </target>
283     <target depends="init,compile,pre-dist" if="do.package.with.custom.manifest.not.directory.deploy" name="-do-tmp-dist-with-manifest">
284         <dirname file="${dist.jar}" property="dist.jar.dir"/>
285         <mkdir dir="${dist.jar.dir}"/>
286         <jar compress="${jar.compress}" jarfile="${dist.jar}" manifest="${meta.inf}/MANIFEST.MF">
287             <fileset dir="${build.dir}"/>
288         </jar>
289     </target>
290     <target depends="init,compile,pre-dist,-do-tmp-dist-without-manifest,-do-tmp-dist-with-manifest" name="-do-dist-directory-deploy"/>
291     <target depends="init,compile,pre-dist,-do-dist-directory-deploy,post-dist" description="Build distribution (JAR) - if directory deployment is not supported." name="dist-directory-deploy"/>
292     <!--
293                 END TARGETS NEEDED TO SUPPORT DIRECTORY DEPLOYMENT
294             -->
295     <target name="post-dist">
296         <!-- Empty placeholder for easier customization. -->
297         <!-- You can override this target in the ../build.xml file. -->
298     </target>
299     <target depends="init,compile,pre-dist,do-dist-without-manifest,do-dist-with-manifest,post-dist" description="Build distribution (JAR)." name="dist"/>
300     <!--
301     EXECUTION SECTION
302     -->
303     <target depends="run-deploy,run-display-browser,run-ac" description="Deploy to server." name="run"/>
304     <target name="pre-run-deploy">
305         <!-- Empty placeholder for easier customization. -->
306         <!-- You can override this target in the ../build.xml file. -->
307     </target>
308     <target name="post-run-deploy">
309         <!-- Empty placeholder for easier customization. -->
310         <!-- You can override this target in the ../build.xml file. -->
311     </target>
312     <target name="-pre-nbmodule-run-deploy">
313         <!-- Empty placeholder for easier customization. -->
314         <!-- This target can be overriden by NetBeans modules. Don't override it directly, use -pre-run-deploy task instead. -->
315     </target>
316     <target name="-post-nbmodule-run-deploy">
317         <!-- Empty placeholder for easier customization. -->
318         <!-- This target can be overriden by NetBeans modules. Don't override it directly, use -post-run-deploy task instead. -->
319     </target>
320     <target name="-run-deploy-am" unless="no.deps">
321         <!-- Task to deploy to the Access Manager runtime. -->
322         <ant antfile="${project.addressbook-ejb}/build.xml" inheritall="false" target="-run-deploy-am"/>
323         <ant antfile="${project.jcontacts-ejb}/build.xml" inheritall="false" target="-run-deploy-am"/>
324         <ant antfile="${project.jcore-logger-ejb}/build.xml" inheritall="false" target="-run-deploy-am"/>
325         <ant antfile="${project.jjobs-ejb}/build.xml" inheritall="false" target="-run-deploy-am"/>
326         <ant antfile="${project.jletter-ejb}/build.xml" inheritall="false" target="-run-deploy-am"/>
327         <ant antfile="${project.juser-ejb}/build.xml" inheritall="false" target="-run-deploy-am"/>
328     </target>
329     <target depends="-init-cos,dist-directory-deploy,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" name="run-deploy"/>
330     <target if="netbeans.home" name="-run-deploy-nb">
331         <nbdeploy clientModuleUri="${client.module.uri}" clientUrlPart="${client.urlPart}" debugmode="false" forceRedeploy="${forceRedeploy}"/>
332     </target>
333     <target name="-init-deploy-ant" unless="netbeans.home">
334         <property name="deploy.ant.archive" value="${dist.jar}"/>
335         <property name="deploy.ant.resource.dir" value="${resource.dir}"/>
336         <property name="deploy.ant.enabled" value="true"/>
337     </target>
338     <target depends="dist,-run-undeploy-nb,-init-deploy-ant,-undeploy-ant" name="run-undeploy"/>
339     <target if="netbeans.home" name="-run-undeploy-nb">
340         <fail message="Undeploy is not supported from within the IDE"/>
341     </target>
342     <target depends="dist" name="verify">
343         <nbverify file="${dist.jar}"/>
344     </target>
345     <target depends="run-deploy,-init-display-browser,-display-browser-nb-old,-display-browser-nb,-display-browser-cl" name="run-display-browser"/>
346     <target if="do.display.browser" name="-init-display-browser">
347         <condition property="do.display.browser.nb.old">
348             <and>
349                 <isset property="netbeans.home"/>
350                 <not>
351                     <isset property="browser.context"/>
352                 </not>
353             </and>
354         </condition>
355         <condition property="do.display.browser.nb">
356             <and>
357                 <isset property="netbeans.home"/>
358                 <isset property="browser.context"/>
359             </and>
360         </condition>
361         <condition property="do.display.browser.cl">
362             <and>
363                 <isset property="deploy.ant.enabled"/>
364                 <isset property="deploy.ant.client.url"/>
365             </and>
366         </condition>
367     </target>
368     <target if="do.display.browser.nb.old" name="-display-browser-nb-old">
369         <nbbrowse url="${client.url}"/>
370     </target>
371     <target if="do.display.browser.nb" name="-display-browser-nb">
372         <nbbrowse context="${browser.context}" url="${client.url}" urlPath="${client.urlPart}"/>
373     </target>
374     <target if="do.display.browser.cl" name="-get-browser" unless="browser">
375         <condition property="browser" value="rundll32">
376             <os family="windows"/>
377         </condition>
378         <condition else="" property="browser.args" value="url.dll,FileProtocolHandler">
379             <os family="windows"/>
380         </condition>
381         <condition property="browser" value="/usr/bin/open">
382             <os family="mac"/>
383         </condition>
384         <property environment="env"/>
385         <condition property="browser" value="${env.BROWSER}">
386             <isset property="env.BROWSER"/>
387         </condition>
388         <condition property="browser" value="/usr/bin/firefox">
389             <available file="/usr/bin/firefox"/>
390         </condition>
391         <condition property="browser" value="/usr/local/firefox/firefox">
392             <available file="/usr/local/firefox/firefox"/>
393         </condition>
394         <condition property="browser" value="/usr/bin/mozilla">
395             <available file="/usr/bin/mozilla"/>
396         </condition>
397         <condition property="browser" value="/usr/local/mozilla/mozilla">
398             <available file="/usr/local/mozilla/mozilla"/>
399         </condition>
400         <condition property="browser" value="/usr/sfw/lib/firefox/firefox">
401             <available file="/usr/sfw/lib/firefox/firefox"/>
402         </condition>
403         <condition property="browser" value="/opt/csw/bin/firefox">
404             <available file="/opt/csw/bin/firefox"/>
405         </condition>
406         <condition property="browser" value="/usr/sfw/lib/mozilla/mozilla">
407             <available file="/usr/sfw/lib/mozilla/mozilla"/>
408         </condition>
409         <condition property="browser" value="/opt/csw/bin/mozilla">
410             <available file="/opt/csw/bin/mozilla"/>
411         </condition>
412     </target>
413     <target depends="-get-browser" if="do.display.browser.cl" name="-display-browser-cl">
414         <fail unless="browser">
415             Browser not found, cannot launch the deployed application. Try to set the BROWSER environment variable.
416         </fail>
417         <property name="browse.url" value="${deploy.ant.client.url}${client.urlPart}"/>
418         <echo>Launching ${browse.url}</echo>
419         <exec executable="${browser}" spawn="true">
420             <arg line="${browser.args} ${browse.url}"/>
421         </exec>
422     </target>
423     <target if="app.client" name="run-ac">
424         <antcall target="-run-ac"/>
425     </target>
426     <target depends="init,-as-retrieve-option-workaround,-init-run-macros,-run-appclient-pregfv3,-run-appclient" name="-run-ac"/>
427     <target if="j2ee.appclient.tool.args" name="-run-appclient-pregfv3">
428         <ear2:run-appclient-pregfv3/>
429     </target>
430     <target name="-run-appclient" unless="j2ee.appclient.tool.args">
431         <ear2:run-appclient subprojectname="${app.client}"/>
432     </target>
433     <target if="j2ee.appclient.mainclass.args" name="-as-retrieve-option-workaround" unless="j2ee.clientName">
434         <property name="client.jar" value="${dist.dir}/jjobsClient.jar"/>
435         <sleep seconds="3"/>
436         <copy failonerror="false" file="${wa.copy.client.jar.from}/jjobs/jjobsClient.jar" todir="${dist.dir}"/>
437         <copy failonerror="false" flatten="true" todir="${dist.dir}/">
438             <fileset dir="${wa.copy.client.jar.from}/jjobs" includes="**/jjobsClient.jar"/>
439         </copy>
440         <copy flatten="true" todir="${dist.dir}/jjobsClient">
441             <fileset dir="${wa.copy.client.jar.from}/jjobs" includes="**/*.*ar"/>
442         </copy>
443         <copy failonerror="false" flatten="false" todir="${dist.dir}/jjobsClient">
444             <fileset dir="${dist.dir}/gfdeploy/jjobs" includes="**/*.jar"/>
445         </copy>
446     </target>
447     <target depends="init" name="-init-run-macros">
448         <macrodef name="run-appclient" uri="http://www.netbeans.org/ns/j2ee-earproject/2">
449             <attribute name="subprojectname"/>
450             <attribute default="${application.args.param}" name="args"/>
451             <element name="customize" optional="true"/>
452             <sequential>
453                 <java dir="${basedir}" fork="true" jar="${client.jar}">
454                     <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
455                     <jvmarg line="${j2ee.appclient.tool.jvmoptions}${client.jar},arg=-name,arg=@{subprojectname}"/>
456                     <jvmarg line="${j2ee.appclient.jvmoptions.param}"/>
457                     <arg line="@{args}"/>
458                     <syspropertyset>
459                         <propertyref prefix="run-sys-prop."/>
460                         <mapper from="run-sys-prop.*" to="*" type="glob"/>
461                     </syspropertyset>
462                     <customize/>
463                 </java>
464             </sequential>
465         </macrodef>
466         <macrodef name="run-appclient-pregfv3" uri="http://www.netbeans.org/ns/j2ee-earproject/2">
467             <element name="customize" optional="true"/>
468             <sequential>
469                 <java classname="${j2ee.appclient.tool.mainclass}" fork="true">
470                     <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
471                     <jvmarg line="${j2ee.appclient.tool.jvmoptions}"/>
472                     <jvmarg line="${j2ee.appclient.jvmoptions.param}"/>
473                     <arg line="${j2ee.appclient.tool.args}"/>
474                     <arg line="-client ${client.jar}"/>
475                     <arg line="${j2ee.appclient.mainclass.tool.param}"/>
476                     <arg line="${application.args.param}"/>
477                     <classpath>
478                         <path path="${j2ee.platform.classpath}:${j2ee.appclient.tool.runtime}"/>
479                     </classpath>
480                     <syspropertyset>
481                         <propertyref prefix="run-sys-prop."/>
482                         <mapper from="run-sys-prop.*" to="*" type="glob"/>
483                     </syspropertyset>
484                     <customize/>
485                 </java>
486             </sequential>
487         </macrodef>
488     </target>
489     <!--
490     DEBUGGING SECTION
491     -->
492     <target depends="run-debug,run-debug-appclient" description="Deploy to server." name="debug"/>
493     <target depends="dist" description="Debug project in IDE." if="netbeans.home" name="run-debug" unless="app.client">
494         <nbdeploy clientModuleUri="${client.module.uri}" clientUrlPart="${client.urlPart}" debugmode="true"/>
495         <antcall target="connect-debugger"/>
496         <antcall target="debug-display-browser-old"/>
497         <antcall target="debug-display-browser"/>
498     </target>
499     <target name="connect-debugger" unless="is.debugged">
500         <condition property="listeningcp" value="sourcepath">
501             <istrue value="${j2ee.compile.on.save}"/>
502         </condition>
503         <nbjpdaconnect address="${jpda.address}" host="${jpda.host}" listeningcp="${listeningcp}" name="${jpda.host}:${jpda.address}" transport="${jpda.transport}">
504             <classpath>
505                 <path path="${debug.classpath}"/>
506                 <fileset dir="${build.dir}" includes="lib/*.jar"/>
507             </classpath>
508             <sourcepath>
509                 <path path="${ear.docbase.dirs}"/>
510             </sourcepath>
511         </nbjpdaconnect>
512     </target>
513     <target if="do.display.browser.old" name="debug-display-browser-old">
514         <nbbrowse url="${client.url}"/>
515     </target>
516     <target if="do.display.browser" name="debug-display-browser">
517         <nbbrowse context="${browser.context}" url="${client.url}" urlPath="${client.urlPart}"/>
518     </target>
519     <target if="can.debug.appclient" name="run-debug-appclient">
520         <antcall target="-run-debug-appclient"/>
521     </target>
522     <target depends="init,-init-debug-args,-debug-appclient-deploy,-as-retrieve-option-workaround,-init-debug-macros,-debug-appclient-start-nbjpda,-debug-appclient-pregfv3,-debug-appclient,connect-debugger" name="-run-debug-appclient"/>
523     <target name="-init-debug-args">
524         <property name="version-output" value="java version &quot;${ant.java.version}"/>
525         <condition property="have-jdk-older-than-1.4">
526             <or>
527                 <contains string="${version-output}" substring="java version &quot;1.0"/>
528                 <contains string="${version-output}" substring="java version &quot;1.1"/>
529                 <contains string="${version-output}" substring="java version &quot;1.2"/>
530                 <contains string="${version-output}" substring="java version &quot;1.3"/>
531             </or>
532         </condition>
533         <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
534             <istrue value="${have-jdk-older-than-1.4}"/>
535         </condition>
536     </target>
537     <target depends="init,-init-debug-args,-as-retrieve-option-workaround,-init-run-macros" name="-init-debug-macros">
538         <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
539             <os family="windows"/>
540         </condition>
541         <condition else="${debug-transport-by-os}" property="debug-transport-appclient" value="${debug.transport}">
542             <isset property="debug.transport"/>
543         </condition>
544         <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2ee-earproject/2">
545             <attribute default="${main.class}" name="name"/>
546             <attribute default="${debug.classpath}" name="classpath"/>
547             <attribute default="" name="stopclassname"/>
548             <sequential>
549                 <nbjpdastart addressproperty="jpda.address.appclient" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport-appclient}">
550                     <classpath>
551                         <path path="@{classpath}"/>
552                     </classpath>
553                 </nbjpdastart>
554             </sequential>
555         </macrodef>
556         <macrodef name="debug-appclient" uri="http://www.netbeans.org/ns/j2ee-earproject/2">
557             <attribute name="subprojectname"/>
558             <sequential>
559                 <ear2:run-appclient subprojectname="@{subprojectname}">
560                     <customize>
561                         <jvmarg value="-Xrunjdwp:transport=${debug-transport-appclient},address=${jpda.address.appclient}"/>
562                         <jvmarg line="${debug-args-line}"/>
563                     </customize>
564                 </ear2:run-appclient>
565             </sequential>
566         </macrodef>
567         <macrodef name="debug-appclient-pregfv3" uri="http://www.netbeans.org/ns/j2ee-earproject/2">
568             <sequential>
569                 <ear2:run-appclient-pregfv3>
570                     <customize>
571                         <jvmarg value="-Xrunjdwp:transport=${debug-transport-appclient},address=${jpda.address.appclient}"/>
572                         <jvmarg line="${debug-args-line}"/>
573                     </customize>
574                 </ear2:run-appclient-pregfv3>
575             </sequential>
576         </macrodef>
577     </target>
578     <target name="-debug-appclient-deploy">
579         <nbstartserver debugmode="true"/>
580         <nbdeploy clientModuleUri="${client.module.uri}" clientUrlPart="${client.urlPart}" debugmode="true"/>
581     </target>
582     <target name="-debug-appclient-start-nbjpda">
583         <ear2:nbjpdastart classpath="" name="${app.client}"/>
584     </target>
585     <target if="j2ee.appclient.tool.args" name="-debug-appclient-pregfv3">
586         <ear2:debug-appclient-pregfv3/>
587     </target>
588     <target name="-debug-appclient" unless="j2ee.appclient.tool.args">
589         <ear2:debug-appclient subprojectname="${app.client}"/>
590     </target>
591     <!--
592     =================
593     PROFILING SECTION
594     =================
595     -->
596     <!--
597         pre NB7.2 profiling section; consider it deprecated
598     -->
599     <target description="Profile a J2EE project in the IDE." if="profiler.info.jvmargs.agent" name="-profile-pre72">
600         <condition else="start-profiled-server" property="profiler.startserver.target" value="start-profiled-server-extraargs">
601             <isset property="profiler.info.jvmargs.extra"/>
602         </condition>
603         <antcall target="${profiler.startserver.target}"/>
604         <antcall target="run"/>
605         <antcall target="-profile-start-loadgen"/>
606     </target>
607     <target name="start-profiled-server">
608         <nbstartprofiledserver forceRestart="${profiler.j2ee.serverForceRestart}" javaPlatform="${profiler.info.javaPlatform}" startupTimeout="${profiler.j2ee.serverStartupTimeout}">
609             <jvmarg value="${profiler.info.jvmargs.agent}"/>
610             <jvmarg value="${profiler.j2ee.agentID}"/>
611         </nbstartprofiledserver>
612     </target>
613     <target name="start-profiled-server-extraargs">
614         <nbstartprofiledserver forceRestart="${profiler.j2ee.serverForceRestart}" javaPlatform="${profiler.info.javaPlatform}" startupTimeout="${profiler.j2ee.serverStartupTimeout}">
615             <jvmarg value="${profiler.info.jvmargs.extra}"/>
616             <jvmarg value="${profiler.info.jvmargs.agent}"/>
617             <jvmarg value="${profiler.j2ee.agentID}"/>
618         </nbstartprofiledserver>
619     </target>
620     <!--
621         end of pre NB7.2 profiling section
622     -->
623     <target if="netbeans.home" name="-profile-check">
624         <condition property="profiler.configured">
625             <or>
626                 <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-agentpath:"/>
627                 <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-javaagent:"/>
628             </or>
629         </condition>
630     </target>
631     <target depends="dist" name="-do-profile">
632         <startprofiler/>
633         <nbstartserver profilemode="true"/>
634         <nbdeploy clientUrlPart="${client.urlPart}" forceRedeploy="true" profilemode="true"/>
635         <antcall target="-profile-start-loadgen"/>
636     </target>
637     <target depends="-profile-check,-profile-pre72" description="Profile a J2EE project in the IDE." if="profiler.configured" name="profile">
638         <antcall target="-do-profile"/>
639     </target>
640     <target if="profiler.loadgen.path" name="-profile-start-loadgen">
641         <loadgenstart path="${profiler.loadgen.path}"/>
642     </target>
643     <!--
644     CLEANUP SECTION
645     -->
646     <target depends="init" name="deps-clean" unless="no.deps">
647         <condition property="build.deploy.on.save" value="false">
648             <not>
649                 <isset property="build.deploy.on.save"/>
650             </not>
651         </condition>
652         <ant antfile="${project.addressbook-ejb}/build.xml" inheritall="false" target="clean-ear">
653             <property location="${build.dir}" name="dist.ear.dir"/>
654             <property name="deploy.on.save" value="${build.deploy.on.save}"/>
655         </ant>
656         <ant antfile="${project.jcontacts-ejb}/build.xml" inheritall="false" target="clean-ear">
657             <property location="${build.dir}" name="dist.ear.dir"/>
658             <property name="deploy.on.save" value="${build.deploy.on.save}"/>
659         </ant>
660         <ant antfile="${project.jcore-logger-ejb}/build.xml" inheritall="false" target="clean-ear">
661             <property location="${build.dir}" name="dist.ear.dir"/>
662             <property name="deploy.on.save" value="${build.deploy.on.save}"/>
663         </ant>
664         <ant antfile="${project.jjobs-ejb}/build.xml" inheritall="false" target="clean-ear">
665             <property location="${build.dir}" name="dist.ear.dir"/>
666             <property name="deploy.on.save" value="${build.deploy.on.save}"/>
667         </ant>
668         <ant antfile="${project.jletter-ejb}/build.xml" inheritall="false" target="clean-ear">
669             <property location="${build.dir}" name="dist.ear.dir"/>
670             <property name="deploy.on.save" value="${build.deploy.on.save}"/>
671         </ant>
672         <ant antfile="${project.juser-ejb}/build.xml" inheritall="false" target="clean-ear">
673             <property location="${build.dir}" name="dist.ear.dir"/>
674             <property name="deploy.on.save" value="${build.deploy.on.save}"/>
675         </ant>
676     </target>
677     <target depends="init" name="do-clean">
678         <delete dir="${build.dir}"/>
679         <delete dir="${dist.dir}"/>
680         <delete dir="${build.dir}"/>
681     </target>
682     <target depends="init" if="netbeans.home" name="undeploy-clean">
683         <nbundeploy failOnError="false" startServer="false"/>
684     </target>
685     <target name="post-clean">
686         <!-- Empty placeholder for easier customization. -->
687         <!-- You can override this target in the ../build.xml file. -->
688     </target>
689     <target depends="init,undeploy-clean,deps-clean,do-clean,post-clean" description="Clean build products." name="clean"/>
690 </project>