samples/codeinjection/nbproject/build-impl.xml
author Jaroslav Tulach <jtulach@netbeans.org>
Sat, 10 Jan 2009 21:29:22 +0100
changeset 303 77b6002451c4
child 398 b87fd959548b
permissions -rw-r--r--
Initial version of sample to explain 'code injection'
jtulach@303
     1
<?xml version="1.0" encoding="UTF-8"?>
jtulach@303
     2
<!--
jtulach@303
     3
*** GENERATED FROM project.xml - DO NOT EDIT  ***
jtulach@303
     4
***         EDIT ../build.xml INSTEAD         ***
jtulach@303
     5
jtulach@303
     6
For the purpose of easier reading the script
jtulach@303
     7
is divided into following sections:
jtulach@303
     8
jtulach@303
     9
  - initialization
jtulach@303
    10
  - compilation
jtulach@303
    11
  - jar
jtulach@303
    12
  - execution
jtulach@303
    13
  - debugging
jtulach@303
    14
  - javadoc
jtulach@303
    15
  - junit compilation
jtulach@303
    16
  - junit execution
jtulach@303
    17
  - junit debugging
jtulach@303
    18
  - applet
jtulach@303
    19
  - cleanup
jtulach@303
    20
jtulach@303
    21
        -->
jtulach@303
    22
<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="codeinjection-impl">
jtulach@303
    23
    <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
jtulach@303
    24
    <!-- 
jtulach@303
    25
                ======================
jtulach@303
    26
                INITIALIZATION SECTION 
jtulach@303
    27
                ======================
jtulach@303
    28
            -->
jtulach@303
    29
    <target name="-pre-init">
jtulach@303
    30
        <!-- Empty placeholder for easier customization. -->
jtulach@303
    31
        <!-- You can override this target in the ../build.xml file. -->
jtulach@303
    32
    </target>
jtulach@303
    33
    <target depends="-pre-init" name="-init-private">
jtulach@303
    34
        <property file="nbproject/private/config.properties"/>
jtulach@303
    35
        <property file="nbproject/private/configs/${config}.properties"/>
jtulach@303
    36
        <property file="nbproject/private/private.properties"/>
jtulach@303
    37
    </target>
jtulach@303
    38
    <target depends="-pre-init,-init-private" name="-init-user">
jtulach@303
    39
        <property file="${user.properties.file}"/>
jtulach@303
    40
        <!-- The two properties below are usually overridden -->
jtulach@303
    41
        <!-- by the active platform. Just a fallback. -->
jtulach@303
    42
        <property name="default.javac.source" value="1.4"/>
jtulach@303
    43
        <property name="default.javac.target" value="1.4"/>
jtulach@303
    44
    </target>
jtulach@303
    45
    <target depends="-pre-init,-init-private,-init-user" name="-init-project">
jtulach@303
    46
        <property file="nbproject/configs/${config}.properties"/>
jtulach@303
    47
        <property file="nbproject/project.properties"/>
jtulach@303
    48
    </target>
jtulach@303
    49
    <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init">
jtulach@303
    50
        <available file="${manifest.file}" property="manifest.available"/>
jtulach@303
    51
        <condition property="manifest.available+main.class">
jtulach@303
    52
            <and>
jtulach@303
    53
                <isset property="manifest.available"/>
jtulach@303
    54
                <isset property="main.class"/>
jtulach@303
    55
                <not>
jtulach@303
    56
                    <equals arg1="${main.class}" arg2="" trim="true"/>
jtulach@303
    57
                </not>
jtulach@303
    58
            </and>
jtulach@303
    59
        </condition>
jtulach@303
    60
        <condition property="manifest.available+main.class+mkdist.available">
jtulach@303
    61
            <and>
jtulach@303
    62
                <istrue value="${manifest.available+main.class}"/>
jtulach@303
    63
                <isset property="libs.CopyLibs.classpath"/>
jtulach@303
    64
            </and>
jtulach@303
    65
        </condition>
jtulach@303
    66
        <condition property="have.tests">
jtulach@303
    67
            <or>
jtulach@303
    68
                <available file="${test.src.dir}"/>
jtulach@303
    69
            </or>
jtulach@303
    70
        </condition>
jtulach@303
    71
        <condition property="have.sources">
jtulach@303
    72
            <or>
jtulach@303
    73
                <available file="${src.dir}"/>
jtulach@303
    74
            </or>
jtulach@303
    75
        </condition>
jtulach@303
    76
        <condition property="netbeans.home+have.tests">
jtulach@303
    77
            <and>
jtulach@303
    78
                <isset property="netbeans.home"/>
jtulach@303
    79
                <isset property="have.tests"/>
jtulach@303
    80
            </and>
jtulach@303
    81
        </condition>
