author | František Kučera <franta-hg@frantovo.cz> |
Sun Mar 14 01:05:35 2010 +0100 (2010-03-14) | |
changeset 67 | fa7e30dee3b3 |
parent 26 | fc3e84d87e01 |
child 76 | 40b228296815 |
permissions | -rw-r--r-- |
franta-hg@26 | 1 |
<?xml version="1.0" encoding="UTF-8"?> |
franta-hg@26 | 2 |
<!-- You may freely edit this file. See commented blocks below for --> |
franta-hg@26 | 3 |
<!-- some examples of how to customize the build. --> |
franta-hg@26 | 4 |
<!-- (If you delete it and reopen the project it will be recreated.) --> |
franta-hg@26 | 5 |
<!-- By default, only the Clean and Build commands use this build script. --> |
franta-hg@26 | 6 |
<!-- Commands such as Run, Debug, and Test only use this build script if --> |
franta-hg@26 | 7 |
<!-- the Compile on Save feature is turned off for the project. --> |
franta-hg@26 | 8 |
<!-- You can turn off the Compile on Save (or Deploy on Save) setting --> |
franta-hg@26 | 9 |
<!-- in the project's Project Properties dialog box.--> |
franta-hg@26 | 10 |
<project name="nekurak.net-web" default="default" basedir="."> |
franta-hg@26 | 11 |
<description>Builds, tests, and runs the project nekurak.net-web.</description> |
franta-hg@26 | 12 |
<import file="nbproject/build-impl.xml"/> |
franta-hg@26 | 13 |
<!-- |
franta-hg@26 | 14 |
|
franta-hg@31 | 15 |
There exist several targets which are by default empty and which can be |
franta-hg@31 | 16 |
used for execution of your tasks. These targets are usually executed |
franta-hg@31 | 17 |
before and after some main targets. They are: |
franta-hg@26 | 18 |
|
franta-hg@31 | 19 |
-pre-init: called before initialization of project properties |
franta-hg@31 | 20 |
-post-init: called after initialization of project properties |
franta-hg@31 | 21 |
-pre-compile: called before javac compilation |
franta-hg@31 | 22 |
-post-compile: called after javac compilation |
franta-hg@26 | 23 |
-pre-compile-single: called before javac compilation of single file |
franta-hg@26 | 24 |
-post-compile-single: called after javac compilation of single file |
franta-hg@26 | 25 |
-pre-compile-test: called before javac compilation of JUnit tests |
franta-hg@26 | 26 |
-post-compile-test: called after javac compilation of JUnit tests |
franta-hg@26 | 27 |
-pre-compile-test-single: called before javac compilation of single JUnit test |
franta-hg@26 | 28 |
-post-compile-test-single: called after javac compilation of single JUunit test |
franta-hg@31 | 29 |
-pre-dist: called before archive building |
franta-hg@31 | 30 |
-post-dist: called after archive building |
franta-hg@31 | 31 |
-post-clean: called after cleaning build products |
franta-hg@26 | 32 |
-pre-run-deploy: called before deploying |
franta-hg@26 | 33 |
-post-run-deploy: called after deploying |
franta-hg@26 | 34 |
|
franta-hg@31 | 35 |
Example of pluging an obfuscator after the compilation could look like |
franta-hg@26 | 36 |
|
franta-hg@31 | 37 |
<target name="-post-compile"> |
franta-hg@31 | 38 |
<obfuscate> |
franta-hg@31 | 39 |
<fileset dir="${build.classes.dir}"/> |
franta-hg@31 | 40 |
</obfuscate> |
franta-hg@31 | 41 |
</target> |
franta-hg@26 | 42 |
|
franta-hg@31 | 43 |
For list of available properties check the imported |
franta-hg@31 | 44 |
nbproject/build-impl.xml file. |
franta-hg@26 | 45 |
|
franta-hg@26 | 46 |
|
franta-hg@26 | 47 |
Other way how to customize the build is by overriding existing main targets. |
franta-hg@31 | 48 |
The target of interest are: |
franta-hg@26 | 49 |
|
franta-hg@26 | 50 |
init-macrodef-javac: defines macro for javac compilation |
franta-hg@26 | 51 |
init-macrodef-junit: defines macro for junit execution |
franta-hg@26 | 52 |
init-macrodef-debug: defines macro for class debugging |
franta-hg@26 | 53 |
do-dist: archive building |
franta-hg@31 | 54 |
run: execution of project |
franta-hg@31 | 55 |
javadoc-build: javadoc generation |
franta-hg@26 | 56 |
|
franta-hg@31 | 57 |
Example of overriding the target for project execution could look like |
franta-hg@26 | 58 |
|
franta-hg@31 | 59 |
<target name="run" depends="<PROJNAME>-impl.jar"> |
franta-hg@31 | 60 |
<exec dir="bin" executable="launcher.exe"> |
franta-hg@31 | 61 |
<arg file="${dist.jar}"/> |
franta-hg@31 | 62 |
</exec> |
franta-hg@31 | 63 |
</target> |
franta-hg@26 | 64 |
|
franta-hg@31 | 65 |
Notice that overridden target depends on jar target and not only on |
franta-hg@31 | 66 |
compile target as regular run target does. Again, for list of available |
franta-hg@31 | 67 |
properties which you can use check the target you are overriding in |
franta-hg@31 | 68 |
nbproject/build-impl.xml file. |
franta-hg@26 | 69 |
|
franta-hg@26 | 70 |
--> |
franta-hg@31 | 71 |
|
franta-hg@31 | 72 |
<target name="-pre-dist"> |
franta-hg@31 | 73 |
<property name="zdrojaky-archiv-soubor" value="web/nekurak.net-src.zip"/> |
franta-hg@31 | 74 |
<property name="zdrojaky-archiv-komentar" value="Kódování: UTF-8 | Autor: František Kučera | Web: http://frantovo.cz/ | Licence: GNU Affero GPL, verze 3"/> |
franta-hg@31 | 75 |
<property name="hashovani" value="SHA-512"/> |
franta-hg@31 | 76 |
|
franta-hg@31 | 77 |
<zip basedir="../../.." excludes="nekurak.net/html/** |
franta-hg@31 | 78 |
nekurak.net/.hg/** |
franta-hg@31 | 79 |
nekurak.net/.hgignore |
franta-hg@31 | 80 |
nekurak.net/.hgtags |
franta-hg@31 | 81 |
nekurak.net/java/nekurak.net-mvn/** |
franta-hg@31 | 82 |
nekurak.net/java/nekurak.net-ear/nbproject/private/** |
franta-hg@31 | 83 |
nekurak.net/java/nekurak.net-ear/dist/** |
franta-hg@31 | 84 |
nekurak.net/java/nekurak.net-ear/build/** |
franta-hg@31 | 85 |
nekurak.net/java/nekurak.net-web/nbproject/private/** |
franta-hg@31 | 86 |
nekurak.net/java/nekurak.net-web/dist/** |
franta-hg@31 | 87 |
nekurak.net/java/nekurak.net-web/build/** |
franta-hg@31 | 88 |
nekurak.net/java/nekurak.net-lib/nbproject/private/** |
franta-hg@31 | 89 |
nekurak.net/java/nekurak.net-lib/dist/** |
franta-hg@31 | 90 |
nekurak.net/java/nekurak.net-lib/build/** |
franta-hg@31 | 91 |
nekurak.net/java/nekurak.net-ejb/nbproject/private/** |
franta-hg@31 | 92 |
nekurak.net/java/nekurak.net-ejb/dist/** |
franta-hg@31 | 93 |
nekurak.net/java/nekurak.net-ejb/build/** |
franta-hg@31 | 94 |
nekurak.net/java/nekurak.net-web/${zdrojaky-archiv-soubor} |
franta-hg@31 | 95 |
nekurak.net/java/nekurak.net-web/${zdrojaky-archiv-soubor}.${hashovani} |
franta-hg@31 | 96 |
nekurak.net/licence/agpl-3.0.pdf |
franta-hg@31 | 97 |
nekurak.net/licence/agpl-3.0.tex" |
franta-hg@31 | 98 |
includes="nekurak.net/**" |
franta-hg@31 | 99 |
comment="${zdrojaky-archiv-komentar}" |
franta-hg@31 | 100 |
encoding="UTF-8" |
franta-hg@31 | 101 |
destfile="${zdrojaky-archiv-soubor}"/> |
franta-hg@31 | 102 |
<checksum file="${zdrojaky-archiv-soubor}" algorithm="${hashovani}" pattern="{0} {1}"/> |
franta-hg@31 | 103 |
|
franta-hg@31 | 104 |
<manifest file="src/conf/MANIFEST.MF" mode="replace"> |
franta-hg@31 | 105 |
<attribute name="Manifest-Version" value="1.0"/> |
franta-hg@31 | 106 |
<section name="Frantovo.cz"> |
franta-hg@31 | 107 |
<attribute name="Kompiloval" value="${user.name}"/> |
franta-hg@31 | 108 |
<attribute name="java-version" value="${java.version}"/> |
franta-hg@31 | 109 |
<attribute name="java-vm-version" value="${java.vm.version}"/> |
franta-hg@31 | 110 |
<attribute name="os-name" value="${os.name}"/> |
franta-hg@31 | 111 |
<attribute name="os-arch" value="${os.arch}"/> |
franta-hg@31 | 112 |
<attribute name="os-version" value="${os.version}"/> |
franta-hg@31 | 113 |
</section> |
franta-hg@31 | 114 |
</manifest> |
franta-hg@31 | 115 |
</target> |
franta-hg@31 | 116 |
|
franta-hg@26 | 117 |
</project> |