root/trunk/build/quickstart/build.xml

Revision 3098 (checked in by douglm, 2 years ago)

Add some system timer logging via jms.

Change proeprties to define destination of log4j config file.

Add new target to allow deployment of log4j configuration.

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   <dirname property="bedework.quickstart.basedir"
15                file="${ant.file.quickstart-build-file}"/>
16
17   <taskdef resource="net/sf/antcontrib/antcontrib.properties" />
18
19   <import file="${bedework.quickstart.basedir}/run-activemq.xml" />
20   <import file="${bedework.quickstart.basedir}/run-hsqldb.xml" />
21   <import file="${bedework.quickstart.basedir}/run-tomcat.xml" />
22   <import file="${bedework.quickstart.basedir}/run-dir.xml" />
23   <import file="${bedework.quickstart.basedir}/install.xml" />
24
25   <!-- Bedework services -->
26   <import file="${bedework.quickstart.basedir}/run-logger.xml" />
27   <import file="${bedework.quickstart.basedir}/run-indexer.xml" />
28   <import file="${bedework.quickstart.basedir}/run-inoutscheduler.xml" />
29
30   <target name="README" depends="init"
31           description="Describe targets and their usage">
32     <loadfile property="org.bedework.README" srcFile="${org.bedework.calendar.dir}/docs/README"/>
33     <echo message="${org.bedework.README}" />
34   </target>
35
36   <echo message="Load user properties from ${org.bedework.user.build.properties}" />
37
38   <!-- Load user property definition overrides -->
39   <property file="${org.bedework.user.build.properties}" />
40
41   <!-- This may have defined the config properties location. Load that now to get overrides
42   <property file="${org.bedework.config.properties}" />-->
43
44   <import file="${bedework.quickstart.basedir}/../loadDeployConfig.xml"/>
45
46   <target name="usage" depends="init"
47           description="Describe targets and their usage">
48     <echo level="info" message="As distributed the package should be ready to go."/>
49     <echo level="info" message="Ensure ant is on your path, (a version is in the" />
50     <echo level="info" message="package)"/>
51     <echo level="info" message=""/>
52     <echo level="info" message="First in one window do"/>
53     <echo level="info" message="    ant hsqldb"/>
54     <echo level="info" message="This will start the hsqldb server ready for the "/>
55     <echo level="info" message="application."/>
56     <echo level="info" message=""/>
57     <echo level="info" message="In another window do"/>
58     <echo level="info" message="    ant tomcatstart"/>
59     <echo level="info" message=""/>
60     <echo level="info" message="Once tomcat is running you should be able to go to a"/>
61     <echo level="info" message="browser and connect to"/>
62     <echo level="info" message="    http://localhost:8080/bedework"/>
63     <echo level="info" message="and follow the instructions."/>
64     <echo level="info" message=""/>
65     <echo level="info" message="To build the calendar do"/>
66     <echo level="info" message="    ant deploy    or "/>
67     <echo level="info" message="    ant deploy.debug "/>
68     <echo level="info" message="which does a build and deploy of all components"/>
69     <echo level="info" message=""/>
70     <echo level="info" message="To rebuild the calendar do"/>
71     <echo level="info" message="    ant clean.deploy    or "/>
72     <echo level="info" message="    ant clean.deploy.debug "/>
73     <echo level="info" message="which does a clean, build and deploy of all components"/>
74     <echo level="info" message=""/>
75     <echo level="info" message="See documentation in the docs directory or on bedework.org"/>
76     <echo level="info" message="for instructions on creating a locally configured calendar application"/>
77     <echo level="info" message=""/>
78   </target>
79
80    <!-- The only properties set below should be those directly used to
81         invoke the targets below, in this file.
82         Do not set properties here for tasks invoked in other build
83         files.  Instead, make sure the targets work in calendar/build.xml,
84         then invoke ant on the task in calendar/build.xml.
85
86         For an example, of invoking ant on another build file,
87         see the deploy target, below.
88      -->
89   <target name="init" >
90     <dirname property="quickstart.dir" file="${ant.file}"/>
91
92     <property name="org.bedework.project.bedework"
93               location="${basedir}/bedework" />
94
95     <property name="org.bedework.config.base"
96               location="${org.bedework.project.bedework}/config" />
97
98     <property name="bedework.build.file"
99               location="${basedir}/bedework/build.xml" />
100     <dirname property="org.bedework.configuration.location"
101              file="${org.bedework.user.build.properties}" />
102
103     <!-- Unfortunately it sits on top of everything
104     <splash imageurl="file://${org.bedework.project.bedework}/docs/icons/bedeworkLogo.gif"/>
105     -->
106   </target>
107
108   <target name="run.init" depends="init" >
109     <property name="org.bedework.appserver.dir"
110               location="${org.bedework.project.bedework}/../apache-tomcat-5.5.17" />
111
112     <property name="org.bedework.hsqldb.dir"
113               location="${org.bedework.project.bedework}/../hsqldb-1.7.3.3" />
114
115     <property name="org.bedework.directory.dir"
116               location="${org.bedework.project.bedework}/../apacheds-1.5.3-fixed" />
117
118     <property name="org.bedework.activemq.dir"
119               location="${org.bedework.project.bedework}/../apache-activemq-5.2.0" />
120   </target>
121
122   <!-- =================================================================
123        The "build" target builds the jar files
124        ================================================================= -->
125
126   <target name="build" depends="init"
127           description="builds the jars">
128     <ant antfile="${bedework.build.file}" inheritrefs="true"
129            target="build" />
130     <tstamp prefix="endbuild" />
131     <echo level="info" message="=================> Build finished at ${endbuild.TODAY}" />
132   </target>
133
134   <target name="clean.build" depends="clean"
135           description="cleans then builds the jars">
136     <ant antfile="${bedework.build.file}" inheritrefs="true"
137            target="clean.build" />
138   </target>
139
140   <!-- =================================================================
141        "deploy.log4j" target
142        ================================================================= -->
143
144   <target name="deploy.log4j" depends="init"
145           description="Copy the log4j config into the appserver">
146     <loadDeployConfig />
147
148     <copy tofile="${org.bedework.log4j.config}"
149           file="${org.bedework.config.home}/log4j.xml"
150             overwrite="true" />
151   </target>
152
153   <!-- =================================================================
154        The "deploy" target builds and deploys the applications
155        ================================================================= -->
156
157   <target name="deploy" depends="init"
158           description="builds and deploys the applications">
159     <ant antfile="${bedework.build.file}" inheritrefs="true"
160            target="deploy" />
161   </target>
162
163   <target name="deploy.debug" depends="init"
164           description="builds and deploys the applications">
165     <ant antfile="${bedework.build.file}" inheritrefs="true"
166            target="deploy.debug" />
167     <tstamp>
168       <format property="deploydebug.time" pattern="MM/dd/yyyy HH:mm:ss"/>
169     </tstamp>
170
171     <echo level="info" message="=================> deploy.debug finished at ${deploydebug.time}" />
172   </target>
173
174   <!-- =================================================================
175        The "clean.deploy" target cleans, builds and deploys the applications
176        ================================================================= -->
177
178   <target name="clean" depends="init"
179           description="Remove all generated files.">
180     <ant antfile="${bedework.build.file}" inheritrefs="true"
181            target="clean" />
182   </target>
183
184   <target name="quickstart-clean" depends="init"
185           description="partial clean up for quickstart.">
186     <ant antfile="${bedework.build.file}" inheritrefs="true"
187            target="quickstart-clean" />
188   </target>
189
190   <target name="clean.deploy" depends="init"
191           description="builds and deploys the applications">
192     <ant antfile="${bedework.build.file}" inheritrefs="true"
193            target="clean.deploy" />
194   </target>
195
196   <target name="clean.deploy.debug" depends="init"
197           description="builds and deploys the applications">
198     <ant antfile="${bedework.build.file}" inheritrefs="true"
199            target="clean.deploy.debug" />
200   </target>
201
202   <!-- =================================================================
203        The "build.configured" target builds configured applications
204        ================================================================= -->
205
206   <target name="build.configured" depends="init"
207           description="Build configured applications" >
208     <ant antfile="${bedework.build.file}" inheritrefs="true"
209            target="build.configured" />
210   </target>
211
212   <target name="build.configured.debug" depends="init"
213           description="Build configured applications" >
214     <ant antfile="${bedework.build.file}" inheritrefs="true"
215            target="build.configured.debug" />
216   </target>
217
218   <target name="clean.build.configured" depends="init"
219           description="Build configured applications" >
220     <ant antfile="${bedework.build.file}" inheritrefs="true"
221            target="clean.build.configured" />
222   </target>
223
224   <target name="clean.build.configured.debug" depends="init"
225           description="Build configured applications" >
226     <ant antfile="${bedework.build.file}" inheritrefs="true"
227            target="clean.build.configured.debug" />
228   </target>
229
230   <!-- =================================================================
231        Build and run the cmdline utility
232        ================================================================= -->
233
234   <target name="cmdutil" depends="init"
235           description="run the cmdline utility">
236     <antfetch antfile="${bedework.build.file}" inheritall="true"
237               target="cmdutil"
238               return="org.bedework.cmdutil.status" >
239     </antfetch>
240   </target>
241
242   <!-- =================================================================
243        The "javadoc" target builds javadocs for all projects
244        ================================================================= -->
245
246   <target name="javadoc" depends="init"
247           description="Build javadocs" >
248     <ant antfile="${bedework.build.file}" inheritrefs="true"
249          target="javadoc" />
250   </target>
251
252   <!-- =================================================================
253        The "run.test" target builds and runs tests
254        ================================================================= -->
255
256   <target name="run.test" depends="init"
257           description="builds and runs the tests">
258     <ant antfile="${bedework.build.file}" inheritrefs="true"
259            target="run.test" />
260   </target>
261
262   <!-- =================================================================
263        The "start" target starts all quickstart components
264        ================================================================= -->
265
266   <target name="start" depends="run.init"
267           description="Start quickstart system" >
268     <parallel>
269       <antcall target="activemq" inheritrefs="true" />
270       <antcall target="dirstart" inheritrefs="true" />
271       <antcall target="hsqldb" inheritrefs="true" />
272
273       <sequential>
274         <!-- wait for activemq -->
275         <waitfor maxwait="3" maxwaitunit="minute" checkevery="250">
276            <socket server="localhost" port="8161"/>
277         </waitfor>
278
279         <!-- wait for the directory server -->
280         <waitfor maxwait="3" maxwaitunit="minute" checkevery="250">
281            <socket server="localhost" port="10389"/>
282         </waitfor>
283
284         <parallel>
285           <!-- Start the bedework non-web services -->
286           <antcall target="start-logger" inheritrefs="true" />
287
288           <antcall target="start-indexer" inheritrefs="true" />
289                
290           <antcall target="start-inoutscheduler" inheritrefs="true" />
291
292           <antcall target="tomcatstart" inheritrefs="true" />
293         </parallel>
294       </sequential>
295     </parallel>
296   </target>
297
298   <!-- =================================================================
299        The "start-debug" target starts the quickstart infrastructure components
300        ================================================================= -->
301
302   <target name="start-debug" depends="run.init"
303           description="Start quickstart system" >
304     <parallel>
305       <antcall target="activemq" inheritrefs="true" />
306       <antcall target="dirstart" inheritrefs="true" />
307       <antcall target="hsqldb" inheritrefs="true" />
308     </parallel>
309   </target>
310 </project>
Note: See TracBrowser for help on using the browser.