-
Notifications
You must be signed in to change notification settings - Fork 5
/
build-import.xml
301 lines (247 loc) · 10.3 KB
/
build-import.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE project>
<project name="imported" default="compile">
<!-- Folders and File Names -->
<tstamp>
<format property="build.date" pattern="yyyy.MM.dd.HHmmssSSS" timezone="UTC"/>
</tstamp>
<property name="build.version.appendix" value="SNAPSHOT" />
<property name="build.version.number" value="${build.date}" />
<property name="build.version" value="${build.version.number}-${build.version.appendix}" />
<property name="src.dir" value="src/main/java" />
<property name="resource.dir" value="src/main/resources" />
<property name="test.src.dir" value="src/test/java" />
<property name="test.resource.dir" value="src/test/resources" />
<property name="examples.dir" value="examples" />
<property name="bin.dir" value="bin" />
<property name="build.dir" value="build" />
<property name="jar.dir" value="${build.dir}/jar" />
<property name="docs.dir" value="${build.dir}/docs" />
<property name="zip.dir" value="${build.dir}/zip" />
<property name="jar.filename" value="${project.archive}-${build.version.number}.jar" />
<property name="jar.sources.filename" value="${project.archive}-${build.version.number}-sources.jar" />
<property name="jar.javadoc.filename" value="${project.archive}-${build.version.number}-javadoc.jar" />
<property name="zip.filename" value="${project.archive}-bin-${build.version}.zip" />
<property name="zip.sources.filename" value="${project.archive}-src-${build.version}.zip" />
<property name="zip.javadoc.filename" value="${project.archive}-javadocs-${build.version}.zip" />
<!-- Filesets -->
<patternset id="pattern.documents">
<include name="LICENSE.txt" />
<include name="README.md" />
</patternset>
<fileset id="fileset.documents" dir=".">
<patternset refid="pattern.documents" />
</fileset>
<!-- ====================== Targets ====================== -->
<!-- Operating System Stuff -->
<target name="get.os">
<condition property="os.isWindows" value="true" else="false">
<os family="windows" />
</condition>
<condition property="os.isWindows32" value="true" else="false">
<and>
<os family="windows" />
<os arch="x86" />
</and>
</condition>
<condition property="os.isWindows64" value="true" else="false">
<and>
<os family="windows" />
<os arch="amd64" />
</and>
</condition>
<condition property="os.isOSX" value="true" else="false">
<and>
<os family="mac" />
<os family="unix" />
</and>
</condition>
<condition property="os.isLinux" value="true" else="false">
<os family="unix" />
</condition>
<condition property="os.isLinux32" value="true" else="false">
<and>
<os family="unix" />
<os arch="x86" />
</and>
</condition>
<condition property="os.isLinux64" value="true" else="false">
<and>
<os family="unix" />
<os arch="amd64" />
</and>
</condition>
<condition property="os.bash" value="true" else="false">
<or>
<os family="mac" />
<os family="unix" />
</or>
</condition>
</target>
<!-- Clean -->
<target name="clean.compile" description="Cleans up the compiled binaries.">
<delete dir="${bin.dir}" includeemptydirs="true" casesensitive="false"/>
</target>
<target name="clean.jar" description="Cleans up the compiled JARs.">
<delete dir="${jar.dir}" includeemptydirs="true" casesensitive="false"/>
</target>
<target name="clean.docs" description="Cleans up the compiled documentation.">
<delete dir="${docs.dir}" includeemptydirs="true" casesensitive="false" />
</target>
<target name="clean.zip" description="Cleans up the zipped archives.">
<delete dir="${zip.dir}" includeemptydirs="true" casesensitive="false" />
</target>
<target name="clean" depends="clean.jar, clean.docs, clean.zip, clean.compile" description="Cleans up everything.">
<delete dir="${build.dir}" includeemptydirs="true" casesensitive="false" />
</target>
<!-- Javadocs -->
<target name="init.docs" depends="clean.docs" description="Initializes the documentation folders.">
<mkdir dir="${docs.dir}" />
</target>
<target name="javadoc" depends="init.docs" description="Builds the documentation.">
<javadoc access="protected"
additionalparam="-J-Xmx512m "
author="true"
classpath="${project.classpath}${path.separator}${bin.dir}"
doctitle="${project.javadoc.title}"
sourcepath="${src.dir}"
packagenames="${project.javadoc.packages}"
destdir="${docs.dir}"
splitindex="true"
use="true"
version="true"
nodeprecated="false"
nodeprecatedlist="false"
noindex="false"
nonavbar="false"
notree="false"
>
<link href="https://docs.oracle.com/en/java/javase/11/docs/api/"/>
</javadoc>
</target>
<!-- Preparation -->
<target name="available.path.checks">
<available file="${src.dir}" property="src.dir.available"/>
<available file="${resource.dir}" property="resource.dir.available"/>
<available file="${test.src.dir}" property="test.src.dir.available"/>
<available file="${test.resource.dir}" property="test.resource.dir.available"/>
</target>
<!-- Compiling -->
<target name="init.compile" depends="clean.compile" description="Initializes the compilation folders.">
<mkdir dir="${bin.dir}" />
</target>
<target name="compile.src" if="src.dir.available">
<javac
source="1.8"
target="1.8"
compiler="javac1.8"
bootclasspath="${project.compiler.bootclasspath}"
srcdir="${src.dir}"
destdir="${bin.dir}"
includeAntRuntime="false"
classpath="${project.classpath}"
debug="on"
/>
</target>
<target name="compile.resources" if="resource.dir.available">
<copy todir="${bin.dir}">
<fileset dir="${resource.dir}" />
</copy>
</target>
<target name="compile" depends="available.path.checks, init.compile, compile.src, compile.resources" description="Compiles the project.">
</target>
<!-- Compiling Tests -->
<target name="compile.test.src" depends="compile" if="test.src.dir.available">
<javac
source="1.8"
target="1.8"
compiler="javac1.8"
bootclasspath="${project.compiler.bootclasspath}"
srcdir="${test.src.dir}"
destdir="${bin.dir}"
includeAntRuntime="false"
classpath="${project.classpath}"
debug="off"
/>
</target>
<target name="compile.test.resources" if="test.resource.dir.available">
<copy todir="${bin.dir}">
<fileset dir="${test.resource.dir}" />
</copy>
</target>
<target name="compile.test" depends="compile, compile.test.src, compile.test.resources" description="Compiles the project." if="test.src.dir.available">
<copy todir="${bin.dir}" failonerror="false">
<fileset dir="${test.resource.dir}" />
</copy>
</target>
<!-- JAR -->
<target name="init.jar" depends="clean.jar" description="Initializes the JAR folders.">
<mkdir dir="${jar.dir}" />
</target>
<target name="jar.bin" depends="init.jar, compile" description="JARs up the compiled files.">
<jar basedir="${bin.dir}" destfile="${jar.dir}/${jar.filename}" />
</target>
<target name="jar.sources.src" if="src.dir.available">
<jar basedir="${src.dir}" destfile="${jar.dir}/${jar.sources.filename}" />
</target>
<target name="jar.sources.resource" if="resource.dir.available">
<jar basedir="${resource.dir}" destfile="${jar.dir}/${jar.filename}" update="true" />
</target>
<target name="jar.sources" depends="init.jar, jar.sources.src, jar.sources.resource" description="JARs up the sources.">
</target>
<target name="jar.javadoc" depends="init.jar, javadoc" description="JARs up the Javadoc files.">
<jar basedir="${docs.dir}" destfile="${jar.dir}/${jar.javadoc.filename}" />
</target>
<target name="jar" depends="jar.bin, jar.sources, jar.javadoc" description="Generates all JARs.">
</target>
<!-- Zip -->
<target name="init.zip" depends="clean.zip" description="Initializes the ZIP folders.">
<mkdir dir="${zip.dir}" />
</target>
<target name="zip.jar" depends="init.zip, jar" description="Archives the main JAR.">
<delete file="${zip.dir}/${zip.filename}" />
<zip destfile="${zip.dir}/${zip.filename}">
<fileset file="${jar.dir}/${jar.filename}" />
</zip>
<zip destfile="${zip.dir}/${zip.filename}" update="true">
<fileset refid="fileset.documents" />
</zip>
</target>
<target name="zip.docs" depends="init.zip, javadoc" description="Archives the documentation.">
<delete file="${zip.dir}/${zip.javadoc.filename}" />
<zip basedir="${docs.dir}" destfile="${zip.dir}/${zip.javadoc.filename}" compress="true">
</zip>
</target>
<target name="zip.src.code" if="src.dir.available">
<delete file="${zip.dir}/${zip.sources.filename}" />
<zip destfile="${zip.dir}/${zip.sources.filename}" compress="true">
<zipfileset dir="${src.dir}" prefix="${src.dir}" />
<zipfileset dir="${test.src.dir}" prefix="${test.src.dir}" erroronmissingdir="false" />
</zip>
<zip destfile="${zip.dir}/${zip.sources.filename}" update="true">
<fileset refid="fileset.documents" />
</zip>
<zip destfile="${zip.dir}/${zip.sources.filename}" update="true">
<fileset dir="." includes="*.xml" />
</zip>
</target>
<target name="zip.src.resources" if="resource.dir.available">
<zip destfile="${zip.dir}/${zip.sources.filename}" update="true">
<zipfileset dir="${resource.dir}" prefix="${resource.dir}" erroronmissingdir="false" />
<zipfileset dir="${test.resource.dir}" prefix="${test.resource.dir}" erroronmissingdir="false" />
</zip>
</target>
<target name="zip.src" depends="init.zip, zip.src.code, zip.src.resources" description="Archives the source code and resources.">
</target>
<target name="zip" depends="zip.jar, zip.docs, zip.src" description="Creates all archives.">
</target>
<!-- Test -->
<target name="test" depends="compile.test" if="test.src.dir.available">
<java classpath="${project.classpath}${path.separator}${bin.dir}" classname="${project.testclass.main}" fork="true" failonerror="true">
<arg value="${project.testclass}"/>
</java>
</target>
<!-- Release -->
<target name="release" depends="jar, test, zip">
</target>
</project>