-
Notifications
You must be signed in to change notification settings - Fork 10
/
build.xml
81 lines (70 loc) · 2.82 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
<project default="compile">
<property environment="env"/>
<property name="project" value="cs56-games-minesweeper" />
<property name="classesDir" value="build/classes"/>
<property name="distDir" value="build/dist"/>
<property name="libDir" value="lib"/>
<property name="resourceDir" value="resources"/>
<property name= "JarMainEntry" value="MainEntry"/>
<property name="MainClassText" value="TextGame" />
<property name="MainClassGui" value="MineGUI" />
<path id="compile.path">
<pathelement path="${classesDir}"/>
<fileset dir="${libDir}"/>
</path>
<path id="run.path">
<pathelement path="${classesDir}"/>
<fileset dir="${libDir}">
<exclude name="junit*.jar"/>
</fileset>
</path>
<target name="compile" description="compile code">
<mkdir dir="${classesDir}"/>
<javac srcdir="src" destdir="${classesDir}" includeantruntime="false" debug="true" debuglevel="lines,vars,source">
<classpath refid="compile.path"/>
</javac>
</target>
<target name="clean" description="delete build and javadoc directories">
<delete dir="build" quiet="true"/>
<delete dir="javadoc" quiet="true"/>
</target>
<target name="javadoc" depends="compile" description="create javadoc">
<delete dir="docs/javadoc" quiet="true"/>
<javadoc destdir="docs/javadoc" author="true" version="true" use="true" >
<fileset dir="src" includes="**/*.java"/>
<classpath refid="compile.path"/>
</javadoc>
</target>
<target name="test" depends="compile" description="runs test classes">
<junit haltonerror="no" haltonfailure="no">
<classpath refid="compile.path"/>
<batchtest>
<fileset dir="src/">
<!-- this will pick up every class with a name including Test -->
<include name="**/*Test*"/>
</fileset>
</batchtest>
<formatter type="plain" usefile="false"/>
</junit>
</target>
<target name="mine" depends="compile" description="runs the class MineGUI for graphical minesweeper">
<java classname="edu.ucsb.cs56.projects.games.minesweeper.gui.${MainClassGui}" fork="true">
<classpath refid="run.path"/>
</java>
</target>
<target name="textmine" depends="compile" description="runs the class TextGame for command-line minesweeper">
<java classname="edu.ucsb.cs56.projects.games.minesweeper.text.${MainClassText}" fork="true">
<classpath refid="run.path"/>
</java>
</target>
<target name= "jar" depends="compile" description= "outputs project as a jar">
<mkdir dir="${distDir}"/>
<jar destfile="${distDir}/Minesweeper.jar" basedir="${classesDir}" excludes="**/tests/**" update="no" filesonly="yes">
<manifest>
<attribute name="Main-Class" value="edu.ucsb.cs56.projects.games.minesweeper.main.${JarMainEntry}"/>
</manifest>
<zipgroupfileset dir="${libDir}" includes="*.jar" excludes="junit*.jar"/>
<fileset dir="${resourceDir}"/>
</jar>
</target>
</project>