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