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