jtulach@303
    82
        <condition property="no.javadoc.preview">
jtulach@303
    83
            <and>
jtulach@303
    84
                <isset property="javadoc.preview"/>
jtulach@303
    85
                <isfalse value="${javadoc.preview}"/>
jtulach@303
    86
            </and>
jtulach@303
    87
        </condition>
jtulach@303
    88
        <property name="run.jvmargs" value=""/>
jtulach@303
    89
        <property name="javac.compilerargs" value=""/>
jtulach@303
    90
        <property name="work.dir" value="${basedir}"/>
jtulach@303
    91
        <condition property="no.deps">
jtulach@303
    92
            <and>
jtulach@303
    93
                <istrue value="${no.dependencies}"/>
jtulach@303
    94
            </and>
jtulach@303
    95
        </condition>
jtulach@303
    96
        <property name="javac.debug" value="true"/>
jtulach@303
    97
        <property name="javadoc.preview" value="true"/>
jtulach@303
    98
        <property name="application.args" value=""/>
jtulach@303
    99
        <property name="source.encoding" value="${file.encoding}"/>
jtulach@303
   100
        <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
jtulach@303
   101
            <and>
jtulach@303
   102
                <isset property="javadoc.encoding"/>
jtulach@303
   103
                <not>
jtulach@303
   104
                    <equals arg1="${javadoc.encoding}" arg2=""/>
jtulach@303
   105
                </not>
jtulach@303
   106
            </and>
jtulach@303
   107
        </condition>
jtulach@303
   108
        <property name="javadoc.encoding.used" value="${source.encoding}"/>
jtulach@303
   109
        <property name="includes" value="**"/>
jtulach@303
   110
        <property name="excludes" value=""/>
jtulach@303
   111
        <property name="do.depend" value="false"/>
jtulach@303
   112
        <condition property="do.depend.true">
jtulach@303
   113
            <istrue value="${do.depend}"/>
jtulach@303
   114
        </condition>
jtulach@303
   115
        <condition else="" property="javac.compilerargs.jaxws" value="-Djava.endorsed.dirs='${jaxws.endorsed.dir}'">
jtulach@303
   116
            <and>
jtulach@303
   117
                <isset property="jaxws.endorsed.dir"/>
jtulach@303
   118
                <available file="nbproject/jaxws-build.xml"/>
jtulach@303
   119
            </and>
jtulach@303
   120
        </condition>
jtulach@303
   121
    </target>
jtulach@303
   122
    <target name="-post-init">
jtulach@303
   123
        <!-- Empty placeholder for easier customization. -->
jtulach@303
   124
        <!-- You can override this target in the ../build.xml file. -->
jtulach@303
   125
    </target>
jtulach@303
   126
    <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init" name="-init-check">
jtulach@303
   127
        <fail unless="src.dir">Must set src.dir</fail>
jtulach@303
   128
        <fail unless="test.src.dir">Must set test.src.dir</fail>
jtulach@303
   129
        <fail unless="build.dir">Must set build.dir</fail>
jtulach@303
   130
        <fail unless="dist.dir">Must set dist.dir</fail>
jtulach@303
   131
        <fail unless="build.classes.dir">Must set build.classes.dir</fail>
jtulach@303
   132
        <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
jtulach@303
   133
        <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
jtulach@303
   134
        <fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
jtulach@303
   135
        <fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
jtulach@303
   136
        <fail unless="dist.jar">Must set dist.jar</fail>
jtulach@303
   137
    </target>
jtulach@303
   138
    <target name="-init-macrodef-property">
jtulach@303
   139
        <macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1">
jtulach@303
   140
            <attribute name="name"/>
jtulach@303
   141
            <attribute name="value"/>
jtulach@303
   142
            <sequential>
jtulach@303
   143
                <property name="@{name}" value="${@{value}}"/>
jtulach@303
   144
            </sequential>
jtulach@303
   145
        </macrodef>
jtulach@303
   146
    </target>
jtulach@303
   147
    <target name="-init-macrodef-javac">
jtulach@303
   148
        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
jtulach@303
   149
            <attribute default="${src.dir}" name="srcdir"/>
jtulach@303
   150
            <attribute default="${build.classes.dir}" name="destdir"/>
jtulach@303
   151
            <attribute default="${javac.classpath}" name="classpath"/>
jtulach@303
   152
            <attribute default="${includes}" name="includes"/>
jtulach@303
   153
            <attribute default="${excludes}" name="excludes"/>
jtulach@303
   154
            <attribute default="${javac.debug}" name="debug"/>
jtulach@303
   155
            <attribute default="/does/not/exist" name="sourcepath"/>
jtulach@303
   156
            <element name="customize" optional="true"/>
jtulach@303
   157
            <sequential>
