-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild.xml
91 lines (78 loc) · 3.38 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
<project default="compile">
<!-- build.xml for Mantis issue 0000473
name: Jeremy White and Andrew Cooney for CS56, W12 -->
<!-- updated in F16 -->
<property environment="env"/>
<!-- load the environment variables -->
<property name="webRoot" value="${env.HOME}/public_html/"/>
<property name="webBaseUrl" value="http://www.cs.ucsb.edu/~${env.USER}"/>
<property name="course" value="cs56"/>
<property name="quarter" value="F16"/>
<property name="issueNum" value="0000473"/>
<property name="projectName" value="dealer"/>
<property name="projectPath" value="${course}/${quarter}/issues/${issueNum}"/>
<property name="javadocDest" value="${webRoot}/${projectPath}/javadoc"/>
<property name="javadocURL" value="${webBaseUrl}/${projectName}/javadoc"/>
<property name="fullPkg" value="edu.ucsb.cs56.projects.games.${projectName}" />
<property name="mainClass" value="${fullPkg}.Main"/>
<property name="mainClassGUI" value="${fullPkg}.MainGui"/>
<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" debug="true" debuglevel="lines,source" includeantruntime="false">
<classpath refid="project.class.path" />
</javac>
</target>
<target name="run" depends="compile" description="run program">
<java classname="${mainClass}" classpath="build" fork="true" />
</target>
<target name="runGUI" depends="compile" description="run GUI of program">
<java classname="${mainClassGUI}" classpath="build" fork="true" />
</target>
<target name="clean" description="Clean up directory">
<delete failonerror="false" verbose="true" dir="build" />
<delete dir="javadoc" quiet="true"/>
<delete dir="dist" quiet="true"/>
<delete dir="download" quiet="true"/>
<delete dir="temp" quiet="true"/>
</target>
<target name="javadoc" depends="compile" description="generate javadoc">
<delete quiet="true">
<fileset dir="javadoc" />
</delete>
<javadoc destdir="javadoc">
<fileset dir="src/edu/ucsb/cs56/projects/games/dealer/" >
<include name="*.java"/>
</fileset>
<classpath refid="project.class.path" />
<link href="https://docs.oracle.com/javase/8/docs/api/" />
</javadoc>
<echo>
TO PUBLISH: cd into that repo, then git add javadoc;
git commit -m "update javadoc"; git push origin gh-pages
</echo>
</target>
<target name="jar" depends="compile" description="make the jar file">
<mkdir dir="dist"/>
<jar destfile="dist/${projectName}.jar" basedir="build">
<manifest>
<!-- <attribute name="Main-Class" value="edu.ucsb.cs56.W12.cooney.${mainClass}"/>-->
<attribute name="Main-Class" value="${mainClassGUI}"/>
</manifest>
</jar>
</target>
<target name="test" depends="compile" description="run a JUnit tests">
<junit haltonerror="no" haltonfailure="no">
<classpath refid="project.class.path" />
<batchtest fork="yes">
<fileset dir="src">
<include name="**/*Test.java" />
</fileset>
</batchtest>
<formatter type="brief" usefile="false" />
</junit>
</target>
</project>