/[volute]/trunk/projects/theory/snapdm/webapp/simdb-browser/build.xml
ViewVC logotype

Contents of /trunk/projects/theory/snapdm/webapp/simdb-browser/build.xml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 687 - (show annotations)
Thu Jul 10 10:43:13 2008 UTC (12 years, 4 months ago) by bourges.laurent
File MIME type: text/xml
File size: 12069 byte(s)
add missing static files
1 <?xml version="1.0" encoding="UTF-8"?>
2
3 <project name="SimDB/Browser" default="about" basedir=".">
4
5 <description>
6 SimDB/Browser build file
7 </description>
8
9
10 <!-- set global properties for this build -->
11
12 <!-- loads config file -->
13 <property file="build.properties"/>
14 <fail unless="build.file" message="bad configuration in build.properties !" />
15
16
17
18
19 <!-- path & files -->
20 <property name="root" location="."/>
21
22 <property name="properties" location="./properties"/>
23
24
25 <property name="sources" location="./src"/>
26 <property name="web-content" location="./web"/>
27
28 <property name="libs" location="./lib"/>
29
30 <property name="dist" location="./dist"/>
31
32 <property name="javadoc" location="${dist}/doc" />
33
34
35 <!-- simdb project -->
36 <property name="simdb.project" location="${simdb.project.path}"/>
37
38
39 <!-- compile Sources -->
40 <property name="build" location="./build"/>
41 <property name="build.src" location="${build}/src"/>
42
43
44 <!-- classpath -->
45 <path id="project.class.path">
46
47 <fileset dir="${libs}">
48 <include name="*.jar"/>
49 </fileset>
50
51 <!-- Java API for JavaServer Pages - 2.0.public_draft -->
52 <pathelement location="${libs}/server/jsp-api.jar"/>
53 <!-- Java API for Servlets - 2.4.public_draft -->
54 <pathelement location="${libs}/server/servlet-api.jar"/>
55 </path>
56
57
58 <!-- checks if build is necessary : java source code & libraries -->
59 <uptodate property="build.notRequired">
60 <srcfiles dir= "${sources}" includes="**/*"/>
61 <srcfiles dir= "${web-content}" includes="**/*"/>
62 <srcfiles dir= "${properties}" includes="**/*"/>
63 <srcfiles dir= "${libs}" includes="**/*.jar"/>
64 <mapper type="merge" to="${dist}/${build.file}"/>
65 </uptodate>
66
67
68
69
70 <!-- targets -->
71
72 <!-- target about : -->
73 <target name="about" depends="init" description="show information for public targets">
74 <echo>available ant targets : </echo>
75 <echo>-------------------------------------------------------------------------------</echo>
76 <echo> - makeAll : makes all tasks (clean, compile, jar, javadoc) </echo>
77 <echo> - forceMakeAll : CLEANS outputs and then make all transformations (makeAll) </echo>
78 <echo> - makeDoc : makes javadoc only </echo>
79 <echo>-------------------------------------------------------------------------------</echo>
80 </target>
81
82
83
84
85 <!-- target init : timestamp -->
86 <target name="init">
87 <tstamp>
88 <format property="build.date" pattern="dd/MM/yyyy HH:mm:ss" />
89 </tstamp>
90
91 <echo>-------------------------------------------------------------------------------</echo>
92 <echo> ${vendor} :: ${title} - ${version} </echo>
93 <echo>-------------------------------------------------------------------------------</echo>
94 <echo> Build File </echo>
95 <echo>-------------------------------------------------------------------------------</echo>
96 <echo> contacts : ${build.by} </echo>
97 <echo> build date : ${build.date} </echo>
98 <echo></echo>
99 <echo> simdb path : </echo>
100 <echo> ${simdb.project} </echo>
101 <echo></echo>
102 <echo> Tomcat Home : ${tomcat.home}</echo>
103 <echo>-------------------------------------------------------------------------------</echo>
104
105 <!-- check simdb build.xml file -->
106 <available property="simdb.check" file="${simdb.project}/build.xml" />
107 <fail unless="simdb.check" message="simdb project does not exist in ${simdb.project} !" />
108
109 </target>
110
111
112
113
114 <!-- target importSimDB : get libraries and properties from simdb project -->
115 <target name="importSimDB">
116
117 <available property="simdb.base.check" file="${simdb.project}/dist/${base.library}" />
118 <fail unless="simdb.base.check" message="simdb project base library is not built !" />
119
120 <available property="simdb.gen.check" file="${simdb.project}/dist/${gen.library}" />
121 <fail unless="simdb.gen.check" message="simdb project gen library is not built !" />
122
123 <ant target="importProperties" />
124 <ant target="importLibraries" />
125 </target>
126
127
128
129
130 <!-- target importProperties : get properties from simdb project -->
131 <target name="importProperties">
132
133 <echo message="update simdb properties from ${simdb.project} ..."/>
134
135 <copy todir="${properties}" preservelastmodified="true" verbose="true">
136 <fileset dir="${simdb.project}/properties">
137 <include name="*.properties"/>
138 <!-- keep log4j different for webapp -->
139 </fileset>
140 </copy>
141
142 <echo message="update simdb properties : done."/>
143 </target>
144
145
146
147
148 <!-- target importLibraries : get libraries from simdb project -->
149 <target name="importLibraries">
150
151 <echo message="update simdb libraries from ${simdb.project} ..."/>
152
153 <copy todir="${libs}" preservelastmodified="true" verbose="true">
154 <fileset dir="${simdb.project}/dist">
155 <include name="${base.library}*"/>
156 <include name="${gen.library}*"/>
157 </fileset>
158 </copy>
159
160 <ant target="processClasspath">
161 <property name="classpath.file" value="${base.library}.classpath" />
162 </ant>
163
164 <ant target="processClasspath">
165 <property name="classpath.file" value="${gen.library}.classpath" />
166 </ant>
167
168 <echo message="update simdb libraries : done."/>
169 </target>
170
171
172
173
174 <!-- generic target -->
175
176 <!-- target checkSource : reads a classpath file and copies libraries into this project -->
177 <target name="processClasspath" description="reads a classpath file and copies libraries into this project">
178 <echo>processClasspath : ${libs}/${classpath.file}</echo>
179
180 <property file="${libs}/${classpath.file}"/>
181 <echo message="module classpath = ${module.classpath}" />
182 <fail unless="module.classpath" message="bad configuration in ${classpath.file} !" />
183
184 <copy todir="${libs}" flatten="true" preservelastmodified="true" verbose="true">
185 <path>
186 <pathelement path="${module.classpath}"/>
187 </path>
188 </copy>
189
190 <delete file="${libs}/${classpath.file}" />
191
192 <echo>processClasspath : done.</echo>
193 </target>
194
195
196
197
198 <!-- target cleanImport : clean imported files -->
199 <target name="cleanImport">
200
201 <echo message="cleaning directory : ${properties} ..." />
202
203 <delete includeemptydirs="false" verbose="true">
204 <fileset dir="${properties}" includes="*.properties"/>
205 </delete>
206
207 <echo message="cleaned directory : ${properties} ." />
208
209 <echo message="cleaning directory : ${libs} ..." />
210
211 <delete includeemptydirs="false" verbose="true">
212 <fileset dir="${libs}" includes="*.jar"/>
213 </delete>
214
215 <echo message="cleaned directory : ${libs} ." />
216
217 </target>
218
219
220
221
222 <!-- target clean : clean build files -->
223 <target name="clean" depends="cleanImport">
224
225 <echo message="creating directories ..." />
226
227 <mkdir dir="${dist}"/>
228 <mkdir dir="${javadoc}"/>
229
230 <echo message="cleaning directory : ${build} ..." />
231
232 <delete includeemptydirs="false" verbose="true">
233 <fileset dir="${build}" includes="**/*"/>
234 </delete>
235
236 <echo message="cleaned directory : ${build} ." />
237
238 <echo message="cleaning directory : ${dist} ..." />
239
240 <delete includeemptydirs="false" verbose="true">
241 <fileset dir="${dist}" includes="**/*"/>
242 </delete>
243
244 <echo message="cleaned directory : ${dist} ." />
245
246 </target>
247
248
249
250
251 <!-- target makeAll : cleans, compiles, packages -->
252 <target name="makeAll" description="make all transformations">
253 <ant target="importSimDB" />
254 <ant target="makeAllIfNeeded" inheritAll="false" />
255 <echo message="makeAll ${title} : done."/>
256 </target>
257
258
259
260
261 <!-- main target : force to makeAll -->
262 <target name="forceMakeAll" depends="clean" description="make all targets (forced)">
263 <ant target="importSimDB" />
264 <ant target="makeAllIfNeeded" inheritAll="false" />
265 <echo>forceMakeAll ${title} : done.</echo>
266 </target>
267
268
269
270
271 <target name="makeAllIfNeeded" depends="init" unless="build.notRequired">
272 <buildnumber file="build.number"/>
273
274 <echo>-------------------------------------------------------------------------------</echo>
275 <echo> Build Number : ${build.number}</echo>
276 <echo>-------------------------------------------------------------------------------</echo>
277
278 <ant target="compile" />
279 <ant target="makeDoc" />
280 <ant target="cleanImport" />
281
282 <echo message="makeAllIfNeeded ${title} : done."/>
283 </target>
284
285
286
287
288 <!-- target makeDoc : creates javadoc from source code -->
289 <target name="makeDoc">
290
291 <echo message="making ${title} javadoc ..."/>
292
293 <javadoc additionalparam="-notimestamp"
294 destdir="${javadoc}"
295 access="private"
296 author="true"
297 use="false"
298 windowtitle="${title} ${version}" >
299
300 <classpath refid="project.class.path"/>
301
302 <fileset dir="${sources}" includes="**/*.java" defaultexcludes="yes" />
303
304 </javadoc>
305
306 <echo message="${title} javadoc : done."/>
307 </target>
308
309
310
311
312 <!-- Compile java files and jar them -->
313 <target name="compile" depends="init" unless="build.notRequired">
314
315 <echo message="compile ${title} ..."/>
316 <echo message="compile from : ${sources}"/>
317 <echo message="compile to : ${build.src}"/>
318
319 <mkdir dir="${build.src}"/>
320
321 <javac sourcepath="" srcdir="${sources}" destdir="${build.src}" listfiles="false"
322 fork="true" verbose="false" encoding="UTF-8"
323 debug="on" deprecation="on" optimize="on" casesensitive="true"
324 source="1.5" target="1.5">
325
326 <classpath refid="project.class.path" />
327
328 <include name="**/*.java"/>
329 </javac>
330
331 <!-- move properties into /classes -->
332 <copy todir="${build.src}" preservelastmodified="true" verbose="true">
333 <fileset dir="${properties}">
334 <include name="*.*"/>
335 </fileset>
336 </copy>
337
338 <!-- move JSTL libs into /lib -->
339 <copy todir="${libs}" preservelastmodified="true" verbose="true">
340 <fileset dir="${libs}/jstl-1.1">
341 <include name="*.jar"/>
342 </fileset>
343 </copy>
344
345 <!-- create a tags folder to put tag files because subversion already uses /tags folder for ubversion tags -->
346 <mkdir dir="${web-content}/WEB-INF/tags"/>
347 <copy todir="${web-content}/WEB-INF/tags" preservelastmodified="true" verbose="true">
348 <fileset dir="${web-content}/WEB-INF/tagfiles">
349 <include name="**/*.tag"/>
350 </fileset>
351 </copy>
352
353 <war destfile="${dist}/${build.file}" webxml="${web-content}/WEB-INF/web.xml" compress="true" roundup="true">
354 <fileset dir="${web-content}">
355 <include name="META-INF/*.*"/>
356 <include name="WEB-INF/tags/**/*.tag"/>
357 <include name="index.html"/>
358 <include name="*.jsp"/>
359 <include name="list/*.jsp"/>
360 <include name="page/*.jsp"/>
361 <include name="show/*.jsp"/>
362 <include name="static/**/*.*"/>
363 <exclude name=".*"/>
364 </fileset>
365 <lib dir="${libs}">
366 <include name="*.jar"/>
367 </lib>
368 <classes dir="${build.src}">
369 <include name="**/*.class"/>
370 <include name="**/*.properties"/>
371 <include name="log4j.*"/>
372 </classes>
373 </war>
374
375 <delete dir="${build.src}"/>
376
377 <delete dir="${web-content}/WEB-INF/tags"/>
378
379 <echo message="compile ${title} : done."/>
380
381 </target>
382
383
384
385
386 <!-- deploys war archive in tomcat -->
387 <target name="deployTomcat" depends="forceMakeAll">
388
389 <!-- check tomcat home -->
390 <available property="tomcat.check" file="${tomcat.home}/conf/server.xml" />
391 <fail unless="tomcat.check" message="tomcat server does not exist in ${tomcat.home} !" />
392
393 <!-- tomcat webapps folder -->
394 <property name="deploy.to" value="${tomcat.home}/webapps"/>
395
396 <delete dir="${deploy.to}/${build.file}" verbose="true"/>
397 <copy file="${dist}/${build.file}" todir="${deploy.to}" verbose="true" />
398 </target>
399
400
401 </project>

msdemlei@ari.uni-heidelberg.de
ViewVC Help
Powered by ViewVC 1.1.26