jtulach@303
   158
                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}">
jtulach@303
   159
                    <classpath>
jtulach@303
   160
                        <path path="@{classpath}"/>
jtulach@303
   161
                    </classpath>
jtulach@303
   162
                    <compilerarg line="${javac.compilerargs} ${javac.compilerargs.jaxws}"/>
jtulach@303
   163
                    <customize/>
jtulach@303
   164
                </javac>
jtulach@303
   165
            </sequential>
jtulach@303
   166
        </macrodef>
jtulach@303
   167
        <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
jtulach@303
   168
            <attribute default="${src.dir}" name="srcdir"/>
jtulach@303
   169
            <attribute default="${build.classes.dir}" name="destdir"/>
jtulach@303
   170
            <attribute default="${javac.classpath}" name="classpath"/>
jtulach@303
   171
            <sequential>
jtulach@303
   172
                <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">
jtulach@303
   173
                    <classpath>
jtulach@303
   174
                        <path path="@{classpath}"/>
jtulach@303
   175
                    </classpath>
jtulach@303
   176
                </depend>
jtulach@303
   177
            </sequential>
jtulach@303
   178
        </macrodef>
jtulach@303
   179
        <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-project/3">
jtulach@303
   180
            <attribute default="${build.classes.dir}" name="destdir"/>
jtulach@303
   181
            <sequential>
jtulach@303
   182
                <fail unless="javac.includes">Must set javac.includes</fail>
jtulach@303
   183
                <pathconvert pathsep="," property="javac.includes.binary">
jtulach@303
   184
                    <path>
jtulach@303
   185
                        <filelist dir="@{destdir}" files="${javac.includes}"/>
jtulach@303
   186
                    </path>
jtulach@303
   187
                    <globmapper from="*.java" to="*.class"/>
jtulach@303
   188
                </pathconvert>
jtulach@303
   189
                <delete>
jtulach@303
   190
                    <files includes="${javac.includes.binary}"/>
jtulach@303
   191
                </delete>
jtulach@303
   192
            </sequential>
jtulach@303
   193
        </macrodef>
jtulach@303
   194
    </target>
jtulach@303
   195
    <target name="-init-macrodef-junit">
jtulach@303
   196
        <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
jtulach@303
   197
            <attribute default="${includes}" name="includes"/>
jtulach@303
   198
            <attribute default="${excludes}" name="excludes"/>
jtulach@303
   199
            <attribute default="**" name="testincludes"/>
jtulach@303
   200
            <sequential>
jtulach@303
   201
                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true">
jtulach@303
   202
                    <batchtest todir="${build.test.results.dir}">
jtulach@303
   203
                        <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
jtulach@303
   204
                            <filename name="@{testincludes}"/>
jtulach@303
   205
                        </fileset>
jtulach@303
   206
                    </batchtest>
jtulach@303
   207
                    <classpath>
jtulach@303
   208
                        <path path="${run.test.classpath}"/>
jtulach@303
   209
                    </classpath>
jtulach@303
   210
                    <syspropertyset>
jtulach@303
   211
                        <propertyref prefix="test-sys-prop."/>
jtulach@303
   212
                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
jtulach@303
   213
                    </syspropertyset>
jtulach@303
   214
                    <formatter type="brief" usefile="false"/>
jtulach@303
   215
                    <formatter type="xml"/>
jtulach@303
   216
                    <jvmarg line="${run.jvmargs}"/>
jtulach@303
   217
                </junit>
jtulach@303
   218
            </sequential>
jtulach@303
   219
        </macrodef>
jtulach@303
   220
    </target>
jtulach@303
   221
    <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
jtulach@303
   222
        <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
jtulach@303
   223
            <attribute default="${main.class}" name="name"/>
jtulach@303
   224
            <attribute default="${debug.classpath}" name="classpath"/>
jtulach@303
   225
            <attribute default="" name="stopclassname"/>
jtulach@303
   226
            <sequential>
jtulach@303
   227
                <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport}">
jtulach@303
   228
                    <classpath>
jtulach@303
   229
                        <path path="@{classpath}"/>
jtulach@303
   230
                    </classpath>
jtulach@303
   231
                </nbjpdastart>
jtulach@303
   232
            </sequential>
jtulach@303
   233
        </macrodef>
jtulach@303
   234
        <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1">
jtulach@303
   235
            <attribute default="${build.classes.dir}" name="dir"/>
jtulach@303
   236
            <sequential>
jtulach@303
   237
                <nbjpdareload>
jtulach@303
   238
                    <fileset dir="@{dir}" includes="${fix.classes}">
jtulach@303
   239
                        <include name="${fix.includes}*.class"/>
jtulach@303
   240
                    </fileset>
