root/trunk/build/quickstart/build.xml

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

Remove definition of property "base.name" from (almost) every build file. Was not used.
Stop defining, creating and copying to libapi. Wasn't in use.

Remove build directory from every project and use the build files in the main bedework project. improves consistency and maintainability. Also allowed some bugs to be fixed.

Allow setting of message level during build and set it at quiet. Allows error messages to be more obvious.

Create macro to handle the common property definitions. Reduces size and complexity of build files.

Add a build-jar macro. Removes need for build files for sub-modules. Partway through converting to use that.

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
131     <tstamp>
132       <format property="deploydebug.time" pattern="MM/dd/yyyy HH:mm:ss"/>
133     </tstamp>
134
135     <echo message="* ============== finished at ${deploydebug.time}" />
136   </target>
137
138   <target name="clean.build" depends="clean"
139           description="cleans then builds the jars">
140     <ant antfile="${bedework.build.file}" inheritrefs="true"
141            target="clean.build" />
142
143     <tstamp>
144       <format property="deploydebug.time" pattern="MM/dd/yyyy HH:mm:ss"/>
145     </tstamp>
146
147     <echo message="* ============== finished at ${deploydebug.time}" />
148   </target>
149
150   <!-- =================================================================
151        "deploy.log4j" target
152        ================================================================= -->
153
154   <target name="deploy.log4j" depends="init"
155           description="Copy the log4j config into the appserver">
156     <loadDeployConfig />
157
158     <copy tofile="${org.bedework.log4j.config}"
159           file="${org.bedework.config.home}/log4j.xml"
160             overwrite="true" />
161   </target>
162
163   <!-- =================================================================
164        The "deploy" target builds and deploys the applications
165        ================================================================= -->
166
167   <target name="deploy" depends="init"
168           description="builds and deploys the applications">
169     <ant antfile="${bedework.build.file}" inheritrefs="true"
170            target="deploy" />
171
172     <tstamp>
173       <format property="deploydebug.time" pattern="MM/dd/yyyy HH:mm:ss"/>
174     </tstamp>
175
176     <echo message="* ============== finished at ${deploydebug.time}" />
177   </target>
178
179   <target name="deploy.debug" depends="init"
180           description="builds and deploys the applications">
181     <ant antfile="${bedework.build.file}" inheritrefs="true"
182            target="deploy.debug" />
183
184     <tstamp>
185       <format property="deploydebug.time" pattern="MM/dd/yyyy HH:mm:ss"/>
186     </tstamp>
187
188     <echo message="* ============== finished at ${deploydebug.time}" />
189   </target>
190
191   <!-- =================================================================
192        The "clean.deploy" target cleans, builds and deploys the applications
193        ================================================================= -->
194
195   <target name="clean" depends="init"
196           description="Remove all generated files.">
197     <ant antfile="${bedework.build.file}" inheritrefs="true"
198            target="clean" />
199   </target>
200
201   <target name="quickstart-clean" depends="init"
202           description="partial clean up for quickstart.">
203     <ant antfile="${bedework.build.file}" inheritrefs="true"
204            target="quickstart-clean" />
205
206     <tstamp>
207       <format property="deploydebug.time" pattern="MM/dd/yyyy HH:mm:ss"/>
208     </tstamp>
209
210     <echo message="* ============== finished at ${deploydebug.time}" />
211   </target>
212
213   <target name="clean.deploy" depends="init"
214           description="builds and deploys the applications">
215     <ant antfile="${bedework.build.file}" inheritrefs="true"
216            target="clean.deploy" />
217
218     <tstamp>
219       <format property="deploydebug.time" pattern="MM/dd/yyyy HH:mm:ss"/>
220     </tstamp>
221
222     <echo message="* ============== finished at ${deploydebug.time}" />
223   </target>
224
225   <target name="clean.deploy.debug" depends="init"
226           description="builds and deploys the applications">
227     <ant antfile="${bedework.build.file}" inheritrefs="true"
228            target="clean.deploy.debug" />
229
230     <tstamp>
231       <format property="deploydebug.time" pattern="MM/dd/yyyy HH:mm:ss"/>
232     </tstamp>
233
234     <echo message="* ============== finished at ${deploydebug.time}" />
235   </target>
236
237   <!-- =================================================================
238        The "build.configured" target builds configured applications
239        ================================================================= -->
240
241   <target name="build.configured" depends="init"
242           description="Build configured applications" >
243     <ant antfile="${bedework.build.file}" inheritrefs="true"
244            target="build.configured" />
245   </target>
246
247   <target name="build.configured.debug" depends="init"
248           description="Build configured applications" >
249     <ant antfile="${bedework.build.file}" inheritrefs="true"
250            target="build.configured.debug" />
251   </target>
252
253   <target name="clean.build.configured" depends="init"
254           description="Build configured applications" >
255     <ant antfile="${bedework.build.file}" inheritrefs="true"
256            target="clean.build.configured" />
257   </target>
258
259   <target name="clean.build.configured.debug" depends="init"
260           description="Build configured applications" >
261     <ant antfile="${bedework.build.file}" inheritrefs="true"
262            target="clean.build.configured.debug" />
263   </target>
264
265   <!-- =================================================================
266        Build and run the cmdline utility
267        ================================================================= -->
268
269   <target name="cmdutil" depends="init"
270           description="run the cmdline utility">
271     <antfetch antfile="${bedework.build.file}" inheritall="true"
272               target="cmdutil"
273               return="org.bedework.cmdutil.status" >
274     </antfetch>
275   </target>
276
277   <!-- =================================================================
278        The "javadoc" target builds javadocs for all projects
279        ================================================================= -->
280
281   <target name="javadoc" depends="init"
282           description="Build javadocs" >
283     <ant antfile="${bedework.build.file}" inheritrefs="true"
284          target="javadoc" />
285   </target>
286
287   <!-- =================================================================
288        The "run.test" target builds and runs tests
289        ================================================================= -->
290
291   <target name="run.test" depends="init"
292           description="builds and runs the tests">
293     <ant antfile="${bedework.build.file}" inheritrefs="true"
294            target="run.test" />
295   </target>
296
297   <!-- =================================================================
298        The "start" target starts all quickstart components
299        ================================================================= -->
300
301   <target name="start" depends="run.init"
302           description="Start quickstart system" >
303     <parallel>
304       <antcall target="activemq" inheritrefs="true" />
305       <antcall target="dirstart" inheritrefs="true" />
306       <antcall target="hsqldb" inheritrefs="true" />
307
308       <sequential>
309         <!-- wait for activemq -->
310         <waitfor maxwait="3" maxwaitunit="minute" checkevery="250">
311            <socket server="localhost" port="8161"/>
312         </waitfor>
313
314         <!-- wait for the directory server -->
315         <waitfor maxwait="3" maxwaitunit="minute" checkevery="250">
316            <socket server="localhost" port="10389"/>
317         </waitfor>
318
319         <parallel>
320           <!-- Start the bedework non-web services -->
321           <antcall target="start-logger" inheritrefs="true" />
322
323           <antcall target="start-indexer" inheritrefs="true" />
324                
325           <antcall target="start-inoutscheduler" inheritrefs="true" />
326
327           <antcall target="tomcatstart" inheritrefs="true" />
328         </parallel>
329       </sequential>
330     </parallel>
331   </target>
332
333   <!-- =================================================================
334        The "start-debug" target starts the quickstart infrastructure components
335        ================================================================= -->
336
337   <target name="start-debug" depends="run.init"
338           description="Start quickstart system" >
339     <parallel>
340       <antcall target="activemq" inheritrefs="true" />
341       <antcall target="dirstart" inheritrefs="true" />
342       <antcall target="hsqldb" inheritrefs="true" />
343     </parallel>
344   </target>
345 </project>
Note: See TracBrowser for help on using the browser.