-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.xml
78 lines (71 loc) · 2.63 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
<project default="compile">
<path id="project.class.path">
<pathelement location="jars/hamcrest-core-1.3.jar"/>
<pathelement location="jars/junit-4.12.jar"/>
<pathelement location="build/classes"/>
</path>
<property name="jar.file" value="build/jar/CS56Parser.jar"/>
<property name="javadoc_absolute_path" location="javadoc"/>
<property name="public_javadoc_absolute_path" location="../cs56-parsing-assignment-javadoc"/>
<target name="clean" description="clean up">
<delete dir="build"/>
</target>
<target name="compile" description="compile the code">
<mkdir dir="build/classes"/>
<javac includeantruntime="false" srcdir="src" destdir="build/classes" debug="on">
<compilerarg value="-Xlint:unchecked"/>
<classpath refid="project.class.path" />
</javac>
</target>
<target name="javadoc" depends="compile" description="generate javadoc">
<mkdir dir="javadoc"/>
<javadoc destdir="javadoc">
<fileset dir="src">
<include name="**/*.java"/>
</fileset>
<classpath refid="project.class.path"/>
<link href="http://docs.oracle.com/javase/8/docs/api/"/>
</javadoc>
<echo>
javadoc written to file://${javadoc_absolute_path}/index.html
copying to ${public_javadoc_absolute_path}/index.html
</echo>
<delete quiet="true">
<fileset dir="${public_javadoc_absolute_path}" />
</delete>
<mkdir dir="${public_javadoc_absolute_path}" />
<copy todir="${public_javadoc_absolute_path}">
<fileset dir="javadoc" />
</copy>
<echo>
javadoc copied to ${public_javadoc_absolute_path}/index.html
TO PUBLISH: cd into that repo, then git add javadoc;
git commit -am "update javadoc"; git push origin gh-pages
</echo>
<delete>
<fileset dir="javadoc"/>
</delete>
</target>
<target name="jar" depends="compile" description="create a jar">
<mkdir dir="build/jar"/>
<jar destfile="${jar.file}" basedir="build/classes">
<manifest>
<attribute name="Main-Class" value="edu.ucsb.cs56.pconrad.parsing.Main"/>
</manifest>
</jar>
</target>
<target name="run" depends="jar" description="run the main">
<java jar="${jar.file}" fork="true"/>
</target>
<target name="test" depends="compile" description="run 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>