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