jtulach@303
   241
                </nbjpdareload>
jtulach@303
   242
            </sequential>
jtulach@303
   243
        </macrodef>
jtulach@303
   244
    </target>
jtulach@303
   245
    <target name="-init-debug-args">
jtulach@303
   246
        <property name="version-output" value="java version &quot;${ant.java.version}"/>
jtulach@303
   247
        <condition property="have-jdk-older-than-1.4">
jtulach@303
   248
            <or>
jtulach@303
   249
                <contains string="${version-output}" substring="java version &quot;1.0"/>
jtulach@303
   250
                <contains string="${version-output}" substring="java version &quot;1.1"/>
jtulach@303
   251
                <contains string="${version-output}" substring="java version &quot;1.2"/>
jtulach@303
   252
                <contains string="${version-output}" substring="java version &quot;1.3"/>
jtulach@303
   253
            </or>
jtulach@303
   254
        </condition>
jtulach@303
   255
        <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
jtulach@303
   256
            <istrue value="${have-jdk-older-than-1.4}"/>
jtulach@303
   257
        </condition>
jtulach@303
   258
        <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
jtulach@303
   259
            <os family="windows"/>
jtulach@303
   260
        </condition>
jtulach@303
   261
        <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}">
jtulach@303
   262
            <isset property="debug.transport"/>
jtulach@303
   263
        </condition>
jtulach@303
   264
    </target>
jtulach@303
   265
    <target depends="-init-debug-args" name="-init-macrodef-debug">
jtulach@303
   266
        <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
jtulach@303
   267
            <attribute default="${main.class}" name="classname"/>
jtulach@303
   268
            <attribute default="${debug.classpath}" name="classpath"/>
jtulach@303
   269
            <element name="customize" optional="true"/>
jtulach@303
   270
            <sequential>
jtulach@303
   271
                <java classname="@{classname}" dir="${work.dir}" fork="true">
jtulach@303
   272
                    <jvmarg line="${debug-args-line}"/>
jtulach@303
   273
                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
jtulach@303
   274
                    <jvmarg line="${run.jvmargs}"/>
jtulach@303
   275
                    <classpath>
jtulach@303
   276
                        <path path="@{classpath}"/>
jtulach@303
   277
                    </classpath>
jtulach@303
   278
                    <syspropertyset>
jtulach@303
   279
                        <propertyref prefix="run-sys-prop."/>
jtulach@303
   280
                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
jtulach@303
   281
                    </syspropertyset>
jtulach@303
   282
                    <customize/>
jtulach@303
   283
                </java>
jtulach@303
   284
            </sequential>
jtulach@303
   285
        </macrodef>
jtulach@303
   286
    </target>
jtulach@303
   287
    <target name="-init-macrodef-java">
jtulach@303
   288
        <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
jtulach@303
   289
            <attribute default="${main.class}" name="classname"/>
jtulach@303
   290
            <attribute default="${run.classpath}" name="classpath"/>
jtulach@303
   291
            <element name="customize" optional="true"/>
jtulach@303
   292
            <sequential>
jtulach@303
   293
                <java classname="@{classname}" dir="${work.dir}" fork="true">
jtulach@303
   294
                    <jvmarg line="${run.jvmargs}"/>
jtulach@303
   295
                    <classpath>
jtulach@303
   296
                        <path path="@{classpath}"/>
jtulach@303
   297
                    </classpath>
jtulach@303
   298
                    <syspropertyset>
jtulach@303
   299
                        <propertyref prefix="run-sys-prop."/>
jtulach@303
   300
                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
jtulach@303
   301
                    </syspropertyset>
jtulach@303
   302
                    <customize/>
jtulach@303
   303
                </java>
jtulach@303
   304
            </sequential>
jtulach@303
   305
        </macrodef>
jtulach@303
   306
    </target>
jtulach@303
   307
    <target name="-init-presetdef-jar">
jtulach@303
   308
        <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
jtulach@303
   309
            <jar compress="${jar.compress}" jarfile="${dist.jar}">
jtulach@303
   310
                <j2seproject1:fileset dir="${build.classes.dir}"/>
jtulach@303
   311
            </jar>
jtulach@303
   312
        </presetdef>
jtulach@303
   313
    </target>
jtulach@303
   314
    <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-junit,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar" name="init"/>
jtulach@303
   315
    <!--
jtulach@303
   316
                ===================
jtulach@303
   317
                COMPILATION SECTION
jtulach@303
   318
                ===================
jtulach@303
   319
            -->
jtulach@303
   320
    <target depends="init" name="deps-jar" unless="no.deps"/>
jtulach@303
   321
    <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
jtulach@303
   322
    <target depends="init" name="-check-automatic-build">
jtulach@303
   323
        <available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/>
