forked from ucsb-cs56-projects/cs56-games-memory-card
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
105 lines (89 loc) · 3.96 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
<project default ="compile">
<!-- build.xml for Memory Card Game, S12, CS56
name: Bryce McGaw and Jonathan Yau
name: Mathew Glodack, Christina Morris, S13, CS56
-->
<property environment="env"/> <!-- load environment vars -->
<property name="webRoot" value="${env.HOME}/public_html/cs56/13S/${env.USER}/games_memory_card" />
<property name="webBaseURL" value="UCSB-CS56-Projects.github.io" />
<property name="webBaseURL1" value="https://foo.cs.ucsb.edu/56mantis/view.php?id=805" />
<property name="course" value="cs56" />
<property name="quarter" value="13S" />
<property name="projectName" value="memorycard" />
<property name="projectPath" value="${course}/projects/games/${projectName}"/>
<property name="javadocDest" value="./javadoc" />
<!--property name="javadocDest" value="${webRoot}/${projectName}/javadoc" /-->
<property name="javadocURL" value="${webBaseURL}/${projectName}/javadoc" />
<property name="mainClass" value="edu.ucsb.cs56.projects.games.memorycard.MemoryGameGui" />
<path id="project.class.path">
<pathelement location="build"/>
<pathelement location="lib/junit-4.8.2.jar"/>
</path>
<!-- target that compiles the src codes and make a build folder to store the class file -->
<target name="compile" description="Compiles MemoryCardGame">
<mkdir dir="build" />
<javac srcdir="src" destdir="build" debug="true"
debuglevel="lines,source" includeantruntime="false">
<compilerarg value="-Xlint:unchecked" />
<classpath refid="project.class.path" />
</javac>
</target>
<!-- target that runs the program -->
<target name="run" description="Runs MemoryCardGame" depends="compile,jar">
<java jar="dist/${course}_${quarter}_${projectName}.jar" classpath="build" fork="true" />
</target>
<!-- target that deletes unnecessary files and directories -->
<target name="clean" description="Deletes unnecessary files and dir" >
<delete failonerror="false" verbose="true">
<fileset dir="build" includes="**/*.class"/>
</delete>
<delete dir="javadoc" quiet="true" />
</target>
<!-- target that generates javadoc files for MemoryCardGame -->
<target name="javadoc" description="Generates JavaDoc files for MemoryCardGame" depends="compile">
<delete dir="javadoc" quiet="true" />
<javadoc destdir="javadoc" author="true" version="true" use="true">
<fileset dir="src" includes="**/*.java" />
<classpath refid="project.class.path" />
</javadoc>
<mkdir dir="${javadocDest}"/>
<!-- Removed following line when making javadoc in root, not sure what it was for before -->
<!-- delete quiet="true" dir="${javadocDest}" /-->
<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}</echo>
</target>
<!-- target that create a jar file -->
<target name="jar" description = "Creates a jar file" depends="compile">
<mkdir dir="dist" />
<copy todir="build/images">
<fileset dir="images"/>
</copy>
<jar destfile="dist/${course}_${quarter}_${projectName}.jar"
basedir="build" >
<manifest>
<attribute name="Main-Class" value="${mainClass}" />
</manifest>
</jar>
</target>
<!-- target that runs Junit Tests -->
<target name="test" description="Run JUnit tests on MemoryCardGame" depends="compile">
<junit haltonerror="no" haltonfailure="no">
<classpath refid="project.class.path" />
<batchtest fork="yes">
<fileset dir="src">
<include name="**/*Test.java"/>
</fileset>
</batchtest>
<formatter type="plain" usefile="false"/>
</junit>
</target>
</project>