-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
123 lines (98 loc) · 3.73 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
<project default="compile">
<property environment="env"/> <!-- load the environment variables -->
<property name="projectName" value="csil_status" />
<property name="packageName" value="com.nguyenmp.csil" />
<property name="javadocDest" value="javadoc"/>
<property name="version" value="0.0.1"/>
<path id="project.class.path">
<pathelement location="build"/>
<pathelement location="libs/junit-4.11.jar"/>
<pathelement location="libs/jsch-0.1.50.jar"/>
<pathelement location="libs/sqlite-jdbc-3.7.15-M1.jar"/>
</path>
<target name="compile" description="compile my code">
<mkdir dir="build" />
<javac srcdir="src" destdir="build" debug="true" debuglevel="lines,source"
includeantruntime="false" >
<compilerarg value="-Xlint"/>
<classpath refid="project.class.path" />
</javac>
</target>
<target name="topper" depends="compile" description="runs the class Topper" >
<java classname="${packageName}.Topper">
<classpath refid="project.class.path" />
</java>
</target>
<target name="who" depends="compile" description="runs the class WhoIsHere" >
<java classname="${packageName}.WhoIsHere">
<classpath refid="project.class.path" />
</java>
</target>
<target name="init" depends="compile" description="initializes the DB" >
<java classname="${packageName}.DBInitializer" >
<classpath refid="project.class.path" />
</java>
</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">
<!-- 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="loadavg" depends="compile" description="runs the class LoadAvg" >
<java classname="${packageName}.LoadAvgRunner">
<classpath refid="project.class.path" />
</java>
</target>
<target name="uptime" depends="compile" description="runs the class Uptime" >
<java classname="${packageName}.UptimeRunner">
<classpath refid="project.class.path" />
</java>
</target>
<target name="clean" description="delete unnecessary files and directories">
<delete dir="build" failonerror="false" verbose="true" />
<delete dir="dist" failonerror="false" verbose="true" />
<delete dir="javadoc" failonerror="false" verbose="true" />
<delete failonerror="false" verbose="true" >
<fileset dir="." includes="*.db" />
</delete>
</target>
<target name="javadoc" depends="compile" description="generate Javadoc documentation">
<delete dir="javadoc" quiet="true" />
<javadoc destdir="javadoc" author="true" version="true" use="true" >
<classpath>
<fileset dir="libs"/>
</classpath>
<fileset dir="src" includes="**/*.java"/>
</javadoc>
</target>
<target name="rebuild" depends="clean, compile"/>
<target name="dist" depends="rebuild, javadoc" description="generates the jar file for distribution">
<jar jarfile="dist/csil-status-${version}-javadocs.jar">
<fileset dir="javadoc" >
<exclude name="**/Credentials.html"/>
</fileset>
</jar>
<jar jarfile="dist/csil-status-${version}-sources.jar">
<fileset dir="src" >
<exclude name="**/Credentials.java"/>
</fileset>
</jar>
<jar jarfile="dist/csil-status-${version}.jar">
<fileset dir="build" >
<exclude name="**/Credentials.class"/>
</fileset>
<archives>
<zips>
<fileset dir="libs" />
</zips>
</archives>
</jar>
</target>
</project>