jtulach@303
   324
    </target>
jtulach@303
   325
    <target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build">
jtulach@303
   326
        <antcall target="clean"/>
jtulach@303
   327
    </target>
jtulach@303
   328
    <target depends="init,deps-jar" name="-pre-pre-compile">
jtulach@303
   329
        <mkdir dir="${build.classes.dir}"/>
jtulach@303
   330
    </target>
jtulach@303
   331
    <target name="-pre-compile">
jtulach@303
   332
        <!-- Empty placeholder for easier customization. -->
jtulach@303
   333
        <!-- You can override this target in the ../build.xml file. -->
jtulach@303
   334
    </target>
jtulach@303
   335
    <target if="do.depend.true" name="-compile-depend">
jtulach@303
   336
        <j2seproject3:depend/>
jtulach@303
   337
    </target>
jtulach@303
   338
    <target depends="init,deps-jar,-pre-pre-compile,-pre-compile,-compile-depend" if="have.sources" name="-do-compile">
jtulach@303
   339
        <j2seproject3:javac/>
jtulach@303
   340
        <copy todir="${build.classes.dir}">
jtulach@303
   341
            <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
jtulach@303
   342
        </copy>
jtulach@303
   343
    </target>
jtulach@303
   344
    <target name="-post-compile">
jtulach@303
   345
        <!-- Empty placeholder for easier customization. -->
jtulach@303
   346
        <!-- You can override this target in the ../build.xml file. -->
jtulach@303
   347
    </target>
jtulach@303
   348
    <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
jtulach@303
   349
    <target name="-pre-compile-single">
jtulach@303
   350
        <!-- Empty placeholder for easier customization. -->
jtulach@303
   351
        <!-- You can override this target in the ../build.xml file. -->
jtulach@303
   352
    </target>
jtulach@303
   353
    <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
jtulach@303
   354
        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
jtulach@303
   355
        <j2seproject3:force-recompile/>
jtulach@303
   356
        <j2seproject3:javac excludes="" includes="${javac.includes}" sourcepath="${src.dir}"/>
jtulach@303
   357
    </target>
jtulach@303
   358
    <target name="-post-compile-single">
jtulach@303
   359
        <!-- Empty placeholder for easier customization. -->
jtulach@303
   360
        <!-- You can override this target in the ../build.xml file. -->
jtulach@303
   361
    </target>
jtulach@303
   362
    <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
jtulach@303
   363
    <!--
jtulach@303
   364
                ====================
jtulach@303
   365
                JAR BUILDING SECTION
jtulach@303
   366
                ====================
jtulach@303
   367
            -->
jtulach@303
   368
    <target depends="init" name="-pre-pre-jar">
jtulach@303
   369
        <dirname file="${dist.jar}" property="dist.jar.dir"/>
jtulach@303
   370
        <mkdir dir="${dist.jar.dir}"/>
jtulach@303
   371
    </target>
jtulach@303
   372
    <target name="-pre-jar">
jtulach@303
   373
        <!-- Empty placeholder for easier customization. -->
jtulach@303
   374
        <!-- You can override this target in the ../build.xml file. -->
jtulach@303
   375
    </target>
jtulach@303
   376
    <target depends="init,compile,-pre-pre-jar,-pre-jar" name="-do-jar-without-manifest" unless="manifest.available">
jtulach@303
   377
        <j2seproject1:jar/>
jtulach@303
   378
    </target>
jtulach@303
   379
    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class">
jtulach@303
   380
        <j2seproject1:jar manifest="${manifest.file}"/>
jtulach@303
   381
    </target>
jtulach@303
   382
    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class" name="-do-jar-with-mainclass" unless="manifest.available+main.class+mkdist.available">
jtulach@303
   383
        <j2seproject1:jar manifest="${manifest.file}">
jtulach@303
   384
            <j2seproject1:manifest>
jtulach@303
   385
                <j2seproject1:attribute name="Main-Class" value="${main.class}"/>
jtulach@303
   386
            </j2seproject1:manifest>
jtulach@303
   387
        </j2seproject1:jar>
jtulach@303
   388
        <echo>To run this application from the command line without Ant, try:</echo>
jtulach@303
   389
        <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
jtulach@303
   390
        <property location="${dist.jar}" name="dist.jar.resolved"/>
jtulach@303
   391
        <pathconvert property="run.classpath.with.dist.jar">
jtulach@303
   392
            <path path="${run.classpath}"/>
jtulach@303
   393
            <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
jtulach@303
   394
        </pathconvert>
jtulach@303
   395
        <echo>java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
jtulach@303
   396
    </target>
jtulach@303
   397
    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class+mkdist.available" name="-do-jar-with-libraries">
jtulach@303
   398
        <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
