-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.xml
246 lines (214 loc) · 8.23 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
236
237
238
239
240
241
242
243
244
245
246
<!--
===================================================================
IPS Server build
===================================================================
-->
<project name="ips_server" default="compile">
<!-- environment -->
<property environment="env" />
<property file="datanucleus.properties" />
<property name="project.location" location="." />
<property name="project.build.debug" value="on" />
<property name="Name" value="ips_server" />
<property name="name" value="${Name}" />
<property name="version" value="0.1" />
<!-- project workspace directories -->
<property name="java.dir" value="src/" />
<property name="lib.dir" value="lib" />
<!-- compile properties -->
<property name="classes.dir" value="target/classes" />
<!-- <property name="classes.dir" value="target/classes"/> -->
<property name="classes.dir.data" value="target/classes/ips/data" />
<!--
===================================================================
Classpath properties
===================================================================
-->
<!-- the classpath for running -->
<path id="lib.classpath">
<fileset dir="${lib.dir}">
<include name="**/*.jar" />
</fileset>
<pathelement location="${classes.dir}" />
<pathelement location="${basedir}" />
</path>
<!-- the classpath for the compile -->
<path id="compile.classpath">
<pathelement location="${classes.dir}" />
<path refid="lib.classpath" />
</path>
<!--
===================================================================
TARGET : clean
===================================================================
-->
<target name="clean">
<delete includeEmptyDirs="true" quiet="true">
<fileset dir="${classes.dir}" includes="**/*.class,**/*.properties,**/*.*" />
<fileset dir="${basedir}" includes="datanucleus.log" />
</delete>
</target>
<!--
===================================================================
TARGET : prepare
===================================================================
-->
<target name="prepare">
<mkdir dir="${classes.dir}" />
</target>
<!--
===================================================================
TARGET : compile.java
===================================================================
-->
<target name="compile" depends="clean,prepare">
<echo message="===================================================================" />
<echo message="Compile configuration:" />
<echo message="java.dir = ${java.dir}" />
<echo message="classes.dir = ${classes.dir}" />
<echo message="===================================================================" />
<javac srcdir="${java.dir}" destdir="${classes.dir}" debug="${project.build.debug}" classpathref="compile.classpath">
<include name="**/*.java" />
<!-- REMOVE THIS IF USING JDK1.5 AND GETTING ERROR -->
<compilerarg value="-proc:none" />
<compilerarg value="-Xbootclasspath/p:lib/jsr166.jar" />
<!--proc:none"-->
</javac>
</target>
<!--
===================================================================
TARGET : copy jdo metadata files
===================================================================
-->
<target name="copy.metadata">
<copy todir="${classes.dir}">
<fileset dir="${java.dir}" includes="**/*.orm" />
</copy>
</target>
<!--
===================================================================
TARGET : enhance
===================================================================
-->
<target name="enhance" depends="compile,copy.metadata">
<!-- define the task enhancer -->
<taskdef name="enhancer" classname="org.datanucleus.enhancer.tools.EnhancerTask">
<classpath refid="compile.classpath" />
</taskdef>
<!-- enhance -->
<enhancer classpathref="compile.classpath" dir="${classes.dir}" verbose="true">
<sysproperty key="log4j.configuration" value="file:log4j.properties" />
<sysproperty key="datanucleus.metadata.validate" value="false" />
<fileset dir="${classes.dir.data}">
<include name="**/*.class" />
</fileset>
</enhancer>
<!--<jar destfile="ips_main.jar">
<fileset dir="${basedir}/target/classes">
<include name="**/*.class"/>
</fileset>
<restrict>
<name name="**/*.class"/>
<archives>
<zips>
<fileset dir="lib" includes="**/*.jar"/>
</zips>
</archives>
</restrict>
</jar>-->
</target>
<!-- SchemaTool "create" -->
<target name="createschema">
<taskdef name="schematool" classname="org.datanucleus.store.schema.SchemaToolTask">
<classpath refid="compile.classpath" />
</taskdef>
<schematool classpathref="compile.classpath" failonerror="true" verbose="true" mode="create" props="${basedir}/datanucleus.properties">
<fileset dir="${basedir}/target/classes">
<include name="**/*.class" />
</fileset>
<sysproperty key="log4j.configuration" value="file:${basedir}/log4j.properties" />
<jvmarg value="-Xbootclasspath/p:lib/jsr166.jar" />
</schematool>
</target>
<!-- SchemaTool "delete" -->
<target name="deleteschema">
<taskdef name="schematool" classname="org.datanucleus.store.schema.SchemaToolTask">
<classpath refid="compile.classpath" />
</taskdef>
<schematool classpathref="compile.classpath" failonerror="true" fork="true" verbose="true" mode="delete" props="${basedir}/datanucleus.properties">
<fileset dir="${basedir}/target/classes">
<include name="**/*.class" />
</fileset>
<sysproperty key="log4j.configuration" value="file:${basedir}/log4j.properties" />
<jvmarg value="-Xbootclasspath/p:lib/jsr166.jar" />
</schematool>
</target>
<!-- SchemaTool "dbinfo" -->
<target name="schemainfo">
<taskdef name="schematool" classname="org.datanucleus.store.schema.SchemaToolTask">
<classpath refid="compile.classpath" />
</taskdef>
<schematool classpathref="compile.classpath" failonerror="true" fork="true" verbose="true" mode="dbinfo" props="${basedir}/datanucleus.properties">
<fileset dir="${basedir}/target/classes">
<include name="**/*.class" />
</fileset>
<sysproperty key="log4j.configuration" value="file:${basedir}/log4j.properties" />
</schematool>
</target>
<!--
===================================================================
TARGETS FOR RUNNING THE TESTS
===================================================================
-->
<!-- Run the data upload script -->
<target name="upload-data" description="Run the data upload script" depends="enhance">
<java classname="ips.data.upload.UploadScript" classpathref="lib.classpath" fork="true">
<jvmarg value="-Xbootclasspath/p:lib/jsr166.jar" />
</java>
</target>
<!-- Run the database tests -->
<target name="database-tests" description="Run the database tests" depends="enhance">
<java classname="ips.data.test.DatabaseTest" classpathref="lib.classpath" fork="true">
<jvmarg value="-Xbootclasspath/p:lib/jsr166.jar" />
</java>
</target>
<!-- Run the database analysis -->
<target name="datastore-analysis" description="Run the datastore analysis" depends="enhance">
<java classname="ips.other.DataStoreAnalysis" classpathref="lib.classpath" fork="true">
<jvmarg value="-Xbootclasspath/p:lib/jsr166.jar" />
</java>
</target>
<!-- Run the nearest-neighbors test -->
<target name="nn-test" description="Run the nearest-neighbors tests" depends="enhance">
<java classname="ips.algortihm.test.NNTest" classpathref="lib.classpath" fork="true">
<jvmarg value="-Xbootclasspath/p:lib/jsr166.jar" />
</java>
</target>
<!-- Run the bayes test -->
<target name="bayes-test" description="Run the bayes tests" depends="enhance">
<java classname="ips.algortihm.test.BayesTest" classpathref="lib.classpath" fork="true">
<jvmarg value="-Xbootclasspath/p:lib/jsr166.jar" />
</java>
</target>
<!--<jar destfile="ips_main.jar">
<fileset dir="${basedir}/target/classes">
<include name="**/*.class"/>
</fileset>
<restrict>
<name name="**/*.class"/>
<archives>
<zips>
<fileset dir="lib" includes="**/*.jar"/>
</zips>
</archives>
</restrict>
</jar>-->
<target name="war" depends="enhance">
<war destfile="ipsserver_tomcat.war" webxml="WebContent/WEB-INF/web.xml">
<fileset dir="WebContent" />
<lib dir="lib" />
<classes dir="target/classes" />
<classes dir="config" />
</war>
</target>
</project>