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