jtulach@303
   399
        <pathconvert property="run.classpath.without.build.classes.dir">
jtulach@303
   400
            <path path="${run.classpath}"/>
jtulach@303
   401
            <map from="${build.classes.dir.resolved}" to=""/>
jtulach@303
   402
        </pathconvert>
jtulach@303
   403
        <pathconvert pathsep=" " property="jar.classpath">
jtulach@303
   404
            <path path="${run.classpath.without.build.classes.dir}"/>
jtulach@303
   405
            <chainedmapper>
jtulach@303
   406
                <flattenmapper/>
jtulach@303
   407
                <globmapper from="*" to="lib/*"/>
jtulach@303
   408
            </chainedmapper>
jtulach@303
   409
        </pathconvert>
jtulach@303
   410
        <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
jtulach@303
   411
        <copylibs compress="${jar.compress}" jarfile="${dist.jar}" manifest="${manifest.file}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
jtulach@303
   412
            <fileset dir="${build.classes.dir}"/>
jtulach@303
   413
            <manifest>
jtulach@303
   414
                <attribute name="Main-Class" value="${main.class}"/>
jtulach@303
   415
                <attribute name="Class-Path" value="${jar.classpath}"/>
jtulach@303
   416
            </manifest>
jtulach@303
   417
        </copylibs>
jtulach@303
   418
        <echo>To run this application from the command line without Ant, try:</echo>
jtulach@303
   419
        <property location="${dist.jar}" name="dist.jar.resolved"/>
jtulach@303
   420
        <echo>java -jar "${dist.jar.resolved}"</echo>
jtulach@303
   421
    </target>
jtulach@303
   422
    <target name="-post-jar">
jtulach@303
   423
        <!-- Empty placeholder for easier customization. -->
jtulach@303
   424
        <!-- You can override this target in the ../build.xml file. -->
jtulach@303
   425
    </target>
jtulach@303
   426
    <target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-post-jar" description="Build JAR." name="jar"/>
jtulach@303
   427
    <!--
jtulach@303
   428
                =================
jtulach@303
   429
                EXECUTION SECTION
jtulach@303
   430
                =================
jtulach@303
   431
            -->
jtulach@303
   432
    <target depends="init,compile" description="Run a main class." name="run">
jtulach@303
   433
        <j2seproject1:java>
jtulach@303
   434
            <customize>
jtulach@303
   435
                <arg line="${application.args}"/>
jtulach@303
   436
            </customize>
jtulach@303
   437
        </j2seproject1:java>
jtulach@303
   438
    </target>
jtulach@303
   439
    <target name="-do-not-recompile">
jtulach@303
   440
        <property name="javac.includes.binary" value=""/>
jtulach@303
   441
    </target>
jtulach@303
   442
    <target depends="init,-do-not-recompile,compile-single" name="run-single">
jtulach@303
   443
        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
jtulach@303
   444
        <j2seproject1:java classname="${run.class}"/>
jtulach@303
   445
    </target>
jtulach@303
   446
    <target depends="init,-do-not-recompile,compile-test-single" name="run-test-with-main">
jtulach@303
   447
        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
jtulach@303
   448
        <j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
jtulach@303
   449
    </target>
jtulach@303
   450
    <!--
jtulach@303
   451
                =================
jtulach@303
   452
                DEBUGGING SECTION
jtulach@303
   453
                =================
jtulach@303
   454
            -->
jtulach@303
   455
    <target depends="init" if="netbeans.home" name="-debug-start-debugger">
jtulach@303
   456
        <j2seproject1:nbjpdastart name="${debug.class}"/>
jtulach@303
   457
    </target>
jtulach@303
   458
    <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">
jtulach@303
   459
        <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/>
jtulach@303
   460
    </target>
jtulach@303
   461
    <target depends="init,compile" name="-debug-start-debuggee">
jtulach@303
   462
        <j2seproject3:debug>
jtulach@303
   463
            <customize>
jtulach@303
   464
                <arg line="${application.args}"/>
jtulach@303
   465
            </customize>
jtulach@303
   466
        </j2seproject3:debug>
jtulach@303
   467
    </target>
jtulach@303
   468
    <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/>
jtulach@303
   469
    <target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto">
jtulach@303
   470
        <j2seproject1:nbjpdastart stopclassname="${main.class}"/>
jtulach@303
   471
    </target>
jtulach@303
   472
    <target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/>
jtulach@303
   473
    <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">
jtulach@303
   474
        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
jtulach@303
   475
        <j2seproject3:debug classname="${debug.class}"/>
jtulach@303
   476
    </target>
jtulach@303
   477
    <target depends="init,-do-not-recompile,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
jtulach@303
   478
    <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
jtulach@303
   479
        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
jtulach@303
   480
        <j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
