-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathbuild.xml
176 lines (150 loc) · 6.28 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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<?xml version="1.0"?>
<project name="Battlecode Server"
xmlns:ivy="antlib:org.apache.ivy.ant"
default="compile">
<property file="build.conf.local"/>
<property name="rootname" value="battlecode-server"/>
<property name="src.dir" value="${basedir}/src/main"/>
<property name="lib.dir" value="${basedir}/lib"/>
<property name="build.dir" value="${basedir}/build"/>
<property name="build.encoding" value="UTF-8"/>
<property name="build.jar" value="${basedir}/${rootname}.jar"/>
<property name="pkg.build.jar" value="${basedir}/${rootname}.jar"/>
<property name="pkg.build.dir" value="${build.dir}/classes"/>
<property name="javac.debug" value="on"/>
<property name="javac.optimize" value="on"/>
<property name="javac.deprecation" value="off"/>
<property name="javac.version" value="1.6"/>
<property name="javac.args" value=""/>
<property name="javac.args.warnings" value="-Xlint:unchecked"/>
<property name="javadoc.destdir" value="docs/api"/>
<property name="commondoc.destdir" value="docs/common"/>
<property name="extern.dir" value=".."/>
<property name="extern.target" value="run"/>
<!-- Unit tests -->
<property name="test.src.dir" value="${basedir}/src/test"/>
<property name="test.timeout" value="900000"/>
<property name="test.build.dir" value="${build.dir}/tests"/>
<property name="test.build.jar" value="${basedir}/${rootname}-test.jar"/>
<property name="test.report.file" value="TEST-AllTestSuite"/>
<property name="instr.build.dir" value="${build.dir}/instrumented-classes"/>
<property name="instr.datafile" value="${build.dir}/cobertura.ser"/>
<!-- IVY configuration items -->
<property name="ivy.install.version" value="2.1.0"/>
<condition property="ivy.home" value="${env.IVY_HOME}">
<isset property="env.IVY_HOME"/>
</condition>
<property name="ivy.home" value="${user.home}/.ant"/>
<property name="ivy.jar.dir" value="${ivy.home}/lib"/>
<property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar"/>
<property name="ivy.remote.jar" value="http://repo2.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar"/>
<!-- the normal classpath -->
<path id="classpath-libs">
<fileset dir="${lib.dir}"><include name="**/*.jar"/></fileset>
</path>
<path id="classpath-test">
<pathelement location="${basedir}/${rootname}.jar"/>
</path>
<path id="classpath-compiled">
<pathelement location="${pkg.build.dir}"/>
</path>
<path id="classpath-coverage">
<pathelement location="${instr.build.dir}"/>
</path>
<target name="download-ivy">
<mkdir dir="${ivy.jar.dir}"/>
<get dest="${ivy.jar.file}"
usetimestamp="true"
src="${ivy.remote.jar}"/>
</target>
<target name="init-ivy">
<!-- try to load ivy here from ivy home, in case the user has not
already dropped it into ant's lib dir (note that the latter copy will
always take precedence). We will not fail as long as local lib dir
'exists (it may be empty) and ivy is in at least one of ant's lib dir or
the local lib dir. -->
<path id="ivy.lib.path">
<fileset dir="${ivy.jar.dir}" includes="*.jar"/>
</path>
<taskdef resource="org/apache/ivy/ant/antlib.xml"
uri="antlib:org.apache.ivy.ant"
classpathref="ivy.lib.path"/>
</target>
<target name="retrieve" depends="init,init-ivy">
<ivy:settings file="ivyconf.xml"/>
<ivy:retrieve/>
</target>
<target name="init">
<mkdir dir="${build.dir}"/>
<mkdir dir="${pkg.build.dir}"/>
<mkdir dir="${test.build.dir}"/>
</target>
<target name="clean"
description="Clean up build directory.">
<delete dir="${build.dir}"/>
<delete dir="${javadoc.destdir}"/>
<delete dir="${commondoc.destdir}"/>
<delete file="${build.jar}"/>
<delete file="${test.build.jar}"/>
<delete file="${test.report.file}.xml"/>
</target>
<target name="compile"
description="Compile Battlecode classes."
depends="init">
<javac encoding="${build.encoding}"
srcdir="${src.dir}"
includes="**/*.java"
destdir="${pkg.build.dir}"
debug="${javac.debug}"
optimize="${javac.optimize}"
target="${javac.version}"
source="${javac.version}"
deprecation="${javac.deprecation}"
includeantruntime="true">
<compilerarg line="${javac.args} ${javac.args.warnings}"/>
<classpath refid="classpath-libs"/>
</javac>
</target>
<target name="jar"
description="Build the jar (with dependencies included)."
depends="compile">
<jar jarfile="${pkg.build.jar}" basedir="${pkg.build.dir}">
<zipgroupfileset dir="${lib.dir}" excludes="battlecode-*, junit-*"/>
</jar>
</target>
<target name="extern" depends="jar" description="Build the jar, then run an external build file.">
<ant dir="${extern.dir}" target="${extern.target}"/>
</target>
<!-- ========== TESTING ========= -->
<target name="common-doc" depends="compile">
<javadoc
classpathref="classpath-libs"
sourcepath="${src.dir}"
packagenames="battlecode.common.*"
destdir="${commondoc.destdir}"
windowtitle="Battlecode ${year}"
link="http://download.oracle.com/javase/6/docs/api/">
<doclet name="battlecode.doc.Doclet" path="${pkg.build.dir}"/>
<taglet name="battlecode.doc.Cooldown" path="${pkg.build.dir}"/>
<taglet name="battlecode.doc.MethodCost">
<path refid="classpath-libs"/>
</taglet>
<taglet name="battlecode.doc.Components">
<path refid="classpath-libs"/>
</taglet>
<taglet name="battlecode.doc.ChassisDoc">
<path refid="classpath-libs"/>
</taglet>
</javadoc>
</target>
<target name="doc">
<javadoc destdir="${javadoc.destdir}"
author="true"
version="true"
use="true"
windowtitle="Battlecode Server API">
<packageset dir="${src.dir}" defaultexcludes="yes"/>
<link href="http://java.sun.com/j2se/1.6.0/docs/api/"/>
</javadoc>
</target>
</project>