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