-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
154 lines (127 loc) · 5.34 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
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
<?xml version="1.0"?>
<!-- This is an ant build script -->
<!-- You should process this file with ant to compile the project -->
<project name="mantissa" basedir="." default="all">
<!-- Properties setting -->
<target name="init">
<property name="version" value="7.2" />
<property name="root.package.name" value="org.spaceroots.mantissa" />
<property name="copyright" value="2001-2007 Luc Maisonobe" />
<!-- directories -->
<property name="src.dir" value="src" />
<property name="lib.dir" value="lib" />
<property name="bin.dir" value="bin" />
<property name="tests.src.dir" value="tests-src" />
<property name="doc.dir" value="doc" />
<!-- compilation properties -->
<property name="debug" value="true"/>
<property name="deprecation" value="true" />
<property name="build.sysclasspath" value="first"/>
<!-- junit related properties -->
<property name="test.class" value="${root.package.name}.AllTests" />
<!-- documentation related properties -->
<condition property="java.api.subdir" value="j2se/1.4.2" >
<equals arg1="${ant.java.version}" arg2="1.4"/>
</condition>
<condition property="java.api.subdir" value="j2se/1.5.0" >
<equals arg1="${ant.java.version}" arg2="1.5"/>
</condition>
<property name="java.api.subdir" value="javase/6" />
</target>
<!-- Directories preparation -->
<target name="prepare" depends="init" >
<mkdir dir="${bin.dir}" />
<mkdir dir="${doc.dir}" />
</target>
<!-- Compilation -->
<target name="compile" depends="init,prepare"
description="Compile the library">
<javac srcdir="${src.dir}" destdir="${bin.dir}"
debug="${debug}" deprecation="${deprecation}" />
</target>
<!-- Tests -->
<target name="compile-tests" depends="init,compile"
description="Compile the tests">
<javac srcdir="${tests.src.dir}" destdir="${bin.dir}"
debug="${debug}" deprecation="${deprecation}" >
<classpath>
<pathelement location="${bin.dir}" />
</classpath>
</javac>
</target>
<target name="test" depends="init,compile-tests"
description="Run the tests">
<junit fork="yes">
<classpath>
<pathelement location="${bin.dir}" />
</classpath>
<formatter type="brief" usefile="false" />
<test name="${test.class}" />
</junit>
</target>
<!-- Documentation -->
<target name="javadoc" depends="init"
description="Build the documentation">
<javadoc sourcepath="${src.dir}" destdir="${doc.dir}"
packagenames="${root.package.name}.*"
link="http://java.sun.com/${java.api.subdir}/docs/api/"
bottom="<i>Copyright &copy; ${copyright}. All Rights Reserved.</i>"/>
</target>
<!-- All: compilation and documentation -->
<target name="all" depends="init,compile,javadoc"
description="Build everything"/>
<target name="jar" depends="init,compile" description="Build the archive file">
<jar jarfile="${ant.project.name}-${version}.jar"
compress="true" basedir="${bin.dir}"
excludes="**/Test*.class,**/*Test.class,**/*Tests.class"/>
</target>
<target name="check-zargo" depends="init">
<available file="${ant.project.name}.zargo" property="zargo.present" />
</target>
<target name="copy-zargo" depends="check-zargo" if="zargo.present">
<copy file="${ant.project.name}.zargo" tofile="${ant.project.name}-${version}.zargo"/>
</target>
<!-- Dist : packaging of all -->
<target name="dist" depends="init,copy-zargo,jar,javadoc"
description="Create distribution files">
<zip zipfile="${ant.project.name}-${version}-doc.zip">
<zipfileset dir="${doc.dir}" prefix="${ant.project.name}-${version}-doc" >
<exclude name="**/.svn/*" />
</zipfileset>
</zip>
<zip zipfile="${ant.project.name}-${version}-src.zip">
<zipfileset dir="${basedir}" prefix="${ant.project.name}-${version}-src" >
<exclude name="${ant.project.name}-*-src.zip" />
<exclude name="${ant.project.name}-*-doc.zip" />
<exclude name="${ant.project.name}-*.jar" />
<exclude name="${ant.project.name}-*.zargo" />
<exclude name="${ant.project.name}.zargo" />
<exclude name="**/.svn/*" />
<exclude name="${bin.dir}/**" />
<exclude name="${doc.dir}/**" />
</zipfileset>
</zip>
</target>
<!-- Clean targets -->
<target name="check-dirs" depends="init">
<available file="${bin.dir}" property="bin.dir.present" />
<available file="${doc.dir}" property="doc.dir.present" />
</target>
<target name="clean-bin.dir" depends="init,check-dirs" if="bin.dir.present">
<delete dir="${bin.dir}" />
</target>
<target name="clean-doc.dir" depends="init,check-dirs" if="doc.dir.present">
<delete dir="${doc.dir}" />
</target>
<target name="clean" depends="init,clean-bin.dir,clean-doc.dir"
description="Clean everything">
<delete>
<fileset dir=".">
<include name="${ant.project.name}-*-src.zip" />
<include name="${ant.project.name}-*-doc.zip" />
<include name="${ant.project.name}-*.jar" />
<include name="${ant.project.name}-*.zargo" />
</fileset>
</delete>
</target>
</project>