root/trunk/build/quickstart-build.xml

Revision 1807 (checked in by douglm, 5 years ago)

Merge in revision 1806 from release 3.4.1

Line 
1 <?xml version="1.0"?>
2
3 <!-- This is the ant build file for the bedework Calendar quickstart.
4
5      It is imported by the quickstart build.xml ensuring all changes to this file
6      appear in the repository.
7
8      Authors: Mike Douglass   douglm@rpi.edu
9 -->
10
11 <project name="quickstart-build-file" default="usage" basedir=".">
12   <property environment="env"/>
13
14   <taskdef resource="net/sf/antcontrib/antcontrib.properties" />
15
16   <target name="README" depends="init"
17           description="Describe targets and their usage">
18     <loadfile property="org.bedework.README" srcFile="${org.bedework.calendar.dir}/docs/README"/>
19     <echo message="${org.bedework.README}" />
20   </target>
21
22   <target name="usage" depends="init"
23           description="Describe targets and their usage">
24     <echo message="As distributed the package should be ready to go."/>
25     <echo message="Ensure ant is on your path, (a version is in the" />
26     <echo message="package)"/>
27     <echo message=""/>
28     <echo message="First in one window do"/>
29     <echo message="    ant hsqldb"/>
30     <echo message="This will start the hsqldb server ready for the "/>
31     <echo message="application."/>
32     <echo message=""/>
33     <echo message="In another window do"/>
34     <echo message="    ant tomcatstart"/>
35     <echo message=""/>
36     <echo message="Once tomcat is running you should be able to go to a"/>
37     <echo message="browser and connect to"/>
38     <echo message="    http://localhost:8080/bedework"/>
39     <echo message="and follow the instructions."/>
40     <echo message=""/>
41     <echo message="To build the calendar do"/>
42     <echo message="    ant deploy    or "/>
43     <echo message="    ant deploy.debug "/>
44     <echo message="which does a build and deploy of all components"/>
45     <echo message=""/>
46     <echo message="To rebuild the calendar do"/>
47     <echo message="    ant clean.deploy    or "/>
48     <echo message="    ant clean.deploy.debug "/>
49     <echo message="which does a clean, build and deploy of all components"/>
50     <echo message=""/>
51     <echo message="See documentation in the docs directory or on bedework.org"/>
52     <echo message="for instructions on creating a locally configured calendar application"/>
53     <echo message=""/>
54   </target>
55
56    <!-- The only properties set below should be those directly used to
57         invoke the targets below, in this file.
58         Do not set properties here for tasks invoked in other build
59         files.  Instead, make sure the targets work in calendar/build.xml,
60         then invoke ant on the task in calendar/build.xml.
61
62         For an example, of invoking ant on another build file,
63         see the deploy target, below.
64      -->
65   <target name="init" >
66     <dirname property="quickstart.dir" file="${ant.file}"/>
67
68     <property name="org.bedework.project.bedework"
69               location="${basedir}/bedework" />
70
71     <property name="org.bedework.config.base"
72               location="${org.bedework.project.bedework}/config" />
73
74     <property name="bedework.build.file"
75               location="${basedir}/bedework/build.xml" />
76     <property name="org.bedework.user.build.properties"
77               location="${user.home}/bedework.build.properties" />
78     <dirname property="org.bedework.configuration.location"
79              file="${org.bedework.user.build.properties}" />
80
81     <echo message="Load user properties from ${org.bedework.user.build.properties}" />
82
83     <!-- Load user property definition overrides -->
84     <property file="${org.bedework.user.build.properties}" />
85
86     <!-- This may have defined the config properties location. Load that now to get overrides -->
87     <property file="${org.bedework.config.properties}" />
88
89
90     <!-- Unfortunately it sits on top of everything
91     <splash imageurl="file://${org.bedework.project.bedework}/docs/icons/bedeworkLogo.gif"/>
92     -->
93   </target>
94
95   <target name="run.init" depends="init" >
96     <property name="org.bedework.user.build.properties"
97               location="${user.home}/bedework.build.properties" />
98
99     <echo message="Load user properties from ${org.bedework.user.build.properties}" />
100
101     <!-- Load user property definition overrides -->
102     <property file="${org.bedework.user.build.properties}" />
103
104     <!-- ==================== config properties ========================= -->
105     <property name="org.bedework.config.properties"
106               location="${org.bedework.config.base}/configs/democal.properties" />
107     <property name="org.bedework.config.options"
108               location="${org.bedework.config.base}/configs/democal.options.xml" />
109
110     <echo message="==========================================================" />
111     <echo message="Use config properties ${org.bedework.config.properties}" />
112     <loadproperties
113           srcFile="${org.bedework.config.properties}" >
114       <filterchain>
115         <expandproperties/>
116       </filterchain>
117     </loadproperties>
118   </target>
119
120   <!-- =================================================================
121        The "build" target builds the jar files
122        ================================================================= -->
123
124   <target name="build" depends="init"
125           description="builds the jars">
126     <ant antfile="${bedework.build.file}" inheritrefs="true"
127            target="build" />
128     <tstamp prefix="endbuild" />
129     <echo message="=================> Build finished at ${endbuild.TODAY}" />
130   </target>
131
132   <target name="clean.build" depends="clean"
133           description="cleans then builds the jars">
134     <ant antfile="${bedework.build.file}" inheritrefs="true"
135            target="clean.build" />
136   </target>
137
138   <!-- =================================================================
139        The "deploy" target builds and deploys the applications
140        ================================================================= -->
141
142   <target name="deploy" depends="init"
143           description="builds and deploys the applications">
144     <ant antfile="${bedework.build.file}" inheritrefs="true"
145            target="deploy" />
146   </target>
147
148   <target name="deploy.debug" depends="init"
149           description="builds and deploys the applications">
150     <ant antfile="${bedework.build.file}" inheritrefs="true"
151            target="deploy.debug" />
152     <tstamp>
153       <format property="deploydebug.time" pattern="MM/dd/yyyy HH:mm:ss"/>
154     </tstamp>
155
156     <echo message="=================> deploy.debug finished at ${deploydebug.time}" />
157   </target>
158
159   <!-- =================================================================
160        The "clean.deploy" target cleans, builds and deploys the applications
161        ================================================================= -->
162
163   <target name="clean" depends="init"
164           description="Remove all generated files.">
165     <ant antfile="${bedework.build.file}" inheritrefs="true"
166            target="clean" />
167   </target>
168
169   <target name="quickstart-clean" depends="init"
170           description="partial clean up for quickstart.">
171     <ant antfile="${bedework.build.file}" inheritrefs="true"
172            target="quickstart-clean" />
173   </target>
174
175   <target name="clean.deploy" depends="init"
176           description="builds and deploys the applications">
177     <ant antfile="${bedework.build.file}" inheritrefs="true"
178            target="clean.deploy" />
179   </target>
180
181   <target name="clean.deploy.debug" depends="init"
182           description="builds and deploys the applications">
183     <ant antfile="${bedework.build.file}" inheritrefs="true"
184            target="clean.deploy.debug" />
185   </target>
186
187   <!-- =================================================================
188        The "build.configured" target builds configured applications
189        ================================================================= -->
190
191   <target name="build.configured" depends="init"
192           description="Build configured applications" >
193     <ant antfile="${bedework.build.file}" inheritrefs="true"
194            target="build.configured" />
195   </target>
196
197   <target name="build.configured.debug" depends="init"
198           description="Build configured applications" >
199     <ant antfile="${bedework.build.file}" inheritrefs="true"
200            target="build.configured.debug" />
201   </target>
202
203   <target name="clean.build.configured" depends="init"
204           description="Build configured applications" >
205     <ant antfile="${bedework.build.file}" inheritrefs="true"
206            target="clean.build.configured" />
207   </target>
208
209   <target name="clean.build.configured.debug" depends="init"
210           description="Build configured applications" >
211     <ant antfile="${bedework.build.file}" inheritrefs="true"
212            target="clean.build.configured.debug" />
213   </target>
214
215   <!-- =================================================================
216        The "javadoc" target builds javadocs for all projects
217        ================================================================= -->
218
219   <target name="javadoc" depends="init"
220           description="Build javadocs" >
221     <ant antfile="${bedework.build.file}" inheritrefs="true"
222          target="javadoc" />
223   </target>
224
225   <!-- =================================================================
226        The "hsqldb" target starts the hsqldb server
227        ================================================================= -->
228
229   <target name="hsqldb" depends="run.init"
230           description="starts the hsqldb server">
231     <echo message="Starting hsqldb"/>
232     <java fork="true" dir="${basedir}" classname="org.hsqldb.Server">
233       <classpath>
234         <pathelement path="${org.bedework.hsqldb.dir}/lib/hsqldb.jar"/>
235       </classpath>
236       <arg value="-database"/>
237       <arg value="${org.bedework.hsqldb.dir}/${org.bedework.hsqldb.dbname}"/>
238       <arg value="-port"/>
239       <arg value="8887"/>
240     </java>
241   </target>
242
243   <target name="hsqldb-trace" depends="run.init"
244           description="starts the hsqldb server">
245     <echo message="Starting hsqldb"/>
246     <java fork="true" dir="${basedir}" classname="org.hsqldb.Server">
247       <classpath>
248         <pathelement path="${org.bedework.hsqldb.dir}/lib/hsqldb.jar"/>
249       </classpath>
250       <arg value="-trace"/>
251       <arg value="true"/>
252       <arg value="-silent"/>
253       <arg value="false"/>
254       <arg value="-database"/>
255       <arg value="${org.bedework.hsqldb.dir}/${org.bedework.hsqldb.dbname}"/>
256       <arg value="-port"/>
257       <arg value="8887"/>
258     </java>
259   </target>
260
261   <target name="hsqldb-trace-9887" depends="run.init"
262           description="starts the hsqldb server">
263     <echo message="Starting hsqldb"/>
264     <java fork="true" dir="${basedir}" classname="org.hsqldb.Server">
265       <classpath>
266         <pathelement path="${org.bedework.hsqldb.dir}/lib/hsqldb.jar"/>
267       </classpath>
268       <arg value="-trace"/>
269       <arg value="true"/>
270       <arg value="-silent"/>
271       <arg value="false"/>
272       <arg value="-database"/>
273       <arg value="${org.bedework.hsqldb.dir}/${org.bedework.hsqldb.dbname}"/>
274       <arg value="-port"/>
275       <arg value="9887"/>
276     </java>
277   </target>
278
279   <target name="uportaldb" depends="run.init"
280           description="starts the hsqldb server">
281     <echo message="Starting hsqldb"/>
282     <java fork="true" dir="${basedir}" classname="org.hsqldb.Server">
283       <classpath>
284         <pathelement path="${org.bedework.hsqldb.dir}/lib/hsqldb.jar"/>
285       </classpath>
286       <arg value="-database"/>
287       <arg value="${org.bedework.hsqldb.dir}/${org.bedework.hsqldb.uportal2.dbname}"/>
288       <arg value="-port"/>
289       <arg value="9887"/>
290     </java>
291   </target>
292
293   <!-- =================================================================
294        The "hsqldb-test" target starts the hsqldb server for testing
295        ================================================================= -->
296
297   <target name="hsqldb-test" depends="run.init"
298           description="starts the hsqldb server for testing">
299     <echo message="Starting hsqldb for testing"/>
300     <delete dir="${org.bedework.hsqldb.dbdir}" />
301
302     <java fork="true" dir="${basedir}" classname="org.hsqldb.Server">
303       <classpath>
304         <pathelement path="${org.bedework.hsqldb.dir}/lib/hsqldb.jar"/>
305       </classpath>
306       <arg value="-database"/>
307       <arg value="${org.bedework.hsqldb.dir}/${org.bedework.hsqldb.test.dbdir}/events"/>
308       <arg value="-port"/>
309       <arg value="8887"/>
310     </java>
311   </target>
312
313   <target name="hsqldb-test-trace" depends="run.init"
314           description="starts the hsqldb server for testing">
315     <echo message="Starting hsqldb for testing"/>
316     <delete dir="${org.bedework.hsqldb.dbdir}" />
317
318     <java fork="true" dir="${basedir}" classname="org.hsqldb.Server">
319       <classpath>
320         <pathelement path="${org.bedework.hsqldb.dir}/lib/hsqldb.jar"/>
321       </classpath>
322       <arg value="-trace"/>
323       <arg value="true"/>
324       <arg value="-silent"/>
325       <arg value="false"/>
326       <arg value="-database"/>
327       <arg value="${org.bedework.hsqldb.dir}/${org.bedework.hsqldb.test.dbdir}/events"/>
328       <arg value="-port"/>
329       <arg value="8887"/>
330     </java>
331   </target>
332
333   <!-- =================================================================
334        The "hsqldb-mngr" target runs the DatabaseManager class which
335        provides a gui interface to the running hsqldb database.
336        ================================================================= -->
337
338   <target name="hsqldb-mngr" depends="run.init"
339           description="Runs the DatabaseManager class which provides a
340                        gui interface to the running hsqldb database">
341     <echo message="Starting hsqldb DatabaseManager"/>
342     <echo message="Select type: HSQL Database Engine Server"/>
343     <echo message="Set the URL to jdbc:hsqldb:hsql://localhost:8887"/>
344     <java fork="true" dir="${basedir}"
345           classname="org.hsqldb.util.DatabaseManager">
346       <classpath>
347         <pathelement path="${org.bedework.hsqldb.dir}/lib/hsqldb.jar"/>
348       </classpath>
349     </java>
350   </target>
351
352   <!-- =================================================================
353        The "tomcatstart" target starts Tomcat
354        ================================================================= -->
355
356   <target name="tomcatstart-locale" depends="run.init"
357           description="starts the tomcat server">
358     <input message="Enter language code: "
359            addproperty="tomcat.locale" />
360
361     <input message="Enter country code: "
362            addproperty="tomcat.country" />
363
364     <echo message="Starting Tomcat from ${org.bedework.appserver.dir}"/>
365     <java fork="true" dir="${basedir}"
366           classname="org.apache.catalina.startup.Bootstrap">
367       <classpath>
368         <pathelement path="${org.bedework.appserver.dir}/bin/bootstrap.jar"/>
369       </classpath>
370       <sysproperty key="catalina.home" value="${org.bedework.appserver.dir}"/>
371       <!--jvmarg value="-Dcatalina.home=${tomcat.dir}"/-->
372       <jvmarg value="-Duser.language=${tomcat.locale}"/>
373       <jvmarg value="-Duser.country=${tomcat.country}"/>
374       <!--
375       <jvmarg value="-Dfile.encoding=ISO-8859-1"/>
376       -->
377       <arg value="start"/>
378     </java>
379   </target>
380
381   <target name="tomcatstart" depends="run.init"
382           description="starts the tomcat server">
383     <echo message="Starting Tomcat from ${org.bedework.appserver.dir}"/>
384     <java fork="true" dir="${basedir}"
385           classname="org.apache.catalina.startup.Bootstrap">
386       <classpath>
387         <pathelement path="${org.bedework.appserver.dir}/bin/bootstrap.jar"/>
388       </classpath>
389       <sysproperty key="catalina.home" value="${org.bedework.appserver.dir}"/>
390       <!--jvmarg value="-Dcatalina.home=${tomcat.dir}"/-->
391       <jvmarg value="-Xms128m" />
392       <jvmarg value="-Xmx630m" />
393       <jvmarg value="-Djava.net.preferIPv4Stack=true"/>
394       <jvmarg value="-Dfile.encoding=UTF-8"/>
395       <arg value="start"/>
396     </java>
397   </target>
398
399   <target name="tomcatstart-large" depends="run.init"
400           description="starts a large memory version of the tomcat server">
401     <echo message="Starting Tomcat from ${org.bedework.appserver.dir}"/>
402     <java fork="true" dir="${basedir}"
403           classname="org.apache.catalina.startup.Bootstrap">
404       <classpath>
405         <pathelement path="${org.bedework.appserver.dir}/bin/bootstrap.jar"/>
406       </classpath>
407       <sysproperty key="catalina.home" value="${org.bedework.appserver.dir}"/>
408       <!--jvmarg value="-Dcatalina.home=${tomcat.dir}"/-->
409       <jvmarg value="-Xms128m" />
410       <jvmarg value="-Xmx1028m" />
411       <jvmarg value="-XX:PermSize=128m" />
412       <jvmarg value="-XX:MaxPermSize=128m" />
413       <jvmarg value="-Djava.net.preferIPv4Stack=true"/>
414       <arg value="start"/>
415     </java>
416   </target>
417
418   <target name="tomcatstart-profile" depends="run.init"
419           description="starts the tomcat server with rpofiling">
420     <echo message="Starting Tomcat from ${org.bedework.appserver.dir}"/>
421     <java fork="true" dir="${basedir}"
422           classname="org.apache.catalina.startup.Bootstrap">
423       <classpath>
424         <pathelement path="${org.bedework.appserver.dir}/bin/bootstrap.jar"/>
425       </classpath>
426       <sysproperty key="catalina.home" value="${org.bedework.appserver.dir}"/>
427       <!--jvmarg value="-Dcatalina.home=${tomcat.dir}"/-->
428       <jvmarg value="-Xrunyjpagent:cpu=times,onexit=cpu" />
429       <jvmarg value="-Djava.net.preferIPv4Stack=true"/>
430       <arg value="start"/>
431     </java>
432   </target>
433
434   <target name="tomcatstart-profile-large" depends="run.init"
435           description="starts the tomcat server with rpofiling">
436     <echo message="Starting Tomcat from ${org.bedework.appserver.dir}"/>
437     <java fork="true" dir="${basedir}"
438           classname="org.apache.catalina.startup.Bootstrap">
439       <classpath>
440         <pathelement path="${org.bedework.appserver.dir}/bin/bootstrap.jar"/>
441       </classpath>
442       <sysproperty key="catalina.home" value="${org.bedework.appserver.dir}"/>
443       <!--jvmarg value="-Dcatalina.home=${tomcat.dir}"/-->
444       <jvmarg value="-Xms128m" />
445       <jvmarg value="-Xmx1028m" />
446       <jvmarg value="-XX:PermSize=128m" />
447       <jvmarg value="-XX:MaxPermSize=128m" />
448       <jvmarg value="-server" />
449       <jvmarg value="-agentlib:hprof=cpu=samples,depth=15,onexit=memory" />
450       <jvmarg value="-Djava.net.preferIPv4Stack=true"/>
451       <arg value="start"/>
452     </java>
453   </target>
454
455   <target name="tomcatstart-profile-yk" depends="run.init"
456           description="starts the tomcat server with rpofiling">
457     <echo message="Starting Tomcat from ${org.bedework.appserver.dir}"/>
458     <java fork="true" dir="${basedir}"
459           classname="org.apache.catalina.startup.Bootstrap">
460       <classpath>
461         <pathelement path="${org.bedework.appserver.dir}/bin/bootstrap.jar"/>
462       </classpath>
463       <sysproperty key="catalina.home" value="${org.bedework.appserver.dir}"/>
464       <!--jvmarg value="-Dcatalina.home=${tomcat.dir}"/-->
465       <jvmarg value="-Xms128m" />
466       <jvmarg value="-Xmx1028m" />
467       <jvmarg value="-XX:PermSize=128m" />
468       <jvmarg value="-XX:MaxPermSize=128m" />
469       <jvmarg value="-server" />
470       <jvmarg value="-agentlib:yjpagent" />
471       <jvmarg value="-Djava.net.preferIPv4Stack=true"/>
472       <arg value="start"/>
473     </java>
474   </target>
475
476   <target name="tomcatstart-debug" depends="run.init"
477           description="starts the tomcat server with remote debugging enabled">
478     <echo message="Starting Tomcat from ${org.bedework.appserver.dir}"/>
479     <java fork="true" dir="${basedir}"
480           classname="org.apache.catalina.startup.Bootstrap">
481       <classpath>
482         <pathelement path="${org.bedework.appserver.dir}/bin/bootstrap.jar"/>
483       </classpath>
484       <sysproperty key="catalina.home" value="${org.bedework.appserver.dir}"/>
485       <!--jvmarg value="-Dcatalina.home=${tomcat.dir}"/-->
486       <jvmarg value="-Djava.net.preferIPv4Stack=true"/>
487       <jvmarg value="-Xdebug"/>
488       <jvmarg value="-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"/>
489       <arg value="start"/>
490     </java>
491   </target>
492
493   <!-- This target is for use when sync4j is installed -->
494   <target name="tomcatstart-sync4j" depends="run.init"
495           description="starts the tomcat server with sync4j">
496     <echo message="Starting Tomcat with sync4j"/>
497     <java fork="true" dir="${basedir}"
498           classname="org.apache.catalina.startup.Bootstrap">
499       <classpath>
500         <pathelement path="${org.bedework.appserver.dir}/bin/bootstrap.jar"/>
501       </classpath>
502       <sysproperty key="catalina.home" value="${org.bedework.appserver.dir}"/>
503       <!--jvmarg value="-Dcatalina.home=${tomcat.dir}"/-->
504       <jvmarg value="-Dsync4j.home=${sync4j.dir}"/>
505       <arg value="start"/>
506     </java>
507   </target>
508
509   <!-- =================================================================
510        The "tomcatstop" target stops Tomcat cleanly
511        ================================================================= -->
512
513   <target name="tomcatstop" depends="run.init">
514     <echo message="Stopping Tomcat"/>
515     <java fork="true" dir="${basedir}"
516           classname="org.apache.catalina.startup.Bootstrap">
517       <classpath>
518         <pathelement path="${org.bedework.appserver.dir}/bin/bootstrap.jar"/>
519       </classpath>
520       <sysproperty key="catalina.home" value="${org.bedework.appserver.dir}"/>
521       <!--jvmarg value="-Dcatalina.home=${tomcat.dir}"/-->
522       <arg value="stop"/>
523     </java>
524   </target>
525 </project>
Note: See TracBrowser for help on using the browser.