jtulach@303
   481
    </target>
jtulach@303
   482
    <target depends="init,-do-not-recompile,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/>
jtulach@303
   483
    <target depends="init" name="-pre-debug-fix">
jtulach@303
   484
        <fail unless="fix.includes">Must set fix.includes</fail>
jtulach@303
   485
        <property name="javac.includes" value="${fix.includes}.java"/>
jtulach@303
   486
    </target>
jtulach@303
   487
    <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
jtulach@303
   488
        <j2seproject1:nbjpdareload/>
jtulach@303
   489
    </target>
jtulach@303
   490
    <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
jtulach@303
   491
    <!--
jtulach@303
   492
                ===============
jtulach@303
   493
                JAVADOC SECTION
jtulach@303
   494
                ===============
jtulach@303
   495
            -->
jtulach@303
   496
    <target depends="init" name="-javadoc-build">
jtulach@303
   497
        <mkdir dir="${dist.javadoc.dir}"/>
jtulach@303
   498
        <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}">
jtulach@303
   499
            <classpath>
jtulach@303
   500
                <path path="${javac.classpath}"/>
jtulach@303
   501
            </classpath>
jtulach@303
   502
            <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
jtulach@303
   503
                <filename name="**/*.java"/>
jtulach@303
   504
            </fileset>
jtulach@303
   505
        </javadoc>
jtulach@303
   506
    </target>
jtulach@303
   507
    <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
jtulach@303
   508
        <nbbrowse file="${dist.javadoc.dir}/index.html"/>
jtulach@303
   509
    </target>
jtulach@303
   510
    <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
jtulach@303
   511
    <!--
jtulach@303
   512
                =========================
jtulach@303
   513
                JUNIT COMPILATION SECTION
jtulach@303
   514
                =========================
jtulach@303
   515
            -->
jtulach@303
   516
    <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
jtulach@303
   517
        <mkdir dir="${build.test.classes.dir}"/>
jtulach@303
   518
    </target>
jtulach@303
   519
    <target name="-pre-compile-test">
jtulach@303
   520
        <!-- Empty placeholder for easier customization. -->
jtulach@303
   521
        <!-- You can override this target in the ../build.xml file. -->
jtulach@303
   522
    </target>
jtulach@303
   523
    <target if="do.depend.true" name="-compile-test-depend">
jtulach@303
   524
        <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
jtulach@303
   525
    </target>
jtulach@303
   526
    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
jtulach@303
   527
        <j2seproject3:javac classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
jtulach@303
   528
        <copy todir="${build.test.classes.dir}">
jtulach@303
   529
            <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
jtulach@303
   530
        </copy>
jtulach@303
   531
    </target>
jtulach@303
   532
    <target name="-post-compile-test">
jtulach@303
   533
        <!-- Empty placeholder for easier customization. -->
jtulach@303
   534
        <!-- You can override this target in the ../build.xml file. -->
jtulach@303
   535
    </target>
jtulach@303
   536
    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
jtulach@303
   537
    <target name="-pre-compile-test-single">
jtulach@303
   538
        <!-- Empty placeholder for easier customization. -->
jtulach@303
   539
        <!-- You can override this target in the ../build.xml file. -->
jtulach@303
   540
    </target>
jtulach@303
   541
    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
jtulach@303
   542
        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
jtulach@303
   543
        <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
jtulach@303
   544
        <j2seproject3:javac classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" sourcepath="${test.src.dir}" srcdir="${test.src.dir}"/>
jtulach@303
   545
        <copy todir="${build.test.classes.dir}">
jtulach@303
   546
            <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
jtulach@303
   547
        </copy>
jtulach@303
   548
    </target>
jtulach@303
   549
    <target name="-post-compile-test-single">
jtulach@303
   550
        <!-- Empty placeholder for easier customization. -->
jtulach@303
   551
        <!-- You can override this target in the ../build.xml file. -->
jtulach@303
   552
    </target>
jtulach@303
   553
    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
jtulach@303
   554
    <!--
jtulach@303
   555
                =======================
jtulach@303
   556
                JUNIT EXECUTION SECTION
jtulach@303
   557
                =======================
jtulach@303
   558
            -->
jtulach@303
   559
    <target depends="init" if="have.tests" name="-pre-test-run">
jtulach@303
   560
        <mkdir dir="${build.test.results.dir}"/>
jtulach@303
   561
    </target>
jtulach@303
   562
    <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
jtulach@303
   563
        <j2seproject3:junit testincludes="**/*Test.java"/>
jtulach@303
   564
    </target>
jtulach@303
   565
    <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
jtulach@303
   566
        <fail if="tests.failed">Some tests failed; see details above.</fail>
jtulach@303
   567
    </target>
