-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
235 lines (207 loc) · 9.53 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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project basedir="." default="build" name="titotrainer">
<property environment="env"/>
<property file="build.properties" />
<property name="junit.output.dir" value="junit"/>
<property name="debuglevel" value="source,lines,vars"/>
<property name="target" value="1.6"/>
<property name="source" value="1.6"/>
<available file="${TOMCAT_HOME}" property="tomcat_found" />
<fail unless="tomcat_found"
message="Tomcat directory not found. Please set it in build.properties."/>
<path id="titotrainer.classpath">
<pathelement location="${TOMCAT_HOME}/lib/servlet-api.jar"/>
<pathelement location="${TOMCAT_HOME}/lib/jasper.jar"/>
<pathelement location="${TOMCAT_HOME}/lib/jsp-api.jar"/>
<pathelement location="${TOMCAT_HOME}/lib/el-api.jar"/>
<pathelement location="${TOMCAT_HOME}/lib/annotations-api.jar"/>
<pathelement location="WEB-INF/classes"/>
<pathelement location="${TOMCAT_HOME}"/>
<pathelement location="WEB-INF/lib/antlr-2.7.6.jar"/>
<pathelement location="WEB-INF/lib/commons-collections-3.2.1.jar"/>
<pathelement location="WEB-INF/lib/commons-io-1.4.jar"/>
<pathelement location="WEB-INF/lib/commons-lang-2.4.jar"/>
<pathelement location="WEB-INF/lib/dom4j-1.6.1.jar"/>
<pathelement location="WEB-INF/lib/hibernate3.jar"/>
<pathelement location="WEB-INF/lib/jakarta-oro-2.0.8.jar"/>
<pathelement location="WEB-INF/lib/javassist-3.4.GA.jar"/>
<pathelement location="WEB-INF/lib/jta-1.1.jar"/>
<pathelement location="WEB-INF/lib/slf4j-api-1.5.3.jar"/>
<pathelement location="WEB-INF/lib/slf4j-nop-1.5.3.jar"/>
<pathelement location="WEB-INF/lib/velocity-1.6.1.jar"/>
<pathelement location="WEB-INF/lib/hsqldb.jar"/>
<pathelement location="WEB-INF/lib/postgresql-8.2-508.jdbc4.jar"/>
<pathelement location="WEB-INF/lib/ejb3-persistence.jar"/>
<pathelement location="WEB-INF/lib/hibernate-commons-annotations.jar"/>
<pathelement location="WEB-INF/lib/hibernate-annotations.jar"/>
<pathelement location="WEB-INF/lib/hibernate-validator.jar"/>
<pathelement location="WEB-INF/lib/hamcrest-core-1.1.jar"/>
<pathelement location="WEB-INF/lib/hamcrest-library-1.1.jar"/>
<pathelement location="WEB-INF/lib/log4j-1.2.15.jar"/>
<pathelement location="WEB-INF/lib/titokone-1.203.jar"/>
<pathelement location="WEB-INF/lib/commons-fileupload-1.2.1.jar"/>
<pathelement location="WEB-INF/lib/mailapi.jar"/>
<pathelement location="WEB-INF/lib/smtp.jar"/>
</path>
<path id="titotrainer.test.classpath">
<path refid="titotrainer.classpath"/>
<pathelement location="WEB-INF/lib/junit-4.6.jar"/>
<pathelement location="WEB-INF/lib/mockito-all-1.5.jar"/>
<pathelement location="tests/classes"/>
</path>
<path id="titotrainer.cli.classpath">
<path refid="titotrainer.classpath"/>
<pathelement location="tools/classes"/>
<pathelement location="WEB-INF/lib/cli/xercesImpl.jar"/>
</path>
<!-- ========== -->
<!-- PROPERTIES -->
<!-- ========== -->
<!-- PATHS -->
<property name = "Path.JavaDoc" location = "./javadoc" />
<property name = "Path.Libraries" location = "./lib" />
<property name = "Path.Source" location = "./WEB-INF/src" />
<property name = "Path.JavaDoc.Style" location = "./dev/javadoc/titotrainer.css" />
<!-- ========= -->
<!-- SHORTCUTS -->
<!-- ========= -->
<target depends = "Documentation.JavaDoc"
description = "Shortcut for target 'Documentation.JavaDoc'"
name = "javadoc"
/>
<target depends = "Database.CreateTestDatabase"
description = "Shortcut for target 'Database.CreateTestDatabase'"
name = "testdb"
/>
<!-- ================ -->
<!-- DATABASE TARGETS -->
<!-- ================ -->
<target depends = "build-tools"
description = "Creates the tables according to the schema"
name = "Database.CreateSchema"
>
<echo>Creating new database schema</echo>
<java classname = "fi.helsinki.cs.titotrainer.app.tools.SchemaTool"
classpathref = "titotrainer.cli.classpath"
>
<arg value = "exec" />
<arg value = "create" />
</java>
</target>
<target depends = "Database.DropSchema,Database.CreateSchema,Database.InsertTestdata"
description = "Creates a database filled with data for testing"
name = "Database.CreateTestDatabase"
/>
<target depends = "build-tools"
description = "Drops the existing database schema"
name = "Database.DropSchema"
>
<echo>Drop existing schema!</echo>
<java classname = "fi.helsinki.cs.titotrainer.app.tools.SchemaTool"
classpathref = "titotrainer.cli.classpath"
>
<arg value = "exec" />
<arg value = "drop" />
</java>
</target>
<target depends = "build-tools"
description = "Inserts test-data into the database"
name = "Database.InsertTestdata"
>
<java classname = "fi.helsinki.cs.titotrainer.app.tools.InsertTestDbData"
classpathref = "titotrainer.cli.classpath"
/>
</target>
<!-- ===================== -->
<!-- DOCUMENTATION TARGETS -->
<!-- ===================== -->
<target description = "Creates the JavaDoc Documentation"
name = "Documentation.JavaDoc"
>
<mkdir dir="${Path.JavaDoc}" />
<javadoc destdir = "${Path.JavaDoc}"
sourcepath = "${Path.Source}"
stylesheetfile = "${Path.JavaDoc.Style}"
>
<classpath refid="titotrainer.classpath" />
<doctitle>TitoTrainer 2</doctitle>
<link href = "http://java.sun.com/javase/6/docs/api/" offline = "false" />
</javadoc>
</target>
<target name="init">
<mkdir dir="WEB-INF/classes"/>
<mkdir dir="tests/classes"/>
<mkdir dir="tools/classes"/>
<copy includeemptydirs="false" todir="WEB-INF/classes">
<fileset dir="WEB-INF/src" excludes="**/*.launch, **/*.java"/>
</copy>
<copy includeemptydirs="false" todir="work">
<fileset dir="work" excludes="**/*.launch, **/*.java"/>
</copy>
<copy includeemptydirs="false" todir="tests/classes">
<fileset dir="tests/src" excludes="**/*.launch, **/*.java"/>
</copy>
<copy includeemptydirs="false" todir="tests/classes">
<fileset dir="tests/supportsrc" excludes="**/*.launch, **/*.java"/>
</copy>
<copy includeemptydirs="false" todir="tools/classes">
<fileset dir="tools/src" excludes="**/*.launch, **/*.java"/>
</copy>
<!-- Print the classpath into classpath.txt for the convenience of some CLI scripts -->
<property name="titotrainer.cli.classpath" refid="titotrainer.cli.classpath" />
<echo file="classpath.txt" message="${titotrainer.cli.classpath}" />
</target>
<target name="clean" description="Clean all built files">
<delete dir="WEB-INF/classes"/>
<delete dir="tests/classes"/>
<delete dir="tools/classes"/>
<delete dir="junit"/>
<delete dir="${Path.JavaDoc}"/>
</target>
<target depends="init" name="build" description="Build the project">
<echo message="${ant.project.name}: ${ant.file}"/>
<javac debug="true" debuglevel="${debuglevel}" destdir="WEB-INF/classes" source="${source}" target="${target}">
<src path="WEB-INF/src"/>
<classpath refid="titotrainer.classpath"/>
</javac>
<javac debug="true" debuglevel="${debuglevel}" destdir="work" source="${source}" target="${target}">
<src path="work"/>
<classpath refid="titotrainer.classpath"/>
</javac>
</target>
<target depends="build" name="build-tests" description="Build all unit tests">
<javac debug="true" debuglevel="${debuglevel}" destdir="tests/classes" source="${source}" target="${target}">
<src path="tests/src"/>
<src path="tests/supportsrc"/>
<classpath refid="titotrainer.test.classpath"/>
</javac>
</target>
<target depends="build" name="build-tools" description="Build all CLI tools">
<javac debug="true" debuglevel="${debuglevel}" destdir="tools/classes" source="${source}" target="${target}">
<src path="tools/src"/>
<classpath refid="titotrainer.cli.classpath"/>
</javac>
</target>
<target name="test" depends="build-tests" description="Run all unit tests">
<mkdir dir="${junit.output.dir}"/>
<junit fork="yes" printsummary="yes">
<formatter type="xml"/>
<jvmarg line="-ea"/>
<classpath refid="titotrainer.test.classpath" />
<batchtest todir="${junit.output.dir}">
<fileset dir="tests/src" />
</batchtest>
</junit>
</target>
<target name="testreport" depends="test" description="Make a jUnit report">
<junitreport todir="${junit.output.dir}">
<fileset dir="${junit.output.dir}">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="${junit.output.dir}"/>
</junitreport>
</target>
</project>
<!-- =========== -->
<!-- END OF FILE -->
<!-- =========== -->