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