|
@@ -1,113 +1,14 @@
|
1
|
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
|
-<!-- You may freely edit this file. See commented blocks below for -->
|
3
|
|
-<!-- some examples of how to customize the build. -->
|
4
|
|
-<!-- (If you delete it and reopen the project it will be recreated.) -->
|
5
|
2
|
<project name="DMDirc" default="default" basedir=".">
|
6
|
3
|
<description>Builds, tests, and runs the project DMDirc.</description>
|
7
|
4
|
|
8
|
5
|
<import file="nbproject/build-impl.xml"/>
|
9
|
|
- <import file="BuildPlugins.xml"/>
|
|
6
|
+ <import file="build-plugins.xml"/>
|
|
7
|
+ <import file="build-svn.xml"/>
|
10
|
8
|
|
11
|
|
- <!--
|
12
|
|
-
|
13
|
|
- There exist several targets which are by default empty and which can be
|
14
|
|
- used for execution of your tasks. These targets are usually executed
|
15
|
|
- before and after some main targets. They are:
|
16
|
|
-
|
17
|
|
- -pre-init: called before initialization of project properties
|
18
|
|
- -post-init: called after initialization of project properties
|
19
|
|
- -pre-compile: called before javac compilation
|
20
|
|
- -post-compile: called after javac compilation
|
21
|
|
- -pre-compile-single: called before javac compilation of single file
|
22
|
|
- -post-compile-single: called after javac compilation of single file
|
23
|
|
- -pre-compile-test: called before javac compilation of JUnit tests
|
24
|
|
- -post-compile-test: called after javac compilation of JUnit tests
|
25
|
|
- -pre-compile-test-single: called before javac compilation of single JUnit test
|
26
|
|
- -post-compile-test-single: called after javac compilation of single JUunit test
|
27
|
|
- -pre-jar: called before JAR building
|
28
|
|
- -post-jar: called after JAR building
|
29
|
|
- -post-clean: called after cleaning build products
|
30
|
|
-
|
31
|
|
- (Targets beginning with '-' are not intended to be called on their own.)
|
32
|
|
-
|
33
|
|
- Example of inserting an obfuscator after compilation could look like this:
|
34
|
|
-
|
35
|
|
- <target name="-post-compile">
|
36
|
|
- <obfuscate>
|
37
|
|
- <fileset dir="${build.classes.dir}"/>
|
38
|
|
- </obfuscate>
|
39
|
|
- </target>
|
40
|
|
-
|
41
|
|
- For list of available properties check the imported
|
42
|
|
- nbproject/build-impl.xml file.
|
43
|
|
-
|
44
|
|
-
|
45
|
|
- Another way to customize the build is by overriding existing main targets.
|
46
|
|
- The targets of interest are:
|
47
|
|
-
|
48
|
|
- -init-macrodef-javac: defines macro for javac compilation
|
49
|
|
- -init-macrodef-junit: defines macro for junit execution
|
50
|
|
- -init-macrodef-debug: defines macro for class debugging
|
51
|
|
- -init-macrodef-java: defines macro for class execution
|
52
|
|
- -do-jar-with-manifest: JAR building (if you are using a manifest)
|
53
|
|
- -do-jar-without-manifest: JAR building (if you are not using a manifest)
|
54
|
|
- run: execution of project
|
55
|
|
- -javadoc-build: Javadoc generation
|
56
|
|
- test-report: JUnit report generation
|
57
|
|
-
|
58
|
|
- An example of overriding the target for project execution could look like this:
|
59
|
|
-
|
60
|
|
- <target name="run" depends="DMDirc-impl.jar">
|
61
|
|
- <exec dir="bin" executable="launcher.exe">
|
62
|
|
- <arg file="${dist.jar}"/>
|
63
|
|
- </exec>
|
64
|
|
- </target>
|
65
|
|
-
|
66
|
|
- Notice that the overridden target depends on the jar target and not only on
|
67
|
|
- the compile target as the regular run target does. Again, for a list of available
|
68
|
|
- properties which you can use, check the target you are overriding in the
|
69
|
|
- nbproject/build-impl.xml file.
|
70
|
|
-<jar compress="${jar.compress}" jarfile="${build.classes.dir}/plugins/">
|
71
|
|
- <fileset dir="${build.classes.dir}"/>
|
72
|
|
- </jar>
|
73
|
|
- -->
|
74
|
|
-
|
75
|
|
- <available file="/bin/bash" property="has.bash"/>
|
76
|
|
-
|
77
|
|
- <!--
|
78
|
|
- This will revert the svn revision in Main.java to prevent commiting the
|
79
|
|
- change everyt time someone builds and causing conflicts.
|
80
|
|
- -->
|
81
|
|
- <target name="unsvn" depends="unsvn_nobash, unsvn_bash"/>
|
82
|
|
- <target name="unsvn_bash" if="has.bash">
|
83
|
|
- <exec executable="/bin/bash">
|
84
|
|
- <arg value="AddSVN.sh"/>
|
85
|
|
- <arg value="--post"/>
|
86
|
|
- </exec>
|
87
|
|
- </target>
|
88
|
|
- <target name="unsvn_nobash" unless="has.bash">
|
89
|
|
- <echo message="This task only works on linux"/>
|
90
|
|
- </target>
|
91
|
|
- <target name="-post-compile" depends="unsvn, build-plugins"/>
|
92
|
|
-
|
93
|
|
- <!--
|
94
|
|
- This will add the svn revision to Main.java
|
95
|
|
- -->
|
96
|
|
- <target name="addsvn" depends="addsvn_nobash, addsvn_bash"/>
|
97
|
|
- <target name="addsvn_bash" if="has.bash">
|
98
|
|
- <exec executable="/bin/bash">
|
99
|
|
- <arg value="AddSVN.sh"/>
|
100
|
|
- <arg value="--pre"/>
|
101
|
|
- </exec>
|
102
|
|
- </target>
|
103
|
|
- <target name="addsvn_nobash" unless="has.bash">
|
104
|
|
- <echo message="This task only works on linux"/>
|
105
|
|
- </target>
|
106
|
|
- <target name="-pre-compile" depends="addsvn"/>
|
107
|
|
-
|
108
|
|
- <target name="installer" depends="installer-nobuild, installer-build"/>
|
|
9
|
+ <target name="installer" depends="-installer-nobuild, -installer-build"/>
|
109
|
10
|
|
110
|
|
- <target name="installer-build" if="has.bash">
|
|
11
|
+ <target name="-installer-build" if="has.bash">
|
111
|
12
|
<exec executable="/bin/bash" dir="installer" resultproperty="installer.result">
|
112
|
13
|
<arg value="release.sh"/>
|
113
|
14
|
<arg value="this"/>
|
|
@@ -123,7 +24,11 @@
|
123
|
24
|
<echo message=""/>
|
124
|
25
|
</target>
|
125
|
26
|
|
126
|
|
- <target name="installer-nobuild" unless="has.bash">
|
|
27
|
+ <target name="-installer-nobuild" unless="has.bash">
|
127
|
28
|
<echo message="This task only works on linux"/>
|
128
|
29
|
</target>
|
|
30
|
+
|
|
31
|
+ <target name="-post-compile" depends="unsvn, build-plugins"/>
|
|
32
|
+ <target name="-pre-compile" depends="addsvn"/>
|
|
33
|
+
|
129
|
34
|
</project>
|