samples/exceptions/build.xml
author Jaroslav Tulach <jtulach@netbeans.org>
Wed, 28 Jan 2009 08:06:41 +0100
changeset 307 52f941f090cd
permissions -rw-r--r--
Initial attempt to provide sample for trycatchredo
jtulach@307
     1
<?xml version="1.0" encoding="UTF-8"?>
jtulach@307
     2
<!-- You may freely edit this file. See commented blocks below for -->
jtulach@307
     3
<!-- some examples of how to customize the build. -->
jtulach@307
     4
<!-- (If you delete it and reopen the project it will be recreated.) -->
jtulach@307
     5
<project name="exceptions" default="default" basedir=".">
jtulach@307
     6
    <description>Builds, tests, and runs the project exceptions.</description>
jtulach@307
     7
    <import file="nbproject/build-impl.xml"/>
jtulach@307
     8
    <!--
jtulach@307
     9
jtulach@307
    10
    There exist several targets which are by default empty and which can be 
jtulach@307
    11
    used for execution of your tasks. These targets are usually executed 
jtulach@307
    12
    before and after some main targets. They are: 
jtulach@307
    13
jtulach@307
    14
      -pre-init:                 called before initialization of project properties
jtulach@307
    15
      -post-init:                called after initialization of project properties
jtulach@307
    16
      -pre-compile:              called before javac compilation
jtulach@307
    17
      -post-compile:             called after javac compilation
jtulach@307
    18
      -pre-compile-single:       called before javac compilation of single file
jtulach@307
    19
      -post-compile-single:      called after javac compilation of single file
jtulach@307
    20
      -pre-compile-test:         called before javac compilation of JUnit tests
jtulach@307
    21
      -post-compile-test:        called after javac compilation of JUnit tests
jtulach@307
    22
      -pre-compile-test-single:  called before javac compilation of single JUnit test
jtulach@307
    23
      -post-compile-test-single: called after javac compilation of single JUunit test
jtulach@307
    24
      -pre-jar:                  called before JAR building
jtulach@307
    25
      -post-jar:                 called after JAR building
jtulach@307
    26
      -post-clean:               called after cleaning build products
jtulach@307
    27
jtulach@307
    28
    (Targets beginning with '-' are not intended to be called on their own.)
jtulach@307
    29
jtulach@307
    30
    Example of inserting an obfuscator after compilation could look like this:
jtulach@307
    31
jtulach@307
    32
        <target name="-post-compile">
jtulach@307
    33
            <obfuscate>
jtulach@307
    34
                <fileset dir="${build.classes.dir}"/>
jtulach@307
    35
            </obfuscate>
jtulach@307
    36
        </target>
jtulach@307
    37
jtulach@307
    38
    For list of available properties check the imported 
jtulach@307
    39
    nbproject/build-impl.xml file. 
jtulach@307
    40
jtulach@307
    41
jtulach@307
    42
    Another way to customize the build is by overriding existing main targets.
jtulach@307
    43
    The targets of interest are: 
jtulach@307
    44
jtulach@307
    45
      -init-macrodef-javac:     defines macro for javac compilation
jtulach@307
    46
      -init-macrodef-junit:     defines macro for junit execution
jtulach@307
    47
      -init-macrodef-debug:     defines macro for class debugging
jtulach@307
    48
      -init-macrodef-java:      defines macro for class execution
jtulach@307
    49
      -do-jar-with-manifest:    JAR building (if you are using a manifest)
jtulach@307
    50
      -do-jar-without-manifest: JAR building (if you are not using a manifest)
jtulach@307
    51
      run:                      execution of project 
jtulach@307
    52
      -javadoc-build:           Javadoc generation
jtulach@307
    53
      test-report:              JUnit report generation
jtulach@307
    54
jtulach@307
    55
    An example of overriding the target for project execution could look like this:
jtulach@307
    56
jtulach@307
    57
        <target name="run" depends="exceptions-impl.jar">
jtulach@307
    58
            <exec dir="bin" executable="launcher.exe">
jtulach@307
    59
                <arg file="${dist.jar}"/>
jtulach@307
    60
            </exec>
jtulach@307
    61
        </target>
jtulach@307
    62
jtulach@307
    63
    Notice that the overridden target depends on the jar target and not only on 
jtulach@307
    64
    the compile target as the regular run target does. Again, for a list of available 
jtulach@307
    65
    properties which you can use, check the target you are overriding in the
jtulach@307
    66
    nbproject/build-impl.xml file. 
jtulach@307
    67
jtulach@307
    68
    -->
jtulach@307
    69
</project>