root/trunk/build/quickstart/build.xml

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

Import deftasks for some of the quickstart targets

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