1 | <?xml version="1.0" encoding="UTF-8"?> |
---|
2 | |
---|
3 | <!-- |
---|
4 | $Id: build.xml 2729 2006-10-12 14:02:06Z jari $ |
---|
5 | |
---|
6 | Copyright (C) 2005-2006 |
---|
7 | Samuel Andersson, Jari Häkkinen, Nicklas Nordborg, Gregory Vincic |
---|
8 | |
---|
9 | Files are copyright by their respective authors. The contributions |
---|
10 | to files where copyright is not explicitly stated can be traced |
---|
11 | with the source code revision system. |
---|
12 | |
---|
13 | This file is part of BASE - BioArray Software Environment. |
---|
14 | Available at http://base.thep.lu.se/ |
---|
15 | |
---|
16 | BASE is free software; you can redistribute it and/or modify it |
---|
17 | under the terms of the GNU General Public License as published by |
---|
18 | the Free Software Foundation; either version 2 of the License, or |
---|
19 | (at your option) any later version. |
---|
20 | |
---|
21 | BASE is distributed in the hope that it will be useful, but |
---|
22 | WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
23 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
24 | General Public License for more details. |
---|
25 | |
---|
26 | You should have received a copy of the GNU General Public License |
---|
27 | along with this program; if not, write to the Free Software |
---|
28 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
---|
29 | 02111-1307, USA. |
---|
30 | --> |
---|
31 | |
---|
32 | <project |
---|
33 | name="BASE2" |
---|
34 | default="main" |
---|
35 | basedir="." |
---|
36 | > |
---|
37 | |
---|
38 | <description> |
---|
39 | Build file for BASE 2.0 |
---|
40 | Main targets: |
---|
41 | main (default): build the core, plugins and Hibernate mappings |
---|
42 | core: build the core and generate Hibernate mappings |
---|
43 | nohibernate: build the core, but do not regenerate the Hibernate mappings |
---|
44 | coreplugins: build the core plugins |
---|
45 | test: build the test programs |
---|
46 | web: build the web client |
---|
47 | migrate: build the migration client |
---|
48 | javadoc: generate documentation |
---|
49 | package: create binary distribution |
---|
50 | all: core, clients, docs |
---|
51 | clean: clean up everything |
---|
52 | </description> |
---|
53 | |
---|
54 | <!-- set global properties for this build --> |
---|
55 | <property name="compilerarg" value="-Xlint:unchecked" /> |
---|
56 | <property name="base.version" value="2.0.1" /> |
---|
57 | <property environment="env" /> |
---|
58 | |
---|
59 | <property name="src" location="src" /> |
---|
60 | <property name="build" location="build" /> |
---|
61 | <property name="dist" location="dist" /> |
---|
62 | <property name="dist.webinf" location="${dist}/www/WEB-INF" /> |
---|
63 | <property name="dist.lib" location="${dist}/www/WEB-INF/lib" /> |
---|
64 | <property name="dist.classes" location="${dist}/www/WEB-INF/classes" /> |
---|
65 | <property name="dist.bin" location="${dist}/bin" /> |
---|
66 | <property name="doc" location="doc" /> |
---|
67 | <property name="lib" location="lib" /> |
---|
68 | <property name="www" location="www" /> |
---|
69 | |
---|
70 | <property name="core.src" location="${src}/core" /> |
---|
71 | <property name="coreplugins.src" location="${src}/plugins/core" /> |
---|
72 | <property name="test.src" location="${src}/test" /> |
---|
73 | <property name="web.src" location="${src}/clients/web" /> |
---|
74 | <property name="migrate.src" location="${src}/clients/migrate" /> |
---|
75 | <property name="install.src" location="${src}/install" /> |
---|
76 | |
---|
77 | <property name="core.build" location="${build}/core" /> |
---|
78 | <property name="coreplugins.build" location="${build}/plugins/core" /> |
---|
79 | <property name="test.build" location="${build}/test" /> |
---|
80 | <property name="migrate.build" location="${build}/clients/migrate" /> |
---|
81 | <property name="install.build" location="${build}/install" /> |
---|
82 | <property name="web.build" location="${build}/clients/web" /> |
---|
83 | <property name="web.inf" location="${www}/WEB-INF" /> |
---|
84 | <property name="jsp.build" location="${build}/jsp" /> |
---|
85 | |
---|
86 | <property name="doc.develop" location="${doc}/api/develop" /> |
---|
87 | <property name="doc.public" location="${doc}/api/public" /> |
---|
88 | |
---|
89 | <path id="core.compile.classpath"> |
---|
90 | <fileset dir="${lib}/compile"> |
---|
91 | <include name="**/*.jar"/> |
---|
92 | </fileset> |
---|
93 | </path> |
---|
94 | |
---|
95 | <path id="plugins.compile.classpath"> |
---|
96 | <path refid="core.compile.classpath"/> |
---|
97 | <pathelement location="${core.build}"/> |
---|
98 | </path> |
---|
99 | |
---|
100 | <path id="test.compile.classpath"> |
---|
101 | <path refid="core.compile.classpath"/> |
---|
102 | <pathelement location="${core.build}"/> |
---|
103 | </path> |
---|
104 | |
---|
105 | <path id="migrate.compile.classpath"> |
---|
106 | <path refid="core.compile.classpath" /> |
---|
107 | <pathelement location="${core.build}" /> |
---|
108 | </path> |
---|
109 | |
---|
110 | <path id="install.compile.classpath"> |
---|
111 | <path refid="core.compile.classpath" /> |
---|
112 | <pathelement location="${core.build}" /> |
---|
113 | <pathelement location="${coreplugins.build}" /> |
---|
114 | </path> |
---|
115 | |
---|
116 | <path id="web.compile.classpath"> |
---|
117 | <path refid="core.compile.classpath"/> |
---|
118 | <pathelement location="${core.build}"/> |
---|
119 | </path> |
---|
120 | |
---|
121 | <path id="hibernatedoclet.classpath"> |
---|
122 | <fileset dir="${lib}/hibernatedoclet"> |
---|
123 | <include name="**/*.jar"/> |
---|
124 | </fileset> |
---|
125 | </path> |
---|
126 | |
---|
127 | <taskdef |
---|
128 | name="hibernatedoclet" |
---|
129 | classname="xdoclet.modules.hibernate.HibernateDocletTask" |
---|
130 | classpathref="hibernatedoclet.classpath" |
---|
131 | description="Task for generating Hibernate mapping files from XDoclet tags" |
---|
132 | /> |
---|
133 | |
---|
134 | <target |
---|
135 | name="all" |
---|
136 | depends="core, test, web, javadoc" |
---|
137 | description="Compile/create everything" |
---|
138 | /> |
---|
139 | |
---|
140 | <target |
---|
141 | name="main" |
---|
142 | depends="core.compile,coreplugins.compile,core.hibernate" |
---|
143 | description="Compile the core and plugins, generate Hibernate mappings" |
---|
144 | /> |
---|
145 | |
---|
146 | <target |
---|
147 | name="core" |
---|
148 | depends="core.compile,core.hibernate" |
---|
149 | description="Compile the core and plugins, generate Hibernate mappings" |
---|
150 | /> |
---|
151 | |
---|
152 | <target |
---|
153 | name="coreplugins" |
---|
154 | depends="coreplugins.compile" |
---|
155 | description="Compile the core plugins" |
---|
156 | /> |
---|
157 | |
---|
158 | <target |
---|
159 | name="nohibernate" |
---|
160 | depends="core.compile" |
---|
161 | description="Compile the core and plugins, assuming Hibernate mappings already exists" |
---|
162 | /> |
---|
163 | |
---|
164 | <target |
---|
165 | name="core.hibernate" |
---|
166 | depends="core.compile" |
---|
167 | description="Generates Hibernate mappings for the core." |
---|
168 | > |
---|
169 | <hibernatedoclet |
---|
170 | destdir="${core.build}" |
---|
171 | excludedtags="@version,@author,@todo" |
---|
172 | mergedir="${core.build}" |
---|
173 | verbose="${xdoclet.verbose}"> |
---|
174 | <fileset dir="${core.src}"> |
---|
175 | <include name="**/*.java"/> |
---|
176 | </fileset> |
---|
177 | <hibernate version="2.0"/> |
---|
178 | </hibernatedoclet> |
---|
179 | |
---|
180 | <replace |
---|
181 | dir="${core.build}" |
---|
182 | > |
---|
183 | <include name="**/*.hbm.xml"/> |
---|
184 | <replacefilter |
---|
185 | token="2.0//EN" |
---|
186 | value="3.0//EN" |
---|
187 | /> |
---|
188 | <replacefilter |
---|
189 | token="2.0.dtd" |
---|
190 | value="3.0.dtd" |
---|
191 | /> |
---|
192 | <replacefilter |
---|
193 | token="outer-join="false"" |
---|
194 | value="fetch="select"" |
---|
195 | /> |
---|
196 | <replacefilter |
---|
197 | token="outer-join="true"" |
---|
198 | value="fetch="join"" |
---|
199 | /> |
---|
200 | <replacefilter |
---|
201 | token="index-many-to-many" |
---|
202 | value="map-key-many-to-many" |
---|
203 | /> |
---|
204 | <replacefilter |
---|
205 | token="<index>" |
---|
206 | value="<list-index>" |
---|
207 | /> |
---|
208 | <replacefilter |
---|
209 | token="</index>" |
---|
210 | value="</list-index>" |
---|
211 | /> |
---|
212 | <replacefilter |
---|
213 | token="composite-index" |
---|
214 | value="composite-map-key" |
---|
215 | /> |
---|
216 | </replace> |
---|
217 | </target> |
---|
218 | |
---|
219 | <target |
---|
220 | name="core.compile" |
---|
221 | depends="" |
---|
222 | description="compile the core source code" |
---|
223 | > |
---|
224 | <mkdir dir="${core.build}"/> |
---|
225 | <javac |
---|
226 | encoding="ISO-8859-1" |
---|
227 | srcdir="${core.src}" |
---|
228 | destdir="${core.build}" |
---|
229 | classpathref="core.compile.classpath" |
---|
230 | debug="true" |
---|
231 | deprecation="true" |
---|
232 | > |
---|
233 | <compilerarg value="${compilerarg}" /> |
---|
234 | </javac> |
---|
235 | <copy todir="${core.build}"> |
---|
236 | <fileset dir="${core.src}"> |
---|
237 | <include name="**/*.xml" /> |
---|
238 | <include name="**/*.dtd" /> |
---|
239 | <include name="**/*.config" /> |
---|
240 | <include name="**/*.properties" /> |
---|
241 | </fileset> |
---|
242 | </copy> |
---|
243 | </target> |
---|
244 | |
---|
245 | <target |
---|
246 | name="coreplugins.compile" |
---|
247 | depends="core.compile" |
---|
248 | description="compile the core plugins" |
---|
249 | > |
---|
250 | <mkdir dir="${coreplugins.build}"/> |
---|
251 | <javac |
---|
252 | encoding="ISO-8859-1" |
---|
253 | srcdir="${coreplugins.src}" |
---|
254 | destdir="${coreplugins.build}" |
---|
255 | classpathref="plugins.compile.classpath" |
---|
256 | debug="true" |
---|
257 | deprecation="true" |
---|
258 | > |
---|
259 | <compilerarg value="${compilerarg}" /> |
---|
260 | </javac> |
---|
261 | </target> |
---|
262 | |
---|
263 | <target |
---|
264 | name="test" |
---|
265 | depends="test.compile" |
---|
266 | description="Compile the test programs" |
---|
267 | /> |
---|
268 | |
---|
269 | <target name="test.compile" |
---|
270 | depends="" |
---|
271 | description="compile the source code for the test programs" |
---|
272 | > |
---|
273 | <mkdir dir="${test.build}"/> |
---|
274 | <javac |
---|
275 | srcdir="${test.src}" |
---|
276 | destdir="${test.build}" |
---|
277 | classpathref="test.compile.classpath" |
---|
278 | debug="true" |
---|
279 | deprecation="true" |
---|
280 | encoding="ISO-8859-1" |
---|
281 | > |
---|
282 | <compilerarg value="${compilerarg}" /> |
---|
283 | </javac> |
---|
284 | <copy todir="${test.build}"> |
---|
285 | <fileset dir="${test.src}"> |
---|
286 | <include name="**/*.*" /> |
---|
287 | <exclude name="**/*.java" /> |
---|
288 | </fileset> |
---|
289 | </copy> |
---|
290 | <chmod dir="${test.build}" includes="*.sh" perm="a+x"/> |
---|
291 | <copy todir="${test.build}"> |
---|
292 | <fileset dir="${src}"> |
---|
293 | <include name="*.config" /> |
---|
294 | <include name="*.properties" /> |
---|
295 | <include name="*.xml" /> |
---|
296 | </fileset> |
---|
297 | </copy> |
---|
298 | <jar |
---|
299 | jarfile="${test.build}/JarPluginAbout.jar" |
---|
300 | basedir="${test.build}" |
---|
301 | includes="JarPluginAbout.class" |
---|
302 | /> |
---|
303 | <jar |
---|
304 | jarfile="${test.build}/JarPlugin.jar" |
---|
305 | basedir="${test.build}" |
---|
306 | includes="JarPlugin*,NullPlugin*" |
---|
307 | excludes="JarPlugin.jar,JarPluginAbout.class" |
---|
308 | manifest="${test.src}/JarPluginManifest.txt" |
---|
309 | /> |
---|
310 | <delete> |
---|
311 | <fileset dir="${test.build}" includes="JarPlugin*" excludes="*.jar" /> |
---|
312 | </delete> |
---|
313 | </target> |
---|
314 | |
---|
315 | <!-- add core to depends if used for real --> |
---|
316 | <target |
---|
317 | name="migrate" |
---|
318 | depends="dist.migrate" |
---|
319 | description="create the Migrate.jar" |
---|
320 | > |
---|
321 | </target> |
---|
322 | |
---|
323 | <target name="dist.migrate" depends="migrate.compile,dist.init" description=""> |
---|
324 | |
---|
325 | <jar basedir="${migrate.build}" jarfile="${dist.bin}/Migrate.jar" includes="**/*.class"> |
---|
326 | </jar> |
---|
327 | <copy todir="${dist.bin}" file="${migrate.src}/migrate_from_1.2.sh" /> |
---|
328 | <chmod file="${dist.bin}/migrate_from_1.2.sh" perm="a+x"/> |
---|
329 | <copy tofile="${dist.classes}/migrate.properties" file="${migrate.src}/migrate.properties.in" /> |
---|
330 | <chmod file="${dist.classes}/migrate.properties" perm="600"/> |
---|
331 | <copy tofile="${dist.classes}/mysql-migration-queries.sql" file="${migrate.src}/sql/mysql-migration-queries.sql" /> |
---|
332 | <chmod file="${dist.classes}/mysql-migration-queries.sql" perm="600"/> |
---|
333 | |
---|
334 | </target> |
---|
335 | |
---|
336 | <target name="migrate.properties" if="migrate.newproperties"> |
---|
337 | <copy tofile="${migrate.build}/migrate.properties" file="${migrate.src}/migrate.properties.in" /> |
---|
338 | <chmod file="${migrate.build}/migrate.properties" perm="600"/> |
---|
339 | </target> |
---|
340 | |
---|
341 | <target name="migrate.compile" description="compile the source code for the migration program"> |
---|
342 | |
---|
343 | <mkdir dir="${migrate.build}" /> |
---|
344 | <javac |
---|
345 | encoding="ISO-8859-1" |
---|
346 | srcdir="${migrate.src}" |
---|
347 | destdir="${migrate.build}" |
---|
348 | classpathref="migrate.compile.classpath" |
---|
349 | debug="true" |
---|
350 | > |
---|
351 | <compilerarg value="${compilerarg}" /> |
---|
352 | </javac> |
---|
353 | <copy todir="${migrate.build}"> |
---|
354 | <fileset dir="${src}"> |
---|
355 | <include name="*.config" /> |
---|
356 | <include name="*.properties" /> |
---|
357 | <include name="*.xml" /> |
---|
358 | </fileset> |
---|
359 | </copy> |
---|
360 | <copy todir="${migrate.build}" file="${migrate.src}/migrate_from_1.2.sh" /> |
---|
361 | <chmod file="${migrate.build}/migrate_from_1.2.sh" perm="a+x"/> |
---|
362 | <condition property="migrate.newproperties"> |
---|
363 | <not> |
---|
364 | <available file="${migrate.build}/migrate.properties"/> |
---|
365 | </not> |
---|
366 | </condition> |
---|
367 | <antcall target="migrate.properties"/> |
---|
368 | |
---|
369 | </target> |
---|
370 | |
---|
371 | <target |
---|
372 | name="install" |
---|
373 | depends="install.compile" |
---|
374 | description="Compile the installation program" |
---|
375 | > |
---|
376 | </target> |
---|
377 | |
---|
378 | <target name="install.compile" |
---|
379 | description="compile the source code for the installation program" |
---|
380 | > |
---|
381 | <mkdir dir="${install.build}" /> |
---|
382 | <javac |
---|
383 | encoding="ISO-8859-1" |
---|
384 | srcdir="${install.src}" |
---|
385 | destdir="${install.build}" |
---|
386 | classpathref="install.compile.classpath" |
---|
387 | debug="true" |
---|
388 | deprecation="true" |
---|
389 | > |
---|
390 | <compilerarg value="${compilerarg}" /> |
---|
391 | </javac> |
---|
392 | </target> |
---|
393 | |
---|
394 | <target |
---|
395 | name="web" |
---|
396 | depends="web.compile" |
---|
397 | description="Compile the web client, and copy required files to the web-inf directory" |
---|
398 | > |
---|
399 | <mkdir dir="${web.inf}/lib"/> |
---|
400 | <mkdir dir="${web.inf}/classes"/> |
---|
401 | <jar |
---|
402 | basedir="${core.build}" |
---|
403 | jarfile="${web.inf}/lib/BASE2Core.jar" |
---|
404 | /> |
---|
405 | <jar |
---|
406 | basedir="${coreplugins.build}" |
---|
407 | jarfile="${web.inf}/lib/BASE2CorePlugins.jar" |
---|
408 | /> |
---|
409 | <jar |
---|
410 | basedir="${web.build}" |
---|
411 | jarfile="${web.inf}/lib/BASE2Webclient.jar" |
---|
412 | /> |
---|
413 | <copy todir="${web.inf}/lib"> |
---|
414 | <fileset dir="${lib}/compile"> |
---|
415 | <include name="**/*.jar"/> |
---|
416 | <exclude name="**/servlet-api.jar" /> |
---|
417 | <exclude name="**/jsp-api.jar" /> |
---|
418 | </fileset> |
---|
419 | <fileset dir="${lib}/dist"> |
---|
420 | <include name="**/*.jar"/> |
---|
421 | </fileset> |
---|
422 | </copy> |
---|
423 | <copy todir="${web.inf}/classes"> |
---|
424 | <fileset dir="${src}"> |
---|
425 | <include name="*.config"/> |
---|
426 | <include name="*.properties"/> |
---|
427 | <include name="*.xml"/> |
---|
428 | </fileset> |
---|
429 | </copy> |
---|
430 | </target> |
---|
431 | |
---|
432 | <target |
---|
433 | name="web.compile" |
---|
434 | depends="" |
---|
435 | description="compile the source code for the web client" |
---|
436 | > |
---|
437 | <mkdir dir="${web.build}"/> |
---|
438 | <javac |
---|
439 | encoding="ISO-8859-1" |
---|
440 | srcdir="${web.src}" |
---|
441 | destdir="${web.build}" |
---|
442 | classpathref="web.compile.classpath" |
---|
443 | debug="true" |
---|
444 | deprecation="true" |
---|
445 | > |
---|
446 | <compilerarg value="${compilerarg}" /> |
---|
447 | </javac> |
---|
448 | <copy todir="${web.build}"> |
---|
449 | <fileset dir="${web.src}"> |
---|
450 | <include name="**/*.xml" /> |
---|
451 | <include name="**/*.dtd" /> |
---|
452 | <include name="**/*.config" /> |
---|
453 | <include name="**/*.properties" /> |
---|
454 | </fileset> |
---|
455 | </copy> |
---|
456 | </target> |
---|
457 | |
---|
458 | <target |
---|
459 | name="jsp.compile" |
---|
460 | depends="web" |
---|
461 | description="Compile all JSP pages to a temporary directory" |
---|
462 | > |
---|
463 | <mkdir dir="${jsp.build}/src" /> |
---|
464 | <mkdir dir="${jsp.build}/classes" /> |
---|
465 | |
---|
466 | <path id="jsp.precompile.classpath"> |
---|
467 | <pathelement location="${java.home}/../lib/tools.jar" /> |
---|
468 | <fileset dir="${env.CATALINA_HOME}/server/lib"> |
---|
469 | <include name="*.jar" /> |
---|
470 | </fileset> |
---|
471 | <fileset dir="${env.CATALINA_HOME}/common/lib"> |
---|
472 | <include name="*.jar" /> |
---|
473 | </fileset> |
---|
474 | <fileset dir="${env.CATALINA_HOME}/bin"> |
---|
475 | <include name="*.jar" /> |
---|
476 | </fileset> |
---|
477 | </path> |
---|
478 | |
---|
479 | <path id="jsp.compile.classpath"> |
---|
480 | <path refid="web.compile.classpath" /> |
---|
481 | <pathelement location="${java.home}/../lib/tools.jar" /> |
---|
482 | <fileset dir="${env.CATALINA_HOME}/common/lib"> |
---|
483 | <include name="*.jar" /> |
---|
484 | </fileset> |
---|
485 | <fileset dir="${env.CATALINA_HOME}/shared/lib"> |
---|
486 | <include name="*.jar" /> |
---|
487 | </fileset> |
---|
488 | <fileset dir="${web.inf}/lib"> |
---|
489 | <include name="*.jar" /> |
---|
490 | </fileset> |
---|
491 | </path> |
---|
492 | |
---|
493 | <taskdef |
---|
494 | classname="org.apache.jasper.JspC" |
---|
495 | name="jasper2" |
---|
496 | classpathref="jsp.precompile.classpath" |
---|
497 | /> |
---|
498 | <jasper2 |
---|
499 | validateXml="false" |
---|
500 | uriroot="${www}" |
---|
501 | webXmlFragment="${jsp.build}/generated_web.xml" |
---|
502 | outputdir="${jsp.build}/src" |
---|
503 | /> |
---|
504 | <javac |
---|
505 | destdir="${jsp.build}/classes" |
---|
506 | srcdir="${jsp.build}/src" |
---|
507 | debug="true" |
---|
508 | classpathref="jsp.compile.classpath" |
---|
509 | memoryinitialsize="256m" |
---|
510 | memorymaximumsize="512m" |
---|
511 | fork="true" |
---|
512 | > |
---|
513 | </javac> |
---|
514 | </target> |
---|
515 | |
---|
516 | <target |
---|
517 | name="dist" |
---|
518 | depends="clean,svn.revision,dist.init,dist.core,dist.coreplugins,dist.install,dist.web,dist.doc,dist.migrate" |
---|
519 | description="Create the distribution and put all files in their correct places"> |
---|
520 | <move |
---|
521 | file="${core.src}/net/sf/basedb/core/Application.java.bak" |
---|
522 | tofile="${core.src}/net/sf/basedb/core/Application.java" |
---|
523 | overwrite="true" |
---|
524 | /> |
---|
525 | <copy todir="${dist.lib}"> |
---|
526 | <fileset dir="${lib}/compile"> |
---|
527 | <include name="**/*.jar"/> |
---|
528 | <!--exclude name="**/*jai*.jar" / --> |
---|
529 | <exclude name="**/servlet-api.jar" /> |
---|
530 | <exclude name="**/jsp-api.jar" /> |
---|
531 | </fileset> |
---|
532 | <fileset dir="${lib}/dist"> |
---|
533 | <include name="**/*.*"/> |
---|
534 | <exclude name="**/ojdbc14.jar" /> |
---|
535 | </fileset> |
---|
536 | </copy> |
---|
537 | <copy tofile="${dist.webinf}/web.xml" file="${src}/web.xml.in" overwrite="true" /> |
---|
538 | <copy tofile="${dist.classes}/base.config" file="${src}/base.config.in" overwrite="true"/> |
---|
539 | <chmod file="${dist.classes}/base.config" perm="600"/> |
---|
540 | <copy tofile="${dist.classes}/log4j.properties" file="${src}/log4j.properties.in" overwrite="true"/> |
---|
541 | <chmod file="${dist.classes}/log4j.properties" perm="600"/> |
---|
542 | </target> |
---|
543 | |
---|
544 | <target |
---|
545 | name="dist.init" |
---|
546 | description="Create the distribution directory structure" |
---|
547 | > |
---|
548 | <mkdir dir="${dist}"/> |
---|
549 | <mkdir dir="${dist.bin}"/> |
---|
550 | <mkdir dir="${dist}/doc"/> |
---|
551 | <mkdir dir="${dist}/www"/> |
---|
552 | <mkdir dir="${dist.lib}"/> |
---|
553 | <copy |
---|
554 | file="${core.src}/net/sf/basedb/core/Application.java" |
---|
555 | tofile="${core.src}/net/sf/basedb/core/Application.java.bak" |
---|
556 | overwrite="false" |
---|
557 | /> |
---|
558 | <replace |
---|
559 | file="${core.src}/net/sf/basedb/core/Application.java" |
---|
560 | token="@BUILD@" |
---|
561 | value="${base.build}" |
---|
562 | /> |
---|
563 | </target> |
---|
564 | |
---|
565 | <target |
---|
566 | name="svn.revision" |
---|
567 | description="Get the current revision number in the subversion and put the value into the base.build property" |
---|
568 | > |
---|
569 | <exec |
---|
570 | executable="svnversion" |
---|
571 | outputproperty="base.build" |
---|
572 | failifexecutionfails="false" |
---|
573 | > |
---|
574 | <arg line="." /> |
---|
575 | </exec> |
---|
576 | <echo message="Build #${base.build}" /> |
---|
577 | </target> |
---|
578 | |
---|
579 | <target |
---|
580 | name="dist.core" |
---|
581 | depends="core.compile,core.hibernate" |
---|
582 | description="Generate the core jar file: BASE2Core.jar" |
---|
583 | > |
---|
584 | <jar |
---|
585 | basedir="${core.build}" |
---|
586 | jarfile="${dist.lib}/BASE2Core.jar" |
---|
587 | /> |
---|
588 | </target> |
---|
589 | |
---|
590 | <target |
---|
591 | name="dist.coreplugins" |
---|
592 | depends="coreplugins.compile" |
---|
593 | description="Generate the core plugins jar file: BASE2CorePlugins.jar" |
---|
594 | > |
---|
595 | <jar |
---|
596 | basedir="${coreplugins.build}" |
---|
597 | jarfile="${dist.lib}/BASE2CorePlugins.jar" |
---|
598 | /> |
---|
599 | </target> |
---|
600 | |
---|
601 | <target |
---|
602 | name="dist.install" |
---|
603 | depends="install.compile" |
---|
604 | description="Generate the installation jar file: BASE2Install.jar" |
---|
605 | > |
---|
606 | <jar |
---|
607 | basedir="${install.build}" |
---|
608 | jarfile="${dist.bin}/BASE2Install.jar" |
---|
609 | /> |
---|
610 | <copy todir="${dist.bin}"> |
---|
611 | <fileset dir="${install.src}" includes="*.sh,*.bat" /> |
---|
612 | <fileset dir="${install.src}" includes="includes" /> |
---|
613 | <fileset file="${web.src}/helptexts.xml" /> |
---|
614 | </copy> |
---|
615 | <chmod dir="${dist.bin}" includes="*.sh" perm="a+x"/> |
---|
616 | </target> |
---|
617 | <target |
---|
618 | name="dist.web" |
---|
619 | depends="web" |
---|
620 | description="Generate the web jar file: BASE2Webclient.jar |
---|
621 | and copy all *.jsp files" |
---|
622 | > |
---|
623 | <jar |
---|
624 | basedir="${web.build}" |
---|
625 | jarfile="${dist.lib}/BASE2Webclient.jar" |
---|
626 | /> |
---|
627 | <copy |
---|
628 | todir="${dist}/www" |
---|
629 | > |
---|
630 | <fileset dir="${www}"> |
---|
631 | <include name="**/*"/> |
---|
632 | <exclude name="**/*.jar" /> |
---|
633 | </fileset> |
---|
634 | </copy> |
---|
635 | </target> |
---|
636 | |
---|
637 | <target |
---|
638 | name="dist.doc" |
---|
639 | depends="" |
---|
640 | description="Copy required documentation" |
---|
641 | > |
---|
642 | <copy todir="${dist}" file="${doc}/installation.html" /> |
---|
643 | <copy todir="${dist}" file="base2.license.txt" /> |
---|
644 | <copy todir="${dist}" file="credits.txt" /> |
---|
645 | <copy todir="${dist}/doc" file="${doc}/3rd-party-components.txt" /> |
---|
646 | <copy todir="${dist}/doc" file="${doc}/configure_unicode_support.txt" /> |
---|
647 | <copy todir="${dist}/doc" file="${doc}/tomcat_with_java_1.5.txt" /> |
---|
648 | <copy todir="${dist}/doc/licenses"> |
---|
649 | <fileset dir="${doc}/licenses" /> |
---|
650 | </copy> |
---|
651 | </target> |
---|
652 | |
---|
653 | <target |
---|
654 | name="package" |
---|
655 | depends="dist" |
---|
656 | description="Package the distribution" |
---|
657 | > |
---|
658 | <tar |
---|
659 | destfile="base-${base.version}.tar.gz" |
---|
660 | compression="gzip" |
---|
661 | > |
---|
662 | <tarfileset |
---|
663 | dir="${dist}" |
---|
664 | mode="755" |
---|
665 | prefix="base-${base.version}" |
---|
666 | preserveLeadingSlashes="true" |
---|
667 | > |
---|
668 | <include name="bin/*.sh"/> |
---|
669 | </tarfileset> |
---|
670 | <tarfileset |
---|
671 | dir="${dist}" |
---|
672 | prefix="base-${base.version}" |
---|
673 | preserveLeadingSlashes="true" |
---|
674 | > |
---|
675 | <exclude name="bin/*.sh"/> |
---|
676 | </tarfileset> |
---|
677 | </tar> |
---|
678 | <checksum |
---|
679 | file="base-${base.version}.tar.gz" |
---|
680 | /> |
---|
681 | </target> |
---|
682 | |
---|
683 | <target |
---|
684 | name="clean" |
---|
685 | description="Remove all generated files and backup files" > |
---|
686 | <delete dir="${build}"/> |
---|
687 | <delete dir="${dist}"/> |
---|
688 | <delete dir="${web.inf}/lib"/> |
---|
689 | <delete dir="${web.inf}/classes"/> |
---|
690 | <delete> |
---|
691 | <fileset dir="." includes="**/base-*.tar.gz*" defaultexcludes="no"/> |
---|
692 | <fileset dir="." includes="**/*~" defaultexcludes="no"/> |
---|
693 | <fileset dir="." includes="**/.#*" defaultexcludes="no"/> |
---|
694 | </delete> |
---|
695 | </target> |
---|
696 | |
---|
697 | <target |
---|
698 | name="exampleplugins" |
---|
699 | description="Tar the code for example plugins" |
---|
700 | > |
---|
701 | <property name="exampledir" location="${src}/examples/plugins" /> |
---|
702 | <javac |
---|
703 | encoding="ISO-8859-1" |
---|
704 | srcdir="${exampledir}/src" |
---|
705 | destdir="${exampledir}/bin" |
---|
706 | debug="true" |
---|
707 | > |
---|
708 | <classpath> |
---|
709 | <fileset dir="${exampledir}/lib"> |
---|
710 | <include name="**/*.jar"/> |
---|
711 | </fileset> |
---|
712 | <pathelement path="${core.build}" /> |
---|
713 | </classpath> |
---|
714 | </javac> |
---|
715 | <jar |
---|
716 | jarfile="${exampledir}/ExamplePlugins.jar" |
---|
717 | basedir="${exampledir}/bin" |
---|
718 | manifest="${exampledir}/MANIFEST.MF" |
---|
719 | /> |
---|
720 | <tar |
---|
721 | destfile="${doc}/development/plugins/exampleplugins.tar.gz" |
---|
722 | compression="gzip" |
---|
723 | > |
---|
724 | <tarfileset |
---|
725 | dir="${src}/examples/plugins" |
---|
726 | preserveLeadingSlashes="true" |
---|
727 | /> |
---|
728 | </tar> |
---|
729 | <delete file="${exampledir}/ExamplePlugins.jar" /> |
---|
730 | <delete includeemptydirs="true"> |
---|
731 | <fileset dir="${exampledir}/bin" includes="**/*"/> |
---|
732 | </delete> |
---|
733 | </target> |
---|
734 | |
---|
735 | <target |
---|
736 | name="javadoc" |
---|
737 | depends="javadoc.develop,javadoc.public" |
---|
738 | /> |
---|
739 | |
---|
740 | <target |
---|
741 | name="javadoc.develop" |
---|
742 | description="generate JavaDoc for developers of BASE, ie. include private and protecteed methods."> |
---|
743 | <!-- Create the time stamp --> |
---|
744 | <tstamp> |
---|
745 | <format property="TODAY" pattern="yyyy-MM-dd"/> |
---|
746 | </tstamp> |
---|
747 | <mkdir dir="${doc}"/> |
---|
748 | |
---|
749 | <javadoc |
---|
750 | packagenames="net.sf.basedb.*" |
---|
751 | sourcepath="${core.src}:${web.src}:${migrate.src}" |
---|
752 | destdir="${doc.develop}" |
---|
753 | author="true" |
---|
754 | version="true" |
---|
755 | use="true" |
---|
756 | private="true" |
---|
757 | windowtitle="BASE 2.0 Class documentation (developer edition)" |
---|
758 | stylesheetfile="${doc}/javadoc.css" |
---|
759 | classpathref="core.compile.classpath" |
---|
760 | linksource="yes" |
---|
761 | breakiterator="yes" |
---|
762 | encoding="iso-8859-1" |
---|
763 | > |
---|
764 | <header><![CDATA[Last update: ${TODAY}]]></header> |
---|
765 | <link href="http://java.sun.com/j2se/1.5/docs/api"/> |
---|
766 | <link href="http://www.hibernate.org/hib_docs/v3/api"/> |
---|
767 | <link href="http://www.jdom.org/docs/apidocs/" /> |
---|
768 | <link href="http://java.sun.com/products/servlet/2.2/javadoc/" /> |
---|
769 | <link href="http://www.singularsys.com/jep/doc/javadoc/" /> |
---|
770 | <tag name="base.internal" description="Developer info" /> |
---|
771 | <tag name="base.modified" description="Last modified" /> |
---|
772 | <tag name="hibernate.class" description="Hibernate: class" scope="types" /> |
---|
773 | <tag name="hibernate.subclass" description="Hibernate: subclass" scope="types" /> |
---|
774 | <tag name="hibernate.discriminator" description="Hibernate: discriminator" scope="types" /> |
---|
775 | <tag name="hibernate.id" description="Hibernate: id" scope="methods" /> |
---|
776 | <tag name="hibernate.generator-param" description="Hibernate: generator-param" scope="methods" /> |
---|
777 | <tag name="hibernate.version" description="Hibernate: version" scope="methods" /> |
---|
778 | <tag name="hibernate.property" description="Hibernate: property" scope="methods" /> |
---|
779 | <tag name="hibernate.column" description="Hibernate: column" scope="methods" /> |
---|
780 | <tag name="hibernate.map" description="Hibernate: map" scope="methods" /> |
---|
781 | <tag name="hibernate.set" description="Hibernate: set" scope="methods" /> |
---|
782 | <tag name="hibernate.list" description="Hibernate: list" scope="methods" /> |
---|
783 | <tag name="hibernate.array" description="Hibernate: array" scope="methods" /> |
---|
784 | <tag name="hibernate.one-to-one" description="Hibernate: one-to-one" scope="methods" /> |
---|
785 | <tag name="hibernate.many-to-one" description="Hibernate: many-to-one" scope="methods" /> |
---|
786 | <tag name="hibernate.many-to-many" description="Hibernate: many-to-many" scope="methods" /> |
---|
787 | <tag name="hibernate.index-many-to-many" description="Hibernate: index-many-to-many" scope="methods" /> |
---|
788 | <tag name="hibernate.collection-key" description="Hibernate: collection-key" scope="methods" /> |
---|
789 | <tag name="hibernate.collection-index" description="Hibernate: collection-index" scope="methods" /> |
---|
790 | <tag name="hibernate.collection-composite-index" description="Hibernate: collection-composite-index" scope="methods" /> |
---|
791 | <tag name="hibernate.collection-element" description="Hibernate: collection-element" scope="methods" /> |
---|
792 | <tag name="hibernate.collection-composite-element" description="Hibernate: collection-composite-element" scope="methods" /> |
---|
793 | <tag name="hibernate.collection-one-to-many" description="Hibernate: collection-one-to-many" scope="methods" /> |
---|
794 | <tag name="hibernate.collection-many-to-many" description="Hibernate: collection-many-to-many" scope="methods" /> |
---|
795 | <tag name="hibernate.bag" description="Hibernate: bag" scope="methods" /> |
---|
796 | <tag name="hibernate.many-to-any" description="Hibernate: many-to-any" scope="methods" /> |
---|
797 | <tag name="hibernate.many-to-any-column" description="Hibernate: many-to-any-column" scope="methods" /> |
---|
798 | </javadoc> |
---|
799 | </target> |
---|
800 | |
---|
801 | <target |
---|
802 | name="javadoc.public" |
---|
803 | description="generate public JavaDoc, ie. without private and protected methods"> |
---|
804 | <tstamp> |
---|
805 | <format property="TODAY" pattern="yyyy-MM-dd"/> |
---|
806 | </tstamp> |
---|
807 | <mkdir dir="${doc}"/> |
---|
808 | <javadoc |
---|
809 | packagenames="net.sf.basedb.*" |
---|
810 | sourcepath="${core.src}:${web.src}" |
---|
811 | destdir="${doc.public}" |
---|
812 | author="true" |
---|
813 | version="true" |
---|
814 | protected="true" |
---|
815 | windowtitle="BASE 2.0 Class documentation" |
---|
816 | stylesheetfile="${doc}/javadoc.css" |
---|
817 | classpathref="core.compile.classpath" |
---|
818 | breakiterator="yes" |
---|
819 | encoding="iso-8859-1" |
---|
820 | > |
---|
821 | <header><![CDATA[Last update: ${TODAY}]]></header> |
---|
822 | <link href="http://java.sun.com/j2se/1.5/docs/api"/> |
---|
823 | <link href="http://www.hibernate.org/hib_docs/v3/api"/> |
---|
824 | <link href="http://www.jdom.org/docs/apidocs/" /> |
---|
825 | <link href="http://java.sun.com/products/servlet/2.2/javadoc/" /> |
---|
826 | <link href="http://www.singularsys.com/jep/doc/javadoc/" /> |
---|
827 | <tag name="base.internal" description="Developer info" enabled="false" /> |
---|
828 | <tag name="base.modified" description="Last modified" enabled="false" /> |
---|
829 | <tag name="hibernate.class" description="Hibernate: class" scope="types" enabled="false" /> |
---|
830 | <tag name="hibernate.subclass" description="Hibernate: subclass" scope="types" enabled="false" /> |
---|
831 | <tag name="hibernate.discriminator" description="Hibernate: discriminator" scope="types" enabled="false" /> |
---|
832 | <tag name="hibernate.id" description="Hibernate: id" scope="methods" enabled="false" /> |
---|
833 | <tag name="hibernate.generator-param" description="Hibernate: generator-param" scope="methods" enabled="false" /> |
---|
834 | <tag name="hibernate.version" description="Hibernate: version" scope="methods" enabled="false" /> |
---|
835 | <tag name="hibernate.property" description="Hibernate: property" scope="methods" enabled="false" /> |
---|
836 | <tag name="hibernate.key-property" description="Hibernate: key-property" scope="methods" enabled="false" /> |
---|
837 | <tag name="hibernate.column" description="Hibernate: column" scope="methods" /> |
---|
838 | <tag name="hibernate.map" description="Hibernate: map" scope="methods" enabled="false" /> |
---|
839 | <tag name="hibernate.set" description="Hibernate: set" scope="methods" enabled="false" /> |
---|
840 | <tag name="hibernate.list" description="Hibernate: list" scope="methods" enabled="false" /> |
---|
841 | <tag name="hibernate.array" description="Hibernate: array" scope="methods" enabled="false" /> |
---|
842 | <tag name="hibernate.one-to-one" description="Hibernate: one-to-one" scope="methods" enabled="false" /> |
---|
843 | <tag name="hibernate.many-to-one" description="Hibernate: many-to-one" scope="methods" enabled="false" /> |
---|
844 | <tag name="hibernate.many-to-many" description="Hibernate: many-to-many" scope="methods" enabled="false" /> |
---|
845 | <tag name="hibernate.index-many-to-many" description="Hibernate: index-many-to-many" scope="methods" enabled="false" /> |
---|
846 | <tag name="hibernate.collection-key" description="Hibernate: collection-key" scope="methods" enabled="false" /> |
---|
847 | <tag name="hibernate.collection-index" description="Hibernate: collection-index" scope="methods" enabled="false" /> |
---|
848 | <tag name="hibernate.collection-composite-index" description="Hibernate: collection-composite-index" scope="methods" enabled="false" /> |
---|
849 | <tag name="hibernate.collection-element" description="Hibernate: collection-element" scope="methods" enabled="false" /> |
---|
850 | <tag name="hibernate.collection-composite-element" description="Hibernate: collection-composite-element" scope="methods" enabled="false" /> |
---|
851 | <tag name="hibernate.collection-one-to-many" description="Hibernate: collection-one-to-many" scope="methods" enabled="false" /> |
---|
852 | <tag name="hibernate.collection-many-to-many" description="Hibernate: collection-many-to-many" scope="methods" enabled="false" /> |
---|
853 | <tag name="hibernate.bag" description="Hibernate: bag" scope="methods" enabled="false" /> |
---|
854 | <tag name="hibernate.many-to-any" description="Hibernate: many-to-any" scope="methods" enabled="false" /> |
---|
855 | <tag name="hibernate.many-to-any-column" description="Hibernate: many-to-any-column" scope="methods" enabled="false" /> |
---|
856 | </javadoc> |
---|
857 | </target> |
---|
858 | |
---|
859 | |
---|
860 | </project> |
---|