forked from KevinL123/cs56-utilities-binary-clock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
127 lines (111 loc) · 4.95 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<project default="compile">
<!-- build.xml for choice points 2, W12, CS56
name: Peter Bennion -->
<property environment="env"/> <!-- load the environment variables -->
<property name="webRoot" value="${env.HOME}/public_html/cs56" />
<property name="mantisWebRoot" value="${env.HOME}/public_html/cs56/W12/issues/0000548" />
<property name="webBaseURL" value="http://www.cs.ucsb.edu/~${env.USER}/cs56" />
<property name="mantisWebBaseURL" value="http://www.cs.ucsb.edu/~${env.USER}/cs56/W12/issues/0000548" />
<property name="projectName" value="cp2" />
<property name="mainClass" value="edu.ucsb.cs56.projects.utilities.cs56_utilities_binary_clock.BinaryClock" />
<property name="javadocDest" value="${webRoot}/${projectName}/javadoc" />
<property name="mantisJavadocDest" value="${mantisWebRoot}/javadoc" />
<property name="javadocURL" value="${webBaseURL}/${projectName}/javadoc" />
<property name="mantisJavadocURL" value="${mantisWebBaseURL}/javadoc" />
<target name="compile" description="compile my code">
<mkdir dir="build" />
<javac srcdir="src" destdir="build" debug="true" debuglevel="lines,source" includeantruntime="false">
<classpath>
<pathelement location="build" />
<pathelement location="./lib/junit-4.8.2.jar"/>
</classpath>
</javac>
</target>
<target name="jar" depends="compile">
<mkdir dir="dist" />
<jar destfile="dist/${projectName}.jar" basedir="build">
<manifest>
<attribute name="Main-Class" value="${mainClass}"/>
</manifest>
</jar>
</target>
<target name="mantisJavadoc" depends="compile">
<delete dir="javadoc" quiet="true" />
<javadoc destdir="javadoc" author="true" version="true" use="true" >
<fileset dir="src" includes="**/*.java"/>
<classpath>
<pathelement location="./lib/junit-4.8.2.jar"/>
</classpath>
</javadoc>
<delete quiet="true" dir="${mantisJavadocDest}" />
<copy todir="${mantisJavadocDest}" >
<fileset dir="javadoc"/>
</copy>
<chmod dir="${mantisJavadocDest}" perm="755" type="dir" includes="**" />
<chmod dir="${mantisJavadocDest}" perm="755" type="file" includes="**/*" />
<echo>Javadoc deployed to ${mantisJavadocURL}</echo>
</target>
<target name="run" depends="compile" description="run the main class">
<java classname="${mainClass}" fork="true" >
<classpath>
<pathelement location="build" />
<pathelement location="./lib/junit-4.8.2.jar"/>
</classpath>
</java>
</target>
<target name="mantisJws" depends="compile,jar">
<delete dir="${mantisWebRoot}/jws" />
<mkdir dir="${mantisWebRoot}/jws" />
<copy todir="${mantisJwsDest}" file="dist/${projectName}.jar" />
<copy todir="${mantisJwsDest}" >
<fileset dir="jws" includes="*.html"/>
<fileset dir="jws" includes="*.jnlp"/>
<fileset dir="jws" includes="*.png"/>
<fileset dir="jws" includes=".htaccess"/>
</copy>
<echo>Java web start at ${mantisJwsURL}</echo>
</target>
<target name="test" description="Test using JUnit" depends="compile">
<junit haltonerror="no" haltonfailure="no">
<classpath>
<pathelement location="./lib/junit-4.8.2.jar"/>
<pathelement location="build"/>
</classpath>
<batchtest fork="yes">
<fileset dir="src">
<include name="**/*Test.java"/>
</fileset>
</batchtest>
<formatter type="plain" usefile="false" />
</junit>
</target>
<target name="clean" description="delete all compiled .class files">
<delete dir="build" quiet="true" />
<delete dir="dist" quiet="true" />
<delete dir="javadoc" quiet="true" />
<delete dir="temp" quiet="true" />
<delete file="numberedsource.txt" quiet="true" />
</target>
<target name="javadoc" depends="compile">
<delete dir="javadoc" quiet="true" />
<javadoc destdir="javadoc" author="true" version="true" use="true" >
<fileset dir="src" includes="**/*.java"/>
<classpath>
<pathelement location="./lib/junit-4.8.2.jar"/>
</classpath>
</javadoc>
<delete quiet="true" dir="${javadocDest}" />
<copy todir="${javadocDest}" >
<fileset dir="javadoc"/>
</copy>
<chmod dir="${javadocDest}" perm="755" type="dir" includes="**" />
<chmod dir="${javadocDest}" perm="755" type="file" includes="**/*" />
<echo>Javadoc deployed to ${javadocURL}</echo>
</target>
<target name="linenumbers" description="Creates a file containing all source files with line numbers">
<exec executable="bash">
<arg value="-c"/>
<arg value='tree -ifQ src | grep \.java\"$ | xargs pr -n > numberedsource.txt'/>
</exec>
</target>
</project>