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