jtulach@303
   568
    <target depends="init" if="have.tests" name="test-report"/>
jtulach@303
   569
    <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
jtulach@303
   570
    <target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/>
jtulach@303
   571
    <target depends="init" if="have.tests" name="-pre-test-run-single">
jtulach@303
   572
        <mkdir dir="${build.test.results.dir}"/>
jtulach@303
   573
    </target>
jtulach@303
   574
    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
jtulach@303
   575
        <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
jtulach@303
   576
        <j2seproject3:junit excludes="" includes="${test.includes}"/>
jtulach@303
   577
    </target>
jtulach@303
   578
    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
jtulach@303
   579
        <fail if="tests.failed">Some tests failed; see details above.</fail>
jtulach@303
   580
    </target>
jtulach@303
   581
    <target depends="init,-do-not-recompile,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/>
jtulach@303
   582
    <!--
jtulach@303
   583
                =======================
jtulach@303
   584
                JUNIT DEBUGGING SECTION
jtulach@303
   585
                =======================
jtulach@303
   586
            -->
jtulach@303
   587
    <target depends="init,compile-test" if="have.tests" name="-debug-start-debuggee-test">
jtulach@303
   588
        <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
jtulach@303
   589
        <property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/>
jtulach@303
   590
        <delete file="${test.report.file}"/>
jtulach@303
   591
        <mkdir dir="${build.test.results.dir}"/>
jtulach@303
   592
        <j2seproject3:debug classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner" classpath="${ant.home}/lib/ant.jar:${ant.home}/lib/ant-junit.jar:${debug.test.classpath}">
jtulach@303
   593
            <customize>
jtulach@303
   594
                <syspropertyset>
jtulach@303
   595
                    <propertyref prefix="test-sys-prop."/>
jtulach@303
   596
                    <mapper from="test-sys-prop.*" to="*" type="glob"/>
jtulach@303
   597
                </syspropertyset>
jtulach@303
   598
                <arg value="${test.class}"/>
jtulach@303
   599
                <arg value="showoutput=true"/>
jtulach@303
   600
                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/>
jtulach@303
   601
                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/>
jtulach@303
   602
            </customize>
jtulach@303
   603
        </j2seproject3:debug>
jtulach@303
   604
    </target>
jtulach@303
   605
    <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
jtulach@303
   606
        <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
jtulach@303
   607
    </target>
jtulach@303
   608
    <target depends="init,-do-not-recompile,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
jtulach@303
   609
    <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
jtulach@303
   610
        <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
jtulach@303
   611
    </target>
jtulach@303
   612
    <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
jtulach@303
   613
    <!--
jtulach@303
   614
                =========================
jtulach@303
   615
                APPLET EXECUTION SECTION
jtulach@303
   616
                =========================
jtulach@303
   617
            -->
jtulach@303
   618
    <target depends="init,compile-single" name="run-applet">
jtulach@303
   619
        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
jtulach@303
   620
        <j2seproject1:java classname="sun.applet.AppletViewer">
jtulach@303
   621
            <customize>
jtulach@303
   622
                <arg value="${applet.url}"/>
jtulach@303
   623
            </customize>
jtulach@303
   624
        </j2seproject1:java>
jtulach@303
   625
    </target>
jtulach@303
   626
    <!--
jtulach@303
   627
                =========================
jtulach@303
   628
                APPLET DEBUGGING  SECTION
jtulach@303
   629
                =========================
jtulach@303
   630
            -->
jtulach@303
   631
    <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet">
jtulach@303
   632
        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
jtulach@303
   633
        <j2seproject3:debug classname="sun.applet.AppletViewer">
jtulach@303
   634
            <customize>
jtulach@303
   635
                <arg value="${applet.url}"/>
jtulach@303
   636
            </customize>
jtulach@303
   637
        </j2seproject3:debug>
jtulach@303
   638
    </target>
jtulach@303
   639
    <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/>
jtulach@303
   640
    <!--
jtulach@303
   641
                ===============
jtulach@303
   642
                CLEANUP SECTION
jtulach@303
   643
                ===============
jtulach@303
   644
            -->
jtulach@303
   645
    <target depends="init" name="deps-clean" unless="no.deps"/>
jtulach@303
   646
    <target depends="init" name="-do-clean">
jtulach@303
   647
        <delete dir="${build.dir}"/>
jtulach@303
   648
        <delete dir="${dist.dir}"/>
jtulach@303
   649
    </target>
jtulach@303
   650
    <target name="-post-clean">
jtulach@303
   651
        <!-- Empty placeholder for easier customization. -->
jtulach@303
   652
        <!-- You can override this target in the ../build.xml file. -->
jtulach@303
   653
    </target>
jtulach@303
   654
    <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
jtulach@303
   655
</project>