-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.xml
110 lines (90 loc) · 4 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
<?xml version="1.0" encoding="utf-8"?>
<project default="compile">
<!-- build.xml for Mantis issue 0000449
name: Chad Simmons and Shany Yeshanov for CS56, W12 -->
<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="F17" />
<property name="issueNum" value="0000449" />
<property name="javaPkg" value="edu.ucsb.cs56.projects.utilities.flashcards" />
<property name="mainClass" value="${javaPkg}.FlashCardApplication" />
<property name="quizFrameClass" value="${javaPkg}.QuizFrame" />
<property name="mainMenuFrameClass" value="${javaPkg}.MainMenuFrame" />
<property name="createDeckFrameClass" value="${javaPkg}.CreateDeckFrame" />
<property name="projectName" value="${course}_${quarter}_${issueNum}" />
<property name="projectPath" value="${course}/${quarter}/issues/${issueNum}" />
<property name="javadocDest" value="${webRoot}/${projectPath}/javadoc" />
<property name="javadocURL" value="${webBaseUrl}/${projectPath}/javadoc" />
<property name="jwsDest" value="${webRoot}/${projectPath}/jws" />
<property name="jwsURL" value="${webBaseUrl}${projectPath}/jws" />
<path id="project.class.path">
<pathelement location="build"/>
<pathelement location="lib/junit-4.8.2.jar"/>
</path>
<target name="compile" description="Compiles the project">
<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="Runs the project through the main method in FlashCardApplication">
<java classname="${mainClass}" fork="true">
<classpath refid="project.class.path" />
</java>
</target>
<target name="clean" description="Removes the build, javadoc, dist, and temp directories">
<defaultexcludes remove="**/*~" />
<delete>
<fileset dir="." includes="**/*~"/>
</delete>
<defaultexcludes default="true" />
<delete dir="build" quiet="true" />
<delete dir="javadoc" quiet="true" />
<delete dir="dist" quiet="true" />
<delete dir="temp" quiet="true" />
</target>
<target name="test" depends="compile" description="Runs the JUnitTests in the Test classes">
<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>
<property name="javadoc_path" location="javadoc"/>
<target name="javadoc" depends="compile" description="Compiles the javadoc and publishes it to a github page">
<delete quiet="true">
<fileset dir="javadoc" />
</delete>
<javadoc destdir="javadoc">
<fileset dir="src/edu/ucsb/cs56/projects/utilities/flashcards" >
<include name="*.java"/>
</fileset>
<classpath refid="project.class.path" />
<link href="https://docs.oracle.com/javase/8/docs/api/" />
</javadoc>
<echo>
javadoc written to file://${javadoc_path}/index.html
</echo>
<echo>
TO PUBLISH: cd into that repo, then git add javadoc;
git commit -m "update javadoc"; git push origin master
</echo>
</target>
<target name="jar" depends="compile" description="Makes a jar file that runs this project">
<mkdir dir="dist" />
<jar destfile="dist/${projectName}.jar" basedir="build" >
<manifest>
<attribute name="Main-Class" value="${mainClass}"/>
</manifest>
</jar>
<signjar jar="dist/${projectName}.jar" alias="flashcardapp" keystore="keystore/flashcardapp.store" storepass="fl@sh!"/>
</target>
</project>