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