java/nekurak.net-web/nbproject/build-impl.xml
author František Kučera <franta-hg@frantovo.cz>
Sat, 19 Dec 2009 18:17:39 +0100
changeset 0 b85f351aa5e5
child 6 e6581bb3c4a3
permissions -rw-r--r--
Založen projekt v Netbeans + první J2EE stránka.
     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         - junit compilation
    15         - junit execution
    16         - junit 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="nekurak.net-web-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">
   109             <and>
   110                 <isset property="do.display.browser"/>
   111                 <not>
   112                     <isset property="do.debug.client"/>
   113                 </not>
   114             </and>
   115         </condition>
   116         <available file="${conf.dir}/MANIFEST.MF" property="has.custom.manifest"/>
   117         <available file="${persistence.xml.dir}/persistence.xml" property="has.persistence.xml"/>
   118         <condition property="do.war.package.with.custom.manifest">
   119             <isset property="has.custom.manifest"/>
   120         </condition>
   121         <condition property="do.war.package.without.custom.manifest">
   122             <not>
   123                 <isset property="has.custom.manifest"/>
   124             </not>
   125         </condition>
   126         <condition property="do.tmp.war.package.with.custom.manifest">
   127             <and>
   128                 <isset property="has.custom.manifest"/>
   129                 <isfalse value="${directory.deployment.supported}"/>
   130             </and>
   131         </condition>
   132         <condition property="do.tmp.war.package.without.custom.manifest">
   133             <and>
   134                 <not>
   135                     <isset property="has.custom.manifest"/>
   136                 </not>
   137                 <isfalse value="${directory.deployment.supported}"/>
   138             </and>
   139         </condition>
   140         <condition property="do.tmp.war.package">
   141             <isfalse value="${directory.deployment.supported}"/>
   142         </condition>
   143         <property name="build.meta.inf.dir" value="${build.web.dir}/META-INF"/>
   144         <condition else="" property="application.args.param" value="${application.args}">
   145             <and>
   146                 <isset property="application.args"/>
   147                 <not>
   148                     <equals arg1="${application.args}" arg2="" trim="true"/>
   149                 </not>
   150             </and>
   151         </condition>
   152         <property name="source.encoding" value="${file.encoding}"/>
   153         <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
   154             <and>
   155                 <isset property="javadoc.encoding"/>
   156                 <not>
   157                     <equals arg1="${javadoc.encoding}" arg2=""/>
   158                 </not>
   159             </and>
   160         </condition>
   161         <property name="javadoc.encoding.used" value="${source.encoding}"/>
   162         <property name="includes" value="**"/>
   163         <property name="excludes" value=""/>
   164         <condition else="" property="javac.compilerargs.jaxws" value="-Djava.endorsed.dirs='${jaxws.endorsed.dir}'">
   165             <and>
   166                 <isset property="jaxws.endorsed.dir"/>
   167                 <available file="nbproject/jaxws-build.xml"/>
   168             </and>
   169         </condition>
   170         <property name="runmain.jvmargs" value=""/>
   171     </target>
   172     <target depends="init" name="-init-cos" unless="deploy.on.save">
   173         <condition property="deploy.on.save" value="true">
   174             <istrue value="${j2ee.deploy.on.save}"/>
   175         </condition>
   176     </target>
   177     <target name="-post-init">
   178         <!-- Empty placeholder for easier customization. -->
   179         <!-- You can override this target in the ../build.xml file. -->
   180     </target>
   181     <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init" name="-init-check">
   182         <fail unless="src.dir">Must set src.dir</fail>
   183         <fail unless="test.src.dir">Must set test.src.dir</fail>
   184         <fail unless="build.dir">Must set build.dir</fail>
   185         <fail unless="build.web.dir">Must set build.web.dir</fail>
   186         <fail unless="build.generated.dir">Must set build.generated.dir</fail>
   187         <fail unless="dist.dir">Must set dist.dir</fail>
   188         <fail unless="build.classes.dir">Must set build.classes.dir</fail>
   189         <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
   190         <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
   191         <fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
   192         <fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
   193         <fail unless="dist.war">Must set dist.war</fail>
   194         <fail unless="j2ee.platform.classpath">
   195 The Java EE server classpath is not correctly set up. Your active server type is ${j2ee.server.type}.
   196 Either open the project in the IDE and assign the server or setup the server classpath manually.
   197 For example like this:
   198    ant -Duser.properties.file=&lt;path_to_property_file&gt; (where you put the property "j2ee.platform.classpath" in a .properties file)
   199 or ant -Dj2ee.platform.classpath=&lt;server_classpath&gt; (where no properties file is used)
   200                 </fail>
   201     </target>
   202     <target name="-init-macrodef-property">
   203         <macrodef name="property" uri="http://www.netbeans.org/ns/web-project/1">
   204             <attribute name="name"/>
   205             <attribute name="value"/>
   206             <sequential>
   207                 <property name="@{name}" value="${@{value}}"/>
   208             </sequential>
   209         </macrodef>
   210     </target>
   211     <target name="-init-macrodef-javac">
   212         <macrodef name="javac" uri="http://www.netbeans.org/ns/web-project/2">
   213             <attribute default="${src.dir}" name="srcdir"/>
   214             <attribute default="${build.classes.dir}" name="destdir"/>
   215             <attribute default="${javac.classpath}:${j2ee.platform.classpath}" name="classpath"/>
   216             <attribute default="${includes}" name="includes"/>
   217             <attribute default="${excludes}" name="excludes"/>
   218             <attribute default="${javac.debug}" name="debug"/>
   219             <attribute default="${empty.dir}" name="gensrcdir"/>
   220             <element name="customize" optional="true"/>
   221             <sequential>
   222                 <property location="${build.dir}/empty" name="empty.dir"/>
   223                 <mkdir dir="${empty.dir}"/>
   224                 <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}">
   225                     <src>
   226                         <dirset dir="@{gensrcdir}" erroronmissingdir="false">
   227                             <include name="*"/>
   228                         </dirset>
   229                     </src>
   230                     <classpath>
   231                         <path path="@{classpath}"/>
   232                     </classpath>
   233                     <compilerarg line="${javac.compilerargs} ${javac.compilerargs.jaxws}"/>
   234                     <customize/>
   235                 </javac>
   236             </sequential>
   237         </macrodef>
   238     </target>
   239     <target name="-init-macrodef-junit">
   240         <macrodef name="junit" uri="http://www.netbeans.org/ns/web-project/2">
   241             <attribute default="${includes}" name="includes"/>
   242             <attribute default="${excludes}" name="excludes"/>
   243             <attribute default="**" name="testincludes"/>
   244             <sequential>
   245                 <junit dir="${basedir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true">
   246                     <batchtest todir="${build.test.results.dir}">
   247                         <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
   248                             <filename name="@{testincludes}"/>
   249                         </fileset>
   250                     </batchtest>
   251                     <classpath>
   252                         <path path="${run.test.classpath}:${j2ee.platform.classpath}"/>
   253                     </classpath>
   254                     <syspropertyset>
   255                         <propertyref prefix="test-sys-prop."/>
   256                         <mapper from="test-sys-prop.*" to="*" type="glob"/>
   257                     </syspropertyset>
   258                     <formatter type="brief" usefile="false"/>
   259                     <formatter type="xml"/>
   260                     <jvmarg line="${runmain.jvmargs}"/>
   261                 </junit>
   262             </sequential>
   263         </macrodef>
   264     </target>
   265     <target name="-init-macrodef-java">
   266         <macrodef name="java" uri="http://www.netbeans.org/ns/web-project/1">
   267             <attribute default="${main.class}" name="classname"/>
   268             <attribute default="${debug.classpath}" name="classpath"/>
   269             <element name="customize" optional="true"/>
   270             <sequential>
   271                 <java classname="@{classname}" fork="true">
   272                     <jvmarg line="${runmain.jvmargs}"/>
   273                     <classpath>
   274                         <path path="@{classpath}:${j2ee.platform.classpath}"/>
   275                     </classpath>
   276                     <syspropertyset>
   277                         <propertyref prefix="run-sys-prop."/>
   278                         <mapper from="run-sys-prop.*" to="*" type="glob"/>
   279                     </syspropertyset>
   280                     <customize/>
   281                 </java>
   282             </sequential>
   283         </macrodef>
   284     </target>
   285     <target name="-init-macrodef-nbjsdebug">
   286         <macrodef name="nbjsdebugstart" uri="http://www.netbeans.org/ns/web-project/1">
   287             <attribute default="${client.url}" name="webUrl"/>
   288             <sequential>
   289                 <nbjsdebugstart urlPart="${client.urlPart}" webUrl="@{webUrl}"/>
   290             </sequential>
   291         </macrodef>
   292     </target>
   293     <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
   294         <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/web-project/1">
   295             <attribute default="${main.class}" name="name"/>
   296             <attribute default="${debug.classpath}:${j2ee.platform.classpath}" name="classpath"/>
   297             <sequential>
   298                 <nbjpdastart addressproperty="jpda.address" name="@{name}" transport="${debug-transport}">
   299                     <classpath>
   300                         <path path="@{classpath}"/>
   301                     </classpath>
   302                 </nbjpdastart>
   303             </sequential>
   304         </macrodef>
   305         <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/web-project/1">
   306             <attribute default="${build.classes.dir}" name="dir"/>
   307             <sequential>
   308                 <nbjpdareload>
   309                     <fileset dir="@{dir}" includes="${fix.classes}">
   310                         <include name="${fix.includes}*.class"/>
   311                     </fileset>
   312                 </nbjpdareload>
   313             </sequential>
   314         </macrodef>
   315         <macrodef name="nbjpdaappreloaded" uri="http://www.netbeans.org/ns/web-project/1">
   316             <sequential>
   317                 <nbjpdaappreloaded/>
   318             </sequential>
   319         </macrodef>
   320     </target>
   321     <target name="-init-debug-args">
   322         <property name="version-output" value="java version &quot;${ant.java.version}"/>
   323         <condition property="have-jdk-older-than-1.4">
   324             <or>
   325                 <contains string="${version-output}" substring="java version &quot;1.0"/>
   326                 <contains string="${version-output}" substring="java version &quot;1.1"/>
   327                 <contains string="${version-output}" substring="java version &quot;1.2"/>
   328                 <contains string="${version-output}" substring="java version &quot;1.3"/>
   329             </or>
   330         </condition>
   331         <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
   332             <istrue value="${have-jdk-older-than-1.4}"/>
   333         </condition>
   334         <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
   335             <os family="windows"/>
   336         </condition>
   337         <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}">
   338             <isset property="debug.transport"/>
   339         </condition>
   340     </target>
   341     <target depends="-init-debug-args" name="-init-macrodef-debug">
   342         <macrodef name="debug" uri="http://www.netbeans.org/ns/web-project/1">
   343             <attribute default="${main.class}" name="classname"/>
   344             <attribute default="${debug.classpath}:${j2ee.platform.classpath}" name="classpath"/>
   345             <attribute default="${application.args.param}" name="args"/>
   346             <element name="customize" optional="true"/>
   347             <sequential>
   348                 <java classname="@{classname}" fork="true">
   349                     <jvmarg line="${debug-args-line}"/>
   350                     <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
   351                     <jvmarg line="${runmain.jvmargs}"/>
   352                     <classpath>
   353                         <path path="@{classpath}"/>
   354                     </classpath>
   355                     <syspropertyset>
   356                         <propertyref prefix="run-sys-prop."/>
   357                         <mapper from="run-sys-prop.*" to="*" type="glob"/>
   358                     </syspropertyset>
   359                     <arg line="@{args}"/>
   360                     <customize/>
   361                 </java>
   362             </sequential>
   363         </macrodef>
   364     </target>
   365     <target name="-init-taskdefs">
   366         <fail unless="libs.CopyLibs.classpath">
   367 The libs.CopyLibs.classpath property is not set up.
   368 This property must point to 
   369 org-netbeans-modules-java-j2seproject-copylibstask.jar file which is part
   370 of NetBeans IDE installation and is usually located at 
   371 &lt;netbeans_installation&gt;/java&lt;version&gt;/ant/extra folder.
   372 Either open the project in the IDE and make sure CopyLibs library
   373 exists or setup the property manually. For example like this:
   374  ant -Dlibs.CopyLibs.classpath=a/path/to/org-netbeans-modules-java-j2seproject-copylibstask.jar
   375                 </fail>
   376         <taskdef classpath="${libs.CopyLibs.classpath}" resource="org/netbeans/modules/java/j2seproject/copylibstask/antlib.xml"/>
   377     </target>
   378     <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-junit,-init-macrodef-java,-init-macrodef-nbjpda,-init-macrodef-nbjsdebug,-init-macrodef-debug,-init-taskdefs" name="init"/>
   379     <!--
   380                 COMPILATION SECTION
   381             -->
   382     <target depends="init" if="no.dist.ear.dir" name="deps-module-jar" unless="no.deps"/>
   383     <target depends="init" if="dist.ear.dir" name="deps-ear-jar" unless="no.deps"/>
   384     <target depends="init, deps-module-jar, deps-ear-jar" name="deps-jar" unless="no.deps"/>
   385     <target depends="init,deps-jar" name="-pre-pre-compile">
   386         <mkdir dir="${build.classes.dir}"/>
   387     </target>
   388     <target name="-pre-compile">
   389         <!-- Empty placeholder for easier customization. -->
   390         <!-- You can override this target in the ../build.xml file. -->
   391     </target>
   392     <target name="-copy-webdir">
   393         <copy todir="${build.web.dir}">
   394             <fileset dir="${web.docbase.dir}" excludes="${build.web.excludes},${excludes}" includes="${includes}"/>
   395         </copy>
   396         <copy todir="${build.web.dir}/WEB-INF">
   397             <fileset dir="${webinf.dir}" excludes="${build.web.excludes}"/>
   398         </copy>
   399     </target>
   400     <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">
   401         <webproject2:javac destdir="${build.classes.dir}" gensrcdir="${build.generated.sources.dir}"/>
   402         <copy todir="${build.classes.dir}">
   403             <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
   404         </copy>
   405     </target>
   406     <target if="has.custom.manifest" name="-copy-manifest">
   407         <mkdir dir="${build.meta.inf.dir}"/>
   408         <copy todir="${build.meta.inf.dir}">
   409             <fileset dir="${conf.dir}" includes="MANIFEST.MF"/>
   410         </copy>
   411     </target>
   412     <target if="has.persistence.xml" name="-copy-persistence-xml">
   413         <mkdir dir="${build.web.dir}/WEB-INF/classes/META-INF"/>
   414         <copy todir="${build.web.dir}/WEB-INF/classes/META-INF">
   415             <fileset dir="${persistence.xml.dir}" includes="persistence.xml"/>
   416         </copy>
   417     </target>
   418     <target name="-post-compile">
   419         <!-- Empty placeholder for easier customization. -->
   420         <!-- You can override this target in the ../build.xml file. -->
   421     </target>
   422     <target depends="init,deps-jar,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
   423     <target name="-pre-compile-single">
   424         <!-- Empty placeholder for easier customization. -->
   425         <!-- You can override this target in the ../build.xml file. -->
   426     </target>
   427     <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
   428         <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
   429         <webproject2:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}"/>
   430         <copy todir="${build.classes.dir}">
   431             <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
   432         </copy>
   433     </target>
   434     <target name="-post-compile-single">
   435         <!-- Empty placeholder for easier customization. -->
   436         <!-- You can override this target in the ../build.xml file. -->
   437     </target>
   438     <target depends="init,deps-jar,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
   439     <target depends="compile" description="Test compile JSP pages to expose compilation errors." if="do.compile.jsps" name="compile-jsps">
   440         <mkdir dir="${build.generated.dir}/src"/>
   441         <java classname="org.netbeans.modules.web.project.ant.JspC" failonerror="true" fork="true">
   442             <arg value="-uriroot"/>
   443             <arg file="${basedir}/${build.web.dir}"/>
   444             <arg value="-d"/>
   445             <arg file="${basedir}/${build.generated.dir}/src"/>
   446             <arg value="-die1"/>
   447             <arg value="-compilerSourceVM ${javac.source}"/>
   448             <arg value="-compilerTargetVM ${javac.target}"/>
   449             <arg value="-javaEncoding ${source.encoding}"/>
   450             <classpath path="${java.home}/../lib/tools.jar:${jspctask.classpath}:${jspcompilation.classpath}"/>
   451         </java>
   452         <mkdir dir="${build.generated.dir}/classes"/>
   453         <webproject2:javac classpath="${j2ee.platform.classpath}:${build.classes.dir}:${jspcompilation.classpath}" destdir="${build.generated.dir}/classes" srcdir="${build.generated.dir}/src"/>
   454     </target>
   455     <target depends="compile" if="jsp.includes" name="-do-compile-single-jsp">
   456         <fail unless="javac.jsp.includes">Must select some files in the IDE or set javac.jsp.includes</fail>
   457         <mkdir dir="${build.generated.dir}/src"/>
   458         <java classname="org.netbeans.modules.web.project.ant.JspCSingle" failonerror="true" fork="true">
   459             <arg value="-uriroot"/>
   460             <arg file="${basedir}/${build.web.dir}"/>
   461             <arg value="-d"/>
   462             <arg file="${basedir}/${build.generated.dir}/src"/>
   463             <arg value="-die1"/>
   464             <arg value="-jspc.files"/>
   465             <arg path="${jsp.includes}"/>
   466             <arg value="-compilerSourceVM ${javac.source}"/>
   467             <arg value="-compilerTargetVM ${javac.target}"/>
   468             <arg value="-javaEncoding ${source.encoding}"/>
   469             <classpath path="${java.home}/../lib/tools.jar:${jspctask.classpath}:${jspcompilation.classpath}"/>
   470         </java>
   471         <mkdir dir="${build.generated.dir}/classes"/>
   472         <webproject2:javac classpath="${j2ee.platform.classpath}:${build.classes.dir}:${jspcompilation.classpath}" destdir="${build.generated.dir}/classes" srcdir="${build.generated.dir}/src">
   473             <customize>
   474                 <patternset includes="${javac.jsp.includes}"/>
   475             </customize>
   476         </webproject2:javac>
   477     </target>
   478     <target name="compile-single-jsp">
   479         <fail unless="jsp.includes">Must select a file in the IDE or set jsp.includes</fail>
   480         <antcall target="-do-compile-single-jsp"/>
   481     </target>
   482     <!--
   483                 DIST BUILDING SECTION
   484             -->
   485     <target name="-pre-dist">
   486         <!-- Empty placeholder for easier customization. -->
   487         <!-- You can override this target in the ../build.xml file. -->
   488     </target>
   489     <target depends="init,compile,compile-jsps,-pre-dist" if="do.war.package.without.custom.manifest" name="-do-dist-without-manifest">
   490         <dirname file="${dist.war}" property="dist.jar.dir"/>
   491         <mkdir dir="${dist.jar.dir}"/>
   492         <jar compress="${jar.compress}" jarfile="${dist.war}">
   493             <fileset dir="${build.web.dir}"/>
   494         </jar>
   495     </target>
   496     <target depends="init,compile,compile-jsps,-pre-dist" if="do.war.package.with.custom.manifest" name="-do-dist-with-manifest">
   497         <dirname file="${dist.war}" property="dist.jar.dir"/>
   498         <mkdir dir="${dist.jar.dir}"/>
   499         <jar compress="${jar.compress}" jarfile="${dist.war}" manifest="${build.meta.inf.dir}/MANIFEST.MF">
   500             <fileset dir="${build.web.dir}"/>
   501         </jar>
   502     </target>
   503     <target depends="init,compile,compile-jsps,-pre-dist" if="do.tmp.war.package.without.custom.manifest" name="-do-tmp-dist-without-manifest">
   504         <dirname file="${dist.war}" property="dist.jar.dir"/>
   505         <mkdir dir="${dist.jar.dir}"/>
   506         <jar compress="${jar.compress}" jarfile="${dist.war}">
   507             <fileset dir="${build.web.dir}"/>
   508         </jar>
   509     </target>
   510     <target depends="init,compile,compile-jsps,-pre-dist" if="do.tmp.war.package.with.custom.manifest" name="-do-tmp-dist-with-manifest">
   511         <dirname file="${dist.war}" property="dist.jar.dir"/>
   512         <mkdir dir="${dist.jar.dir}"/>
   513         <jar compress="${jar.compress}" jarfile="${dist.war}" manifest="${build.meta.inf.dir}/MANIFEST.MF">
   514             <fileset dir="${build.web.dir}"/>
   515         </jar>
   516     </target>
   517     <target depends="init,compile,compile-jsps,-pre-dist,-do-dist-with-manifest,-do-dist-without-manifest" name="do-dist"/>
   518     <target depends="init" if="dist.ear.dir" name="library-inclusion-in-manifest">
   519         <mkdir dir="${build.web.dir}/META-INF"/>
   520         <manifest file="${build.web.dir}/META-INF/MANIFEST.MF" mode="update"/>
   521     </target>
   522     <target depends="init" name="library-inclusion-in-archive" unless="dist.ear.dir"/>
   523     <target depends="init,compile,compile-jsps,-pre-dist,library-inclusion-in-manifest" if="do.tmp.war.package" name="do-ear-dist">
   524         <dirname file="${dist.ear.war}" property="dist.jar.dir"/>
   525         <mkdir dir="${dist.jar.dir}"/>
   526         <jar compress="${jar.compress}" jarfile="${dist.ear.war}" manifest="${build.web.dir}/META-INF/MANIFEST.MF">
   527             <fileset dir="${build.web.dir}"/>
   528         </jar>
   529     </target>
   530     <target name="-post-dist">
   531         <!-- Empty placeholder for easier customization. -->
   532         <!-- You can override this target in the ../build.xml file. -->
   533     </target>
   534     <target depends="init,compile,-pre-dist,do-dist,-post-dist" description="Build distribution (WAR)." name="dist"/>
   535     <target depends="init,-init-cos,compile,-pre-dist,do-ear-dist,-post-dist" description="Build distribution (WAR) to be packaged into an EAR." name="dist-ear"/>
   536     <!--
   537                 EXECUTION SECTION
   538             -->
   539     <target depends="run-deploy,run-display-browser" description="Deploy to server and show in browser." name="run"/>
   540     <target name="-pre-run-deploy">
   541         <!-- Empty placeholder for easier customization. -->
   542         <!-- You can override this target in the ../build.xml file. -->
   543     </target>
   544     <target name="-post-run-deploy">
   545         <!-- Empty placeholder for easier customization. -->
   546         <!-- You can override this target in the ../build.xml file. -->
   547     </target>
   548     <target name="-pre-nbmodule-run-deploy">
   549         <!-- Empty placeholder for easier customization. -->
   550         <!-- This target can be overriden by NetBeans modules. Don't override it directly, use -pre-run-deploy task instead. -->
   551     </target>
   552     <target name="-post-nbmodule-run-deploy">
   553         <!-- Empty placeholder for easier customization. -->
   554         <!-- This target can be overriden by NetBeans modules. Don't override it directly, use -post-run-deploy task instead. -->
   555     </target>
   556     <target name="-run-deploy-am">
   557         <!-- Task to deploy to the Access Manager runtime. -->
   558     </target>
   559     <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" name="run-deploy">
   560         <nbjpdaappreloaded/>
   561     </target>
   562     <target if="netbeans.home" name="-run-deploy-nb">
   563         <nbdeploy clientUrlPart="${client.urlPart}" debugmode="false" forceRedeploy="${forceRedeploy}"/>
   564     </target>
   565     <target name="-init-deploy-ant" unless="netbeans.home">
   566         <property name="deploy.ant.archive" value="${dist.war}"/>
   567         <property name="deploy.ant.docbase.dir" value="${web.docbase.dir}"/>
   568         <property name="deploy.ant.resource.dir" value="${resource.dir}"/>
   569         <property name="deploy.ant.enabled" value="true"/>
   570     </target>
   571     <target depends="dist,-run-undeploy-nb,-init-deploy-ant,-undeploy-ant" name="run-undeploy"/>
   572     <target if="netbeans.home" name="-run-undeploy-nb">
   573         <fail message="Undeploy is not supported from within the IDE"/>
   574     </target>
   575     <target depends="init,-pre-dist,dist,-post-dist" name="verify">
   576         <nbverify file="${dist.war}"/>
   577     </target>
   578     <target depends="run-deploy,-init-display-browser,-display-browser-nb,-display-browser-cl" name="run-display-browser"/>
   579     <target if="do.display.browser" name="-init-display-browser">
   580         <condition property="do.display.browser.nb">
   581             <isset property="netbeans.home"/>
   582         </condition>
   583         <condition property="do.display.browser.cl">
   584             <isset property="deploy.ant.enabled"/>
   585         </condition>
   586     </target>
   587     <target if="do.display.browser.nb" name="-display-browser-nb">
   588         <nbbrowse url="${client.url}"/>
   589     </target>
   590     <target if="do.display.browser.cl" name="-get-browser" unless="browser">
   591         <condition property="browser" value="rundll32">
   592             <os family="windows"/>
   593         </condition>
   594         <condition else="" property="browser.args" value="url.dll,FileProtocolHandler">
   595             <os family="windows"/>
   596         </condition>
   597         <condition property="browser" value="/usr/bin/open">
   598             <os family="mac"/>
   599         </condition>
   600         <property environment="env"/>
   601         <condition property="browser" value="${env.BROWSER}">
   602             <isset property="env.BROWSER"/>
   603         </condition>
   604         <condition property="browser" value="/usr/bin/firefox">
   605             <available file="/usr/bin/firefox"/>
   606         </condition>
   607         <condition property="browser" value="/usr/local/firefox/firefox">
   608             <available file="/usr/local/firefox/firefox"/>
   609         </condition>
   610         <condition property="browser" value="/usr/bin/mozilla">
   611             <available file="/usr/bin/mozilla"/>
   612         </condition>
   613         <condition property="browser" value="/usr/local/mozilla/mozilla">
   614             <available file="/usr/local/mozilla/mozilla"/>
   615         </condition>
   616         <condition property="browser" value="/usr/sfw/lib/firefox/firefox">
   617             <available file="/usr/sfw/lib/firefox/firefox"/>
   618         </condition>
   619         <condition property="browser" value="/opt/csw/bin/firefox">
   620             <available file="/opt/csw/bin/firefox"/>
   621         </condition>
   622         <condition property="browser" value="/usr/sfw/lib/mozilla/mozilla">
   623             <available file="/usr/sfw/lib/mozilla/mozilla"/>
   624         </condition>
   625         <condition property="browser" value="/opt/csw/bin/mozilla">
   626             <available file="/opt/csw/bin/mozilla"/>
   627         </condition>
   628     </target>
   629     <target depends="-get-browser" if="do.display.browser.cl" name="-display-browser-cl">
   630         <fail unless="browser">
   631                     Browser not found, cannot launch the deployed application. Try to set the BROWSER environment variable.
   632                 </fail>
   633         <property name="browse.url" value="${deploy.ant.client.url}${client.urlPart}"/>
   634         <echo>Launching ${browse.url}</echo>
   635         <exec executable="${browser}" spawn="true">
   636             <arg line="${browser.args} ${browse.url}"/>
   637         </exec>
   638     </target>
   639     <target depends="init,-init-cos,compile-single" name="run-main">
   640         <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
   641         <webproject1:java classname="${run.class}"/>
   642     </target>
   643     <target depends="init,compile-test-single,-pre-test-run-single" name="run-test-with-main">
   644         <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
   645         <webproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
   646     </target>
   647     <!--
   648                 DEBUGGING SECTION
   649             -->
   650     <target depends="init,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">
   651         <nbstartserver debugmode="true"/>
   652         <antcall target="connect-debugger"/>
   653         <nbdeploy clientUrlPart="${client.urlPart}" debugmode="true" forceRedeploy="true"/>
   654         <antcall target="debug-display-browser"/>
   655         <antcall target="connect-client-debugger"/>
   656     </target>
   657     <target if="do.debug.server" name="connect-debugger" unless="is.debugged">
   658         <nbjpdaconnect address="${jpda.address}" host="${jpda.host}" name="${name}" transport="${jpda.transport}">
   659             <classpath>
   660                 <path path="${debug.classpath}:${j2ee.platform.classpath}"/>
   661             </classpath>
   662             <sourcepath>
   663                 <path path="${web.docbase.dir}"/>
   664             </sourcepath>
   665         </nbjpdaconnect>
   666     </target>
   667     <target if="do.display.browser.debug" name="debug-display-browser">
   668         <nbbrowse url="${client.url}"/>
   669     </target>
   670     <target if="do.debug.client" name="connect-client-debugger">
   671         <webproject1:nbjsdebugstart webUrl="${client.url}"/>
   672     </target>
   673     <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
   674         <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
   675         <webproject1:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
   676     </target>
   677     <target depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/>
   678     <target depends="init,compile,compile-jsps,-do-compile-single-jsp,debug" if="netbeans.home" name="debug-single"/>
   679     <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">
   680         <webproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/>
   681     </target>
   682     <target depends="init" if="netbeans.home" name="-debug-start-debugger">
   683         <webproject1:nbjpdastart name="${debug.class}"/>
   684     </target>
   685     <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">
   686         <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
   687         <webproject1:debug classname="${debug.class}"/>
   688     </target>
   689     <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single-main"/>
   690     <target depends="init" name="-pre-debug-fix">
   691         <fail unless="fix.includes">Must set fix.includes</fail>
   692         <property name="javac.includes" value="${fix.includes}.java"/>
   693     </target>
   694     <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
   695         <webproject1:nbjpdareload/>
   696     </target>
   697     <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
   698     <!--
   699                 JAVADOC SECTION
   700             -->
   701     <target depends="init" name="javadoc-build">
   702         <mkdir dir="${dist.javadoc.dir}"/>
   703         <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}">
   704             <classpath>
   705                 <path path="${javac.classpath}:${j2ee.platform.classpath}"/>
   706             </classpath>
   707             <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
   708                 <filename name="**/*.java"/>
   709             </fileset>
   710             <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
   711                 <include name="**/*.java"/>
   712             </fileset>
   713         </javadoc>
   714     </target>
   715     <target depends="init,javadoc-build" if="netbeans.home" name="javadoc-browse" unless="no.javadoc.preview">
   716         <nbbrowse file="${dist.javadoc.dir}/index.html"/>
   717     </target>
   718     <target depends="init,javadoc-build,javadoc-browse" description="Build Javadoc." name="javadoc"/>
   719     <!--
   720                 
   721                 JUNIT COMPILATION SECTION
   722             -->
   723     <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
   724         <mkdir dir="${build.test.classes.dir}"/>
   725     </target>
   726     <target name="-pre-compile-test">
   727         <!-- Empty placeholder for easier customization. -->
   728         <!-- You can override this target in the ../build.xml file. -->
   729     </target>
   730     <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test" if="have.tests" name="-do-compile-test">
   731         <webproject2:javac classpath="${javac.test.classpath}:${j2ee.platform.classpath}" debug="true" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
   732         <copy todir="${build.test.classes.dir}">
   733             <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
   734         </copy>
   735     </target>
   736     <target name="-post-compile-test">
   737         <!-- Empty placeholder for easier customization. -->
   738         <!-- You can override this target in the ../build.xml file. -->
   739     </target>
   740     <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
   741     <target name="-pre-compile-test-single">
   742         <!-- Empty placeholder for easier customization. -->
   743         <!-- You can override this target in the ../build.xml file. -->
   744     </target>
   745     <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
   746         <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
   747         <webproject2:javac classpath="${javac.test.classpath}:${j2ee.platform.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" srcdir="${test.src.dir}"/>
   748         <copy todir="${build.test.classes.dir}">
   749             <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
   750         </copy>
   751     </target>
   752     <target name="-post-compile-test-single">
   753         <!-- Empty placeholder for easier customization. -->
   754         <!-- You can override this target in the ../build.xml file. -->
   755     </target>
   756     <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
   757     <!--
   758                 
   759                 JUNIT EXECUTION SECTION
   760             -->
   761     <target depends="init" if="have.tests" name="-pre-test-run">
   762         <mkdir dir="${build.test.results.dir}"/>
   763     </target>
   764     <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
   765         <webproject2:junit testincludes="**/*Test.java"/>
   766     </target>
   767     <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
   768         <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
   769     </target>
   770     <target depends="init" if="have.tests" name="test-report"/>
   771     <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
   772     <target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/>
   773     <target depends="init" if="have.tests" name="-pre-test-run-single">
   774         <mkdir dir="${build.test.results.dir}"/>
   775     </target>
   776     <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
   777         <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
   778         <webproject2:junit excludes="" includes="${test.includes}"/>
   779     </target>
   780     <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
   781         <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
   782     </target>
   783     <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"/>
   784     <!--
   785                 
   786                 JUNIT DEBUGGING SECTION
   787             -->
   788     <target depends="init,compile-test" if="have.tests" name="-debug-start-debuggee-test">
   789         <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
   790         <property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/>
   791         <delete file="${test.report.file}"/>
   792         <!-- must exist, otherwise the XML formatter would fail -->
   793         <mkdir dir="${build.test.results.dir}"/>
   794         <webproject1:debug args="${test.class}" classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner" classpath="${ant.home}/lib/ant.jar:${ant.home}/lib/ant-junit.jar:${debug.test.classpath}">
   795             <customize>
   796                 <arg value="showoutput=true"/>
   797                 <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/>
   798                 <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/>
   799             </customize>
   800         </webproject1:debug>
   801     </target>
   802     <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
   803         <webproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
   804     </target>
   805     <target depends="init,compile-test,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
   806     <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
   807         <webproject1:nbjpdareload dir="${build.test.classes.dir}"/>
   808     </target>
   809     <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
   810     <!--
   811                 
   812                 CLEANUP SECTION
   813             -->
   814     <target depends="init" if="no.dist.ear.dir" name="deps-clean" unless="no.deps"/>
   815     <target depends="init" name="do-clean">
   816         <condition property="build.dir.to.clean" value="${build.web.dir}">
   817             <isset property="dist.ear.dir"/>
   818         </condition>
   819         <property name="build.dir.to.clean" value="${build.web.dir}"/>
   820         <delete includeEmptyDirs="true" quiet="true">
   821             <fileset dir="${build.dir.to.clean}/WEB-INF/lib"/>
   822         </delete>
   823         <delete dir="${build.dir}"/>
   824         <available file="${build.dir.to.clean}/WEB-INF/lib" property="status.clean-failed" type="dir"/>
   825         <delete dir="${dist.dir}"/>
   826     </target>
   827     <target depends="do-clean" if="status.clean-failed" name="check-clean">
   828         <echo message="Warning: unable to delete some files in ${build.web.dir}/WEB-INF/lib - they are probably locked by the J2EE server. "/>
   829         <echo level="info" message="To delete all files undeploy the module from Server Registry in Runtime tab and then use Clean again."/>
   830     </target>
   831     <target depends="init" if="netbeans.home" name="undeploy-clean">
   832         <nbundeploy failOnError="false" startServer="false"/>
   833     </target>
   834     <target name="-post-clean">
   835         <!-- Empty placeholder for easier customization. -->
   836         <!-- You can override this target in the ../build.xml file. -->
   837     </target>
   838     <target depends="init,undeploy-clean,deps-clean,do-clean,check-clean,-post-clean" description="Clean build products." name="clean"/>
   839     <target depends="clean" description="Clean build products." name="clean-ear"/>
   840 </project>