-
Notifications
You must be signed in to change notification settings - Fork 12
/
build.xml
69 lines (57 loc) · 2.52 KB
/
build.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
<!-- Ant build file for source-code.biz Java DSP collection -->
<project default="package">
<property environment="env"/>
<condition property="isJava8">
<equals arg1="${ant.java.version}" arg2="1.8"/>
</condition>
<!-- Main targets ===========================================================-->
<target name="clean" description="Deletes the target directory.">
<delete dir="target" failonerror="true"/>
</target>
<target name="compile" description="Compiles the source files.">
<mkdir dir="target/classes"/>
<javac destdir="target/classes"
deprecation="true" includeAntRuntime="false" debug="true" debuglevel="lines,source"
source="7" target="7">
<src path="src/main/java"/>
<src path="src/test/java"/>
<compilerarg line="-Xlint -Xlint:-path -Xlint:-options -Xmaxerrs 5 -Xmaxwarns 5"/>
</javac>
</target>
<target name="package" depends="compile" description="Builds the JAR file.">
<jar destfile="target/dsp-collection.jar">
<fileset dir="target/classes"/>
</jar>
</target>
<target name="javadoc" description="Generates the API documentation (apidocs)">
<delete dir="target/apidocs" failonerror="true"/>
<mkdir dir="target/apidocs"/>
<javadoc sourcepath="src/main/java" destdir="target/apidocs" failonerror="true"
additionalparam="-Xdoclint:all,-missing"
link="https://docs.oracle.com/javase/8/docs/api/"/>
<antcall target="-fixupJava8Javadoc"/>
</target>
<target name="-fixupJava8Javadoc" if="isJava8">
<move file="target/apidocs/stylesheet.css" tofile="target/apidocs/stylesheetOrig.css"/>
<copy file="src/doc/javadoc8OverrideStylesheet.css" tofile="target/apidocs/stylesheet.css"/>
</target>
<!-- Website update =========================================================-->
<target name="buildDistribZip" description="Builds the distribution ZIP file.">
<antcall target="clean"/>
<antcall target="package"/>
<antcall target="javadoc"/>
<zip destfile="target/dsp-collection.zip">
<zipfileset dir="."
includes="build.xml, README.txt, src/, target/dsp-collection.jar, target/apidocs/"/>
</zip>
</target>
<target name="updateWebsite">
<fail unless="env.dspCollectionWebsiteDir" message="Undefined website directory."/>
<property name="websiteDir" location="${env.dspCollectionWebsiteDir}"/>
<antcall target="buildDistribZip"/>
<delete dir="${websiteDir}/apidocs" failonerror="true"/>
<copy todir="${websiteDir}" overwrite="true">
<fileset dir="target" includes="dsp-collection.zip, dsp-collection.jar, apidocs/"/>
</copy>
</target>
</project>