-
Notifications
You must be signed in to change notification settings - Fork 10
/
build.xml
108 lines (95 loc) · 3.62 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
<project default="compile">
<property environment="env"/>
<!-- load the environment variables -->
<property name="webRoot" value="${env.HOME}/public_html/cs56/projects/utilities"/>
<property name="webBaseUrl" value="http://www.cs.ucsb.edu/~${env.USER}/cs56/projects/utilities"/>
<property name="projectName" value="Cryptography"/>
<property name="javadocDest" value="${webRoot}/${projectName}/javadoc"/>
<property name="javadocURL" value="${webBaseUrl}/${projectName}/javadoc"/>
<path id="project.class.path">
<pathelement location="build"/>
<pathelement location="lib/JTattoo-1.6.11.jar"/>
<pathelement location="lib/junit-4.8.2.jar"/>
</path>
<target name="compile" description="compile the code">
<mkdir dir="build" />
<javac srcdir="src"
destdir="build"
includeantruntime="false"
debug="true"
classpathref="project.class.path"
debuglevel="lines,vars,source">
<classpath refid="project.class.path" />
</javac>
</target>
<target name="run" depends="compile" description="Run the project">
<java classname="edu.ucsb.cs56.projects.utilities.cryptography.CryptographyGUI"
classpathref="project.class.path"
classpath="build" fork="true"/>
</target>
<target name="clean" description="delete unnecessary files and directories">
<delete failonerror="false" verbose="true">
<fileset dir="build" includes="*.class"/>
</delete>
<delete dir="javadoc" quiet="true"/>
<delete dir="build" quiet="true"/>
<delete dir="dist" quiet="true"/>
</target>
<property name="javadoc_absolute_path" location="javadoc"/>
<property name="public_javadoc_absolute_path" location="../cs56_utilities_cryptography_javadoc/javadoc"/>
<target name="javadoc" depends="compile" description="generate javadoc">
<mkdir dir="javadoc"/>
<delete>
<fileset dir="javadoc" />
</delete>
<javadoc destdir="javadoc">
<fileset dir="src/edu/ucsb/cs56/projects/utilities/cryptography" >
<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>
</target>
<target name="test" depends="compile" description="run junit tests">
<junit haltonerror="no" haltonfailure="no">
<classpath>
<pathelement location="lib/junit-4.8.2.jar"/>
<pathelement location="build/"/>
</classpath>
<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>
<target name="jar">
<mkdir dir="dist" />
<jar destfile="dist/cs56-utilities-cryptography.jar"
basedir="src/edu/ucsb/cs56/projects/utilities/cryptography"
includes="edu/ucsb/cs56/projects/utilities/cryptography/**"
>
<manifest>
<attribute name="Main-Class" value="com.edu.ucsb.cs56.projects.utilities.cryptography"/>
</manifest>
</jar>
</target>
</project>