-
Notifications
You must be signed in to change notification settings - Fork 26
/
build.xml
124 lines (108 loc) · 3.48 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
<project name="Battlecode 2013" basedir="." default="run">
<description>
Build file for Battlecode 2013 players.
</description>
<property name="path.base" location="."/>
<property name="path.lib" location="${path.base}/lib"/>
<property name="path.teams" location="${path.base}/teams"/>
<property name="path.maps" location="${path.base}/maps"/>
<property name="path.bin" location="${path.base}/bin"/>
<property name="path.matches" location="${path.base}/matches"/>
<fileset id="files.build" dir="${path.lib}">
<include name="*.jar"/>
</fileset>
<fileset id="scala.files" dir="${path.lib}" includes="scala-*.jar"/>
<pathconvert property="scala" refid="scala.files" setonempty="false"/>
<path id="classpath.run">
<dirset dir="${path.bin}"/>
<dirset dir="${path.lib}"/>
<dirset dir="${path.teams}"/>
<fileset refid="files.build"/>
</path>
<target name="-init">
<mkdir dir="${path.bin}"/>
</target>
<target name="clean">
<delete dir="${path.bin}"/>
</target>
<target name="build-scala" if="scala">
<taskdef resource="scala/tools/ant/antlib.xml">
<classpath>
<fileset dir="${path.lib}">
<include name="scala-library-2.9.1.jar"/>
<include name="scala-compiler-2.9.1.jar"/>
</fileset>
</classpath>
</taskdef>
<scalac
srcdir="${path.teams}"
destdir="${path.bin}"
target="jvm-1.5"
classpathref="classpath.run">
<include name="**/*.scala"/>
<include name="**/*.java"/>
</scalac>
</target>
<target name="build" depends="-init,build-scala">
<javac
classpathref="classpath.run"
destdir="${path.bin}"
srcdir="${path.teams}"
target="1.6"
source="1.6"
debug="true">
<compilerarg line="-Xlint"/>
</javac>
</target>
<target name="run" depends="build">
<java
classpathref="classpath.run"
fork="yes"
classname="battlecode.client.Main">
<jvmarg value="-Dapple.awt.graphics.UseQuartz=true"/>
<jvmarg value="-Dbc.server.map-path=${path.maps}"/>
<jvmarg value="-Xmx256m"/>
<jvmarg value="-Djava.library.path=${path.lib}" />
<arg line="-c bc.conf"/>
</java>
</target>
<target name="runmatch" depends="build">
<java
classpathref="classpath.run"
fork="yes"
classname="battlecode.client.Main">
<jvmarg value="-Dapple.awt.graphics.UseQuartz=true"/>
<jvmarg value="-Dbc.server.map-path=${path.maps}"/>
<jvmarg value="-Dbc.client.match=${match}"/>
<jvmarg value="-Xmx256m"/>
<jvmarg value="-Djava.library.path=${path.lib}" />
<arg line="-c bc.conf"/>
</java>
</target>
<target name="serve" depends="build">
<java
classpathref="classpath.run"
fork="yes"
classname="battlecode.server.Main">
<jvmarg value="-Dbc.server.mode=tcp"/>
<arg line="-c bc.conf"/>
</java>
</target>
<target name="file" depends="build">
<java
classpathref="classpath.run"
fork="yes"
classname="battlecode.server.Main">
<jvmarg value="-Dbc.server.mode=headless"/>
<arg line="-c bc.conf"/>
</java>
</target>
<target name="jar" depends="build">
<fail unless="team">
run as "ant -Dteam=name jar" where "name" is a folder in your teams folder.
</fail>
<jar destfile="${path.base}/submission.jar"
basedir="${path.teams}"
includes="${team}/**/*.java,${team}/**/*.scala"/>
</target>
</project>