-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
103 lines (91 loc) · 4.15 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
<project name="TreeBuildingSurvey" default="jarfile" basedir=".">
<property name="build.dir" value="${basedir}/bin" />
<property name="src.dir" value="${basedir}/src" />
<property name="lib.dir" value="${basedir}/lib" />
<property name="images.dir" value="/tbs/images/*.*"/>
<property name="properties.dir" value="/tbs/properties/*.properties"/>
<property name="javadoc.dir" value="${basedir}/javadoc/"/>
<property name="deploy.dir" value="${basedir}/deploy${version}/"/>
<property name="main.class" value="tbs.TBSApplet"/>
<property name="jardir" value="${basedir}/documents/Applet_Testing"/>
<property name="jarfile" value="${jardir}/TBSRun.jar"/>
<target name="clean">
<delete dir="${build.dir}" description="Deletes the build directory"/>
<delete file="${jarfile}" description="Deletes the last jarfile"/>
</target>
<target name="clean-javadoc">
<delete dir="${javadoc.dir}" description="Deletes the javadoc directory"/>
</target>
<target name="init" description="Creates the build directory">
<mkdir dir="${build.dir}" />
</target>
<target name="compile" description="Compiles the code" depends="clean,init">
<javac srcdir="${src.dir}" destdir="${build.dir}"
debug="on" source="1.5" target="1.5"/>
</target>
<target name="jarfile" depends="compile" description="Makes jar file">
<copy todir="${build.dir}">
<fileset dir="${src.dir}">
<include name="${images.dir}"/>
<include name="${properties.dir}"/>
</fileset>
</copy>
<!-- This calls a perl script that will add revno to the
perl script that get deployed to the test server, still very buggy-->
<!--<exec dir="${basedir}" executable="perl">
<arg line="${basedir}/documents/Perl_Scripts/get_revno.pl"/>
</exec>-->
<jar destfile="${jarfile}" basedir="${build.dir}">
<manifest>
<attribute name="Main-Class" value="${main.class}"/>
</manifest>
</jar>
</target>
<target name="javadoc" depends="clean-javadoc" description="Create Javadocs for the source code">
<mkdir dir="${javadoc.dir}"/>
<javadoc
destdir="${javadoc.dir}"
additionalparam="-J-Dorg.apache.commons.attributes.javadoc.CATaglet.sources=${basedir}">
<taglet
name="org.apache.commons.attributes.javadoc.CATaglet"
path="${ant.home}/lib/commons-attributes-compiler-2.2.jar"
/>
<fileset dir="${src.dir}/" includes="**/*.java" />
</javadoc>
</target>
<!-- you go to http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html and download pscp to your c:\ drive -->
<!-- to run this target user "ant -Dversion=0.4 -Dusername=skones1 -Dpassw=**** deploy" -->
<!-- YOU MUST REMEMBER TO UPDATE THE applet.html FILE WITH CURRENT VERSION INFO!! -->
<target name="deploy">
<mkdir dir="${deploy.dir}"/>
<copy file="${jarfile}" todir="${deploy.dir}"/>
<copy file="${jardir}/applet.html" todir="${deploy.dir}"/>
<copy todir="${deploy.dir}">
<fileset dir="${javadoc.dir}"/>
</copy>
<exec executable="pscp">
<arg line="-batch -pw ${passw} -r ${deploy.dir} ${username}@${hostname}:${server_dir}"/>
</exec>
<delete dir="${deploy.dir}"/>
</target>
<target name="help">
<echo message="clean: Deletes the build directory, ${build.dir}" />
<echo message="clean-javadoc: Deletes the javadoc directory, ${javadoc.dir}" />
<echo message="init: Creates the build directory, ${build.dir}" />
<echo message="compile: Compiles the code" />
<echo message="jarfile: Makes jar file, ${jarfile}" />
<echo message="javadoc: Creates javadocs for the source code" />
</target>
<target name="run_student">
<exec dir="${jardir}" executable="appletviewer">
<arg value="-J-Djava.security.policy=security.policy" />
<arg value="applet.html" />
</exec>
</target>
<target name="run_admin">
<exec dir="${jardir}" executable="appletviewer">
<arg value="-J-Djava.security.policy=security.policy" />
<arg value="adminApplet.html" />
</exec>
</target>
</project>