-
Notifications
You must be signed in to change notification settings - Fork 9
/
build.xml
111 lines (90 loc) · 4.35 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
<project default="compile">
<!-- build.xml for github.com/UCSB-CS56-Projects/cs56-games-maze
original authors: Jakob Staahl, Evan West
updated P. Conrad for github W14-->
<property name="projectName" value="MazeGame" />
<property name="mainClass" value="edu.ucsb.cs56.projects.games.cs56_games_maze.MazeGui" />
<property environment="env"/> <!-- load the environment variables -->
<property name="projectPath" value="cs56/W14/${env.USER}/cs56-games-maze" />
<property name="webRoot" value="${env.HOME}/public_html" />
<property name="webBaseURL" value="http://www.cs.ucsb.edu/~${env.USER}" />
<property name="javadocDest" value="${webRoot}/${projectPath}/javadoc" />
<property name="javadocURL" value="${webBaseURL}/${projectPath}/javadoc" />
<path id="project.class.path">
<pathelement location="build"/>
<pathelement location="lib/junit-4.8.2.jar"/>
</path>
<target name="compile" description="compile my code">
<mkdir dir="build" />
<javac srcdir="src" destdir="build" includeantruntime="false" debug="true" debuglevel="lines,vars,source" >
<compilerarg value="-Xlint:unchecked"/>
<classpath refid="project.class.path" />
</javac>
</target>
<target name="run" depends="compile" description="run the mainClass of this program">
<echo> run the program using any of the following, replacing the parentheticals with integer values:
java -cp build ${mainClass}
or
java -cp build ${mainClass} (genChainLength) (genChainLengthFlux)
where (genChainLength) is the number of cells each branch carves in the grid before
spawning a new branch and (genChainLengthFlux) is the +/- random range for genChainLength
or
java -cp build ${mainClass} (genChainLength) (genChainLengthFlux) (numRows) (numCols) (cellWidth)
where cellWidth is in pixels
or
java -cp build ${mainClass} (genChainLength) (genChainLengthFlux) (numRows) (numCols) (cellWidth) (startRow) (startCol) (endRow) (endCol)
where startRow and startCol are the row and column coordinates for the cell to use as the starting point for the grid solver
and endRow and endCol are the row and column coordinates for the cell to use as the ending point for the grid solver
if any of the first three usages are used, default values for the arguments are used if necessary and are as follows:
genChainLength: 50
genChainLengthFlux: 50
numRows: 60
numCols: 60
cellWidth: 10
startRow: 0
startCol: 0
endRow: (numRows-1)
endCol: (numCols-1)
</echo>
<java classname="${mainClass}" classpath="build" fork="true" />
</target>
<target name="clean" description="delete unnecessary files and directories">
<delete dir="build" quiet="true" />
<delete dir="javadoc" quiet="true" />
</target>
<target name="javadoc" depends="compile" description="create the javadoc">
<delete dir="javadoc" quiet="true" />
<javadoc destdir="javadoc" author="true" version="true" use="true" >
<fileset dir="src" includes="**/*.java"/>
<classpath>
<pathelement location="~/public_html/cs56/W14/${env.USER}/cs56-games-maze"/>
</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="javadoc"/>
</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} if on CSIL</echo>
<echo> or if not on CSIL, try file:///${javadocDest}/index.html</echo>
</target>
<target name="test" depends="compile" description="run the JUnit tests">
<junit haltonerror="no" haltonfailure="no">
<classpath refid="project.class.path" />
<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>
</project>