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