-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
176 lines (155 loc) · 6.02 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
<project name="Demo Server" default="server" basedir=".">
<!-- PROPERTIES -->
<!-- ********** -->
<!-- Directory paths for the java server, javascript, and dest dir for the student copy -->
<property name="port.arg" value="8081"/>
<property name="web.arg" value="gameplay"/>
<property name="requests.arg" value="ug"/>
<property name="host" value="localhost" />
<property name="port" value="8081" />
<!-- Input folders -->
<property name="java.dir" value="java"/>
<property name="java.src.dir" value="${java.dir}/src"/>
<property name="java.lib.dir" value="${java.dir}/lib"/>
<!-- JavaScript source folder -->
<property name="javascript.dir" value="gameplay/js"/>
<!-- Base output folder -->
<property name="dest.dir" value="docs"/>
<!-- Javadoc output folder -->
<property name="javadoc.dir" value="${dest.dir}/java"/>
<!-- YUIDoc output folder -->
<property name="yuidoc.dir" value="${dest.dir}/javascript"/>
<!-- Jar file path/name from here -->
<property name="jar.file" value="server.jar"/>
<!-- Tests directory -->
<property name="test.dir" value="${java.dir}/src"/>
<property name="test.build" value="${java.dir}/build"/>
<!-- CLASSPATHS -->
<!-- ********** -->
<path id="java.lib.classpath">
<fileset dir="${java.lib.dir}">
<include name="**/*.jar" />
</fileset>
</path>
<!-- TARGETS -->
<!-- ******* -->
<target name="server" description="Runs the demo server">
<java jar="${jar.file}" fork="true">
<arg value="${port.arg}"/>
<arg value="${web.arg}"/>
<arg value="${requests.arg}"/>
<assertions>
<enable/>
</assertions>
</java>
</target>
<target name="make-java-doc" description="Generate the Java docs">
<echo> Making Java documentation </echo>
<delete dir="${javadoc.dir}"/>
<javadoc destdir="${javadoc.dir}" Package="true">
<classpath refid="java.lib.classpath" />
<packageset dir="${java.src.dir}">
<include name="client/**"/>
<include name="shared/**"/>
</packageset>
</javadoc>
</target>
<!--
<target name="make-js-doc" description="Generate the JavaScript docs">
<echo> Making JavaScript documentation </echo>
<exec executable="yuidoc">
<arg value="-o"/>
<arg value="${yuidoc.dir}"/>
<arg value="${javascript.dir}"/>
</exec>
</target>
-->
<property name="java.dir" location="java"/>
<property name="java.src" location="${java.dir}/src"/>
<property name="java.images" location="${java.dir}/images"/>
<property name="java.build" location="${java.dir}/build"/>
<property name="java.dist" location="${java.dir}/dist"/>
<property name="java.lib" location="${java.dir}/lib"/>
<target name="init" description="create build directories">
<tstamp/>
<mkdir dir="${java.build}"/>
<mkdir dir="${java.dist}"/>
</target>
<target name="clean" description="clean build files" >
<delete dir="${java.build}"/>
<delete dir="${java.dist}"/>
</target>
<target name="compile" depends="init" description="compile the source " >
<javac srcdir="${java.src}" destdir="${java.build}" debug="true" includeantruntime="true">
<classpath refid="java.lib.classpath" />
</javac>
<javac srcdir="${test.dir}" destdir="${java.build}" debug="true" includeantruntime="true">
<classpath refid="java.lib.classpath" />
</javac>
</target>
<target name="package" depends="compile" description="package the jar file" >
<mkdir dir="${java.dist}/lib"/>
<copy todir="${java.dist}/lib">
<fileset dir="${java.lib}">
<include name="**"/>
</fileset>
</copy>
<mkdir dir="${java.dist}/images"/>
<copy todir="${java.dist}/images">
<fileset dir="${java.images}">
<include name="**"/>
</fileset>
</copy>
<jar jarfile="${java.dist}/catan-client.jar" basedir="${java.build}">
<manifest>
<attribute name="Main-Class" value="client.main.Catan"/>
<attribute name="Class-Path"
value="lib/gson-2.2.4.jar" />
</manifest>
</jar>
<jar jarfile="${java.dist}/catan-test.jar" basedir="${java.build}">
<manifest>
<attribute name="Main-Class" value="client.tests.AllClientTests"/>
<attribute name="Class-Path"
value="${java.lib}" />
</manifest>
</jar>
<jar jarfile="${java.dist}/catan-server.jar" basedir="${java.build}">
<manifest>
<attribute name="Main-Class" value="server.main.Server"/>
<attribute name="Class-Path"
value="lib/gson-2.2.4.jar" />
</manifest>
</jar>
</target>
<target name="client" depends="package" description="compiles, packages, and runs the student client">
<java jar="${java.dist}/catan-client.jar" dir="${java.dist}" fork="yes">
<sysproperty key="com.sun.management.jmxremote" value=""/>
<arg value="${host}"/>
<arg value="${port}"/>
<assertions>
<enable/>
</assertions>
</java>
</target>
<target name="our-server" depends="package" description="compiles, packages, and runs the student server">
<java jar="${java.dist}/catan-server.jar" dir="${java.dist}" fork="yes">
<sysproperty key="com.sun.management.jmxremote" value=""/>
<assertions>
<enable/>
</assertions>
</java>
</target>
<target name="test" depends="package" description="compiles, packages, and runs the test cases">
<java classname="client.tests.AllClientTests">
<arg value="-h"/>
<classpath>
<path refid="java.lib.classpath"/>
<pathelement location="${java.build}"/>
</classpath>
</java>
</target>
<target name="make-tester-zip" depends="package" description="makes a zip file for your testing team">
<zip destfile="./tester.zip" basedir="${java.dist}" />
</target>
</project>