forked from ucsb-cs56-projects/cs56-games-pong
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
119 lines (95 loc) · 3.95 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
<project default="compile">
<property name="mainClass" value="Game" />
<!-- build.xml for CP3, S12, CS56
name: Timothy Fok-->
<!-- edited by Jake Dumont and Heneli Kailahi, CS56, 13S -->
<!-- edited by Victoria Sneddon and Andrew Polk, CS56 17F-->
<property environment="env"/> <!-- load the environment variables -->
<property name="webRoot" value="${env.HOME}/public_html/cs56/13S/jdumont/hkailahi" />
<property name="webBaseURL"
value="http://www.cs.ucsb.edu/~${env.USER}/cs56/13S/jdumont/hkailahi" />
<property name="packageName" value="edu.ucsb.cs56.projects.games.pong" />
<property name="projectPath" value="edu/ucsb/cs56/projects/pong" />
<property name="projectName" value="pong" />
<property name="projectRepoName" value="cs56-games-pong" />
<property name="javadocDest" value="${webRoot}/${projectRepoName}/docs" />
<property name="javadocURL" value="${webBaseURL}/${projectRepoName}/docs"/>
<target name="compile" description="compiles the code">
<mkdir dir ="build" />
<javac srcdir="src" destdir="build" debug="true"
debuglevel="lines,vars,source" includeantruntime="false">
<compilerarg value="-Xlint"/>
<classpath>
<pathelement location="build"/>
<pathelement location="lib/junit-4.8.2.jar"/>
</classpath>
</javac>
</target>
<target name="run" depends = "compile"
description="run the Pong game, started through MainMenu.java">
<java classname="${packageName}.${mainClass}" classpath="build"
fork = "true" />
</target>
<target name="clean" description="delete unnecessary files and directories">
<delete failonerror="false" verbose="true">
<fileset dir="." includes="*.class" />
</delete>
<delete dir="build" quiet="true" />
<delete dir="dist" quiet="true" />
<delete dir="download" quiet="true" />
<!-- delete the old javadoc -->
<delete quiet="true" dir="docs" />
<delete quiet = "true" dir ="temp"/>
</target>
<target name="javadoc" depends="compile"
description = "makes javadoc">
<delete dir="docs" quiet="true" />
<javadoc destdir="docs" author="true" version="true" use="true" >
<fileset dir="src" includes="**/*.java"/>
<classpath>
<pathelement location="lib/junit-4.8.2.jar"/>
</classpath>
</javadoc>
<!-- delete the old javadoc -->
<delete quiet="true" dir="${javadocDest}" />
<!-- copy everything you just made to the javadoc destination, and then make it readable -->
<copy todir="${javadocDest}" >
<fileset dir="docs"/>
</copy>
<!-- Note: this only does the chmod command on the
javadoc subdirectory and its contents. You MIGHT have to
MANUALLY do the chmod on the parent directories. However,
you should only need to do that once. -->
<chmod dir="${javadocDest}" perm="755" type="dir" includes="**" />
<chmod dir="${javadocDest}" perm="755" type="file" includes="**/*" />
<echo>Javadoc deployed to ${javadocURL}</echo>
</target>
<target name="test" depends="compile"
description = "runs the test">
<junit haltonerror="no" haltonfailure="no">
<classpath>
<pathelement location="lib/junit-4.8.2.jar"/>
<pathelement location="build"/>
</classpath>
<batchtest fork="yes">
<fileset dir="src">
<!-- this will pick up every class with a name ending in Test -->
<include name="**/*Test.java"/>
</fileset>
</batchtest>
<formatter type="plain" usefile="false" />
</junit>
</target>
<copy todir="build/edu/ucsb/cs56/projects/games/pong/sound">
<fileset dir="src/edu/ucsb/cs56/projects/games/pong/sound" includes="**/*.wav" />
</copy>
<target name="jar" depends="compile"
description = "compies jar, zips together">
<mkdir dir="dist" />
<jar destfile="dist/${projectName}.jar" basedir="build">
<manifest>
<attribute name="Main-Class" value="${packageName}.Game"/>
</manifest>
</jar>
</target>
</project>