[go: up one dir, main page]

Menu

[r3]: / trunk / build / build.xml  Maximize  Restore  History

Download this file

389 lines (308 with data), 15.5 kB

  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
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- Build file for BlueOxygen -->
<project name="cimande" default="war" basedir="..">
<!-- Give user a chance to override without editing this file
(and without typing -D each time they invoke a target) -->
<property file="${basedir}/build/build.properties" />
<property file="${basedir}/build/db.properties" />
<!-- Generic project properties -->
<property name="project.fullname" value="BlueOxygen Cimande Project"/>
<property name="project.name" value="cimande"/>
<property name="project.version" value="1.2.3.1"/>
<!-- Directory settings -->
<property name="src.dir" value="${basedir}/src"/>
<property name="src.java.dir" value="${src.dir}/java"/>
<property name="src.view.dir" value="${src.dir}/template/view"/>
<property name="src.config.dir" location="${src.dir}/config"/>
<property name="build.dir" value="${basedir}"/>
<!--
<property name="build.dest.dir" value="${build.dir}/classes"/>
-->
<property name="build.dest.generated.dir" value="${basedir}/generated"/>
<property name="build.dest.blank.dir" value="${build.dest.generated.dir}/blank"/>
<property name="build.dest.bundle.dir" value="${build.dest.generated.dir}/bundle"/>
<property name="build.dest.jar.dir" value="${basedir}/generated/bundle"/>
<property name="build.dest.dir" value="${build.dest.generated.dir}/classes"/>
<property name="build.dest.view.dir" value="${build.dest.generated.dir}/classes/view"/>
<property name="lib.dir" value="WebContent/WEB-INF/lib"/>
<property name="docs.dir" value="${build.dest.generated.dir}/docs"/>
<property name="javadocs.destdir" value="${docs.dir}/api"/>
<property name="release.dir" value="${project.name}-${project.version}/"/>
<property name="install.war" value="${build.dir}/webapp"/>
<property name="locale.default" value="en"/>
<!-- Miscellaneous settings -->
<property name="locale.default" value="en"/>
<property name="debug" value="on"/>
<property name="optimize" value="on"/>
<property name="deprecation" value="off"/>
<!-- Anakia doc settings -->
<property name="docs.dest" value="docs"/>
<property name="docs.src" value="xdocs"/>
<!-- =================================================================== -->
<!-- Builds Classpath -->
<!-- =================================================================== -->
<path id="classpath">
<!-- include all jar from WebContent library folder -->
<fileset dir="${lib.dir}">
<include name="*.jar"/>
</fileset>
<fileset dir="${build.dir}/lib">
<include name="*.jar"/>
</fileset>
<!-- include generated classes directory to classpath -->
<dirset dir="${build.dest.dir}" />
</path>
<!-- =================================================================== -->
<!-- Initializes the build. -->
<!-- =================================================================== -->
<target name="init" description="Initialization">
<!-- So that we can use the ${TSTAMP}, ${DSTAMP}, ... time stamps
in targets, if need be -->
<tstamp/>
<echo message="---------- ${project.fullname} version ${project.version} ----------"/>
<echo message=""/>
<echo message="java.class.path = ${java.class.path}"/>
<echo message=""/>
<echo message="java.home = ${java.home}"/>
<echo message="ant.home = ${ant.home}"/>
<echo message="user.home = ${user.home}"/>
<echo message=""/>
<echo message="basedir = ${basedir}"/>
<echo message=""/>
<echo message="src.java.dir= ${src.java.dir}"/>
<echo message=""/>
<echo message="build.dir= ${build.dir}"/>
<echo message=""/>
<echo message="locale.default = ${locale.default}"/>
</target>
<!-- ================================================================== -->
<!-- Displays usage information -->
<!-- ================================================================== -->
<target name="usage" description="Displays usage information">
<echo message="Use -projecthelp to see the available targets"/>
</target>
<!-- ================================================================== -->
<!-- Perform clean, fetch, build, test, docs, and deploy -->
<!-- ================================================================== -->
<target name="all" description="Calling All Target " depends="init, build, test">
<echo message="Calling all the targets"/>
</target>
<!-- =================================================================== -->
<!-- Cleans up the distribution -->
<!-- =================================================================== -->
<target name="clean" description="Cleans up the distribution" >
<echo message="Clean out the output directories"/>
<delete quiet="false" includeEmptyDirs="true" failonerror="false">
<fileset dir="${build.dest.generated.dir}" />
</delete>
</target>
<!-- =================================================================== -->
<!-- Build the distribution -->
<!-- =================================================================== -->
<target name="build" depends="init" description="Build the distribution" >
<echo message="Compiling all the code"/>
<echo message=""/>
<echo message="src.java.dir= ${src.java.dir}"/>
<echo message=""/>
<echo message="build.dest.dir= ${build.dest.dir}"/>
<mkdir dir="${build.dest.dir}"/>
<javac
classpathref="classpath"
srcdir="${src.java.dir}/"
destdir="${build.dest.dir}"
debug="${debug}"
deprecation="${deprecation}"
optimize="${optimize}">
</javac>
</target>
<!-- =================================================================== -->
<!-- Generate JavaDoc Documentation -->
<!-- =================================================================== -->
<target
name="javadocs" depends="build"
description="Generates the project's API documentation"
>
<mkdir dir="${javadocs.destdir}"/>
<javadoc
sourcepath="${src.java.dir}"
destdir="${javadocs.destdir}"
packagenames="org.blueoxygen.*"
author="true"
private="false"
version="true"
use="true"
windowtitle="${project.fullname} API"
doctitle="${project.fullname}"
bottom="Copyright &#169; ${year}, BlueOxygen Foundation. All Rights Reserved."
>
<classpath refid="classpath"/>
</javadoc>
</target>
<!-- =================================================================== -->
<!-- Ship the WARs and soon to the execution -->
<!-- =================================================================== -->
<target name="deploy" description="Ship the binary to the execution" >
<echo message="Deploying the code"/>
</target>
<!-- =================================================================== -->
<!-- Run the junit test -->
<!-- =================================================================== -->
<target name="test" description="Test the distribution" >
<echo message="Testing"/>
</target>
<target name="update-schema" depends="init" description="Update the database schema">
<path id="update.schema.classpath">
<path refid="classpath"/>
<pathelement path="${build.dest.dir}"/>
<pathelement path="${src.config.dir}"/>
</path>
<taskdef name="update-schema" classpathref="update.schema.classpath"
classname="org.hibernate.tool.hbm2ddl.SchemaExportTask"/>
<update-schema quiet="no" text="no" drop="no"
config="${build.dir}/src/config//hibernate.cfg.xml" />
<echo message="Cimande schema updated"/>
</target>
<target name="create-schema"
description="Generates DB schema with hbm2ddl."
depends="init, build">
<!--
<mkdir dir="${build.dir}/generated/sql"/>
-->
<taskdef classpathref="classpath" name="hibernatetool"
classname="org.hibernate.tool.ant.HibernateToolTask" />
<hibernatetool destdir="${build.dir}/generated/sql">
<annotationconfiguration
configurationfile="${build.dir}/src/config/hibernate.cfg.xml"/>
<!-- list exporters here -->
<!-- outputfilename="cimande-schema.ddl" -->
<hbm2ddl
update="true"
export="true"
drop="true"
delimiter=";"
format="true"
/>
</hibernatetool>
</target>
<!-- =================================================================== -->
<!-- Export from Database to XML -->
<!-- =================================================================== -->
<target name="dbexport" description="dump database to xml" >
<echo message="Dump Database to XML"/>
<mkdir dir="${build.dir}/generated/dbxml"/>
<taskdef
name="dbunit"
classname="org.dbunit.ant.DbUnitTask"
classpathref="classpath"
/>
<dbunit driver="${db.driver}"
url="${db.url}"
userid="${db.user}"
password="${db.password}">
<export
format="xml"
dest="${build.dir}/generated/dbxml/${project.name}-${project.version}-export.xml"/>
<!-- dest="${build.dir}/src/sql/${project.name}-${project.version}-export.xml"/> -->
</dbunit>
</target>
<!-- =================================================================== -->
<!-- Import from XML to Database -->
<!-- =================================================================== -->
<target name="dbimport" description="fill database from xml" >
<echo message="Fill Database from XML"/>
<taskdef name="dbunit" classname="org.dbunit.ant.DbUnitTask" classpathref="classpath" />
<dbunit driver="${db.driver}"
supportBatchStatement="false"
url="${db.url}"
userid="${db.user}"
password="${db.password}">
<operation type="CLEAN_INSERT"
src="${build.dir}/src/sql/${project.name}-${project.version}-export.xml"/>
</dbunit>
</target>
<target name="dbimport-core" description="fill database from xml" >
<echo message="Fill Database from XML"/>
<taskdef name="dbunit" classname="org.dbunit.ant.DbUnitTask" classpathref="classpath" />
<dbunit driver="${db.driver}"
supportBatchStatement="false"
url="${db.url}"
userid="${db.user}"
password="${db.password}">
<operation type="CLEAN_INSERT"
src="${build.dir}/src/sql/cimande-1.2.3-export.xml"/>
</dbunit>
</target>
<target name="create-jar" depends="build" description="Create JAR" >
<echo>Copy template files </echo>
<mkdir dir="${build.dest.view.dir}"/>
<copy todir="${build.dest.view.dir}">
<fileset dir="${src.view.dir}" />
</copy>
<echo>Copy struts xml files to classes</echo>
<mkdir dir="${build.dest.bundle.dir}"/>
<copy todir="${build.dest.dir}">
<fileset dir="${src.java.dir}" includes="*.xml"/>
</copy>
<!-- Create Jar -->
<jar
jarfile="${build.dest.jar.dir}/${project.name}-${project.version}.jar"
basedir="${build.dest.generated.dir}/classes"
/>
</target>
<target name="create-sdk-bundle" depends="create-jar" description="Generate and assemble configuration">
<copy todir="${build.dest.blank.dir}/WebContent/WEB-INF/lib">
<fileset dir="${build.dest.jar.dir}" includes="${project.name}-${project.version}.jar"/>
</copy>
<mkdir dir="${build.dest.blank.dir}/src/config"/>
<copy todir="${build.dest.blank.dir}/src/config">
<fileset dir="${build.dir}/src/config" />
</copy>
<mkdir dir="${build.dest.blank.dir}/src/java"/>
<mkdir dir="${build.dest.blank.dir}/src/template"/>
<mkdir dir="${build.dest.blank.dir}/src/sql"/>
<echo message="Copying .sql to blank/src/sql"/>
<copy todir="${build.dest.blank.dir}/src/sql">
<fileset dir="${build.dir}/src/sql" includes="*.sql"/>
<fileset dir="${build.dir}/src/sql" includes="cimande-1.2.3-export.xml"/>
</copy>
<echo message="Copying eclipse project"/>
<mkdir dir="${build.dest.blank.dir}/.settings"/>
<copy todir="${build.dest.blank.dir}/.settings">
<fileset dir="${build.dir}/.settings" includes="*"/>
</copy>
<copy todir="${build.dest.blank.dir}">
<fileset dir="${build.dir}" includes=".classpath"/>
<fileset dir="${build.dir}" includes=".packaging"/>
<fileset dir="${build.dir}" includes=".project"/>
</copy>
<echo message="Copying WebContent to blank"/>
<mkdir dir="${build.dest.blank.dir}/WebContent"/>
<copy todir="${build.dest.blank.dir}/WebContent">
<fileset dir="${build.dir}/WebContent" />
</copy>
<echo message="Copying ant build to blank"/>
<mkdir dir="${build.dest.blank.dir}/build"/>
<copy todir="${build.dest.blank.dir}/build">
<fileset dir="${build.dir}/build" excludes="spy.log" />
</copy>
<echo message="Copying build lib to blank"/>
<mkdir dir="${build.dest.blank.dir}/lib"/>
<copy todir="${build.dest.blank.dir}/lib">
<fileset dir="${build.dir}/lib" />
</copy>
<jar
jarfile="${build.dest.bundle.dir}/${project.name}-${project.version}-sdk.zip"
basedir="${build.dest.blank.dir}"
/>
</target>
<target name="war" depends="create-sdk-bundle" description="Create web-app WAR">
<mkdir dir="${build.dest.blank.dir}/WebContent/WEB-INF/classes"/>
<copy todir="${build.dest.blank.dir}/WebContent/WEB-INF/classes">
<fileset dir="${build.dir}/src/config" />
</copy>
<war destfile="${build.dest.bundle.dir}/${project.name}-${project.version}.war" webxml="${build.dest.blank.dir}/WebContent/WEB-INF/web.xml">
<fileset dir="${build.dest.blank.dir}/WebContent">
</fileset>
</war>
</target>
</project>