forked from mglont/CombineArchive
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
120 lines (100 loc) · 4.64 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
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
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:ivy="antlib:org.apache.ivy.ant" basedir="." default="buildAll" name="CombineArchive">
<property name="target" value="1.7" />
<property name="source" value="1.7" />
<property name="debuglevel" value="lines,vars,source"/>
<property name="build.dir" value="./ant-build" />
<property name="build.dir.src" value="${build.dir}/src"/>
<property name="build.dir.tests" value="${build.dir}/test"/>
<property name="build.dir.doc" value="${build.dir}/doc"/>
<property name="src.dir" value="./src" />
<property name="test.dir" value="./test" />
<property name="libs.dir" value="./libs" />
<property name="jar.dir" value="./jars" />
<property name="deps.dir" value="${build.dir}/dependency-report"/>
<property name="ivy.lib.dir" value="${libs.dir}"/>
<property name="jar.name.bin" value="CombineArchive.jar" />
<property name="jar.name.src" value="CombineArchive-src.jar" />
<property name="jar.name.doc" value="CombineArchive-docs.jar" />
<path id="ivy.lib.path">
<pathelement location="${libs.dir}/ivy-2.3.0.jar" />
</path>
<taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant"
classpathref="ivy.lib.path"/>
<path id="src.classpath">
<fileset dir="${libs.dir}/compile" />
</path>
<path id="test.classpath">
<path refid="src.classpath" />
<fileset dir="${libs.dir}/test" />
<pathelement location="${build.dir.src}" />
<pathelement location="${build.dir.tests}" />
</path>
<target name="buildAll" description="builds all code and docs and jars them up" depends="build-project,build-docs,jarAll" />
<target name="init">
<mkdir dir="${build.dir}" />
<mkdir dir="${build.dir.src}" />
<mkdir dir="${build.dir.tests}" />
<mkdir dir="${build.dir.doc}"/>
</target>
<target name="resolve" description="retrieves the project's dependencies">
<ivy:retrieve pattern="${ivy.lib.dir}/[conf]/[artifact].[ext]"/>
</target>
<target name="clean">
<delete dir="${build.dir}" />
</target>
<target depends="build-project" name="build" />
<target depends="init,resolve,build-src,build-test" name="build-project" />
<target name="build-src" description="src build with no aspects task" depends="init">
<javac classpathref="src.classpath" srcdir="${src.dir}" source="${source}" target="${target}"
debug="true" debuglevel="${debuglevel}" destdir="${build.dir.src}" includeantruntime="false">
</javac>
<copy todir="${build.dir.src}">
<fileset dir="${src.dir}">
<exclude name="**/*.java" />
</fileset>
</copy>
</target>
<target depends="init,build-src" name="build-test">
<echo message="${ant.project.name}: ${ant.file}" />
<javac debug="true" debuglevel="${debuglevel}" destdir="${build.dir.tests}"
source="${source}" classpathref="test.classpath" nowarn="false" target="${target}"
includeantruntime="false">
<src path="${test.dir}" />
<classpath refid="test.classpath" />
<compilerarg value="-Xlint" />
</javac>
</target>
<target name="jar-bin" depends="build-src,init-jardirs">
<jar destfile="${jar.dir}/${jar.name.bin}" basedir="${build.dir.src}">
</jar>
</target>
<target name="build-docs">
<javadoc access="package" author="true" splitindex="true" use="true" version="true" source="${source}"
sourcepath="${src.dir}" destdir="${build.dir.doc}" doctitle="Combine Archive API"
nodeprecated="false" nodeprecatedlist="false" noindex="false"
nonavbar="false" notree="false">
<classpath refid="src.classpath" />
</javadoc>
</target>
<target name="jarAll" description="creates all jar files for distribution" depends="jar-bin, jar-src, jar-docs"/>
<target name="jar-docs" depends="build-docs">
<mkdir dir="${jar.dir}" />
<jar destfile="${jar.dir}/${jar.name.doc}">
<fileset dir="${build.dir.doc}" />
</jar>
</target>
<target name="init-jardirs">
<delete dir="${jar.dir}" />
<mkdir dir="${jar.dir}" />
</target>
<target name="jar-src" depends="init-jardirs">
<jar destfile="${jar.dir}/${jar.name.src}">
<fileset dir="${src.dir}" />
</jar>
</target>
<target name="dependency-report" depends="resolve" description="provides a report of the project's dependencies.">
<mkdir dir="${deps.dir}"/>
<ivy:report todir="${deps.dir}"/>
</target>
</project>