root/releases/bedework-3.8/deployment/build.xml

Revision 3414 (checked in by douglm, 1 year ago)

(Partial updates as full update failed with some conflict)

Major refactoring of code to move all jar building into separate projects outside of the main bedework project which itself becomes an assembly project - that is it builds deployable components from the jars and other information.

This change is to facilitate the move to jboss 7.

Further changes are needed but probably no more major reorganization.

Line 
1 <?xml version="1.0"?>
2
3 <!-- ===================== Deployment build file =======================
4      This directory and the files within it are to be part of the config
5      and deployment process.
6      
7      ======================== new comment ========================
8      Modules are of type and kind.
9      
10      The type is for example, webadmin, usercaldav etc.
11      
12      The kind is webapp, shellscr etc.
13      
14      We cycle over the information we have for each application we want to
15      build and for each application use ants property mapping to map the
16      properties onto a constant set of names, e.g. the applicfation specific
17      name
18          org.bedework.app.CalAdmin.deploy.dir
19      would be mapped onto
20          propval.app.deploy.dir
21          
22      We then look for build.xml files on a path given by the type and kind,
23      for example
24          webadmin/webapp/build.xml
25      or
26          indexer/shellscr/build.xml
27          
28      The intent was to allow certain modules to be built in different forms.
29      At one point it was also the case that we tried to deal with platform
30      specific issues through this scheme. Now that is handled by importing
31      platform specific build files into a generic build file.
32      
33      That may allow for some simplification.
34      ======================== old comment ========================
35
36      A number of properties of the form org.bedework.install.XXX will be
37      defined, each indicating that a particular component is to be deployed.
38
39      Targets below will be executed only if that property is defined.
40
41      Adding a new configuration, e.g. a different portal platform, requires
42      the steps:
43         Create a subdirectory in each components subdirectory,
44         e.g.  webadmin/myportal
45
46         Create any other required resource directories and resources and
47         create a build.xml file to configure and package the component(s).
48
49         Update the config program to load, save and display the new
50         properties for that configuration.
51
52         Add an antcall for each component and a corresponding target
53
54      Authors: Mike Douglass   douglm rpi.edu
55      =================================================================== -->
56
57 <project name="deploy.bedework" default="init">
58   <property name="org.bedework.temp.wars.home"
59             location="${org.bedework.temp.dir}/wars" />
60
61   <property name="org.bedework.temp.shellscr.home"
62             location="${org.bedework.temp.dir}/shellscr" />
63
64   <!-- Recreated by each app build file. Place extra jars here -->
65   <property name="org.bedework.temp.extrajars.dir"
66             location="${org.bedework.temp.dir}/extrajars" />
67
68   <!-- Preserve extra jars for ear builds -->
69   <property name="org.bedework.temp.ear.extrajars.dir"
70             location="${org.bedework.temp.dir}/earextrajars" />
71        
72   <dirname property="this.build.dir" file="${ant.file}"/>
73   <property name="bedework.deployment.base" location="${this.build.dir}" />
74   <property name="org.bedework.deployment.resources"
75             location="${bedework.deployment.base}/resources" />
76
77   <import file="${build.dir}/buildTools/getJar.xml"/>
78
79   <import file="${build.dir}/loadDeployConfig.xml"/>
80  
81   <property name="ear.meta.dir" location="${this.build.dir}/ear.meta"/>
82
83   <target name="init" >
84     <property name="org.bedework.struts.tlds"
85               location="${resources.dir}/struts-1.2.9/tlds"/>
86
87     <loadDeployConfig />
88
89     <!-- All the projects we deploy -->
90     <property name="org.bedework.project.bwtzsvr"
91               location="${org.bedework.project.bedework}/../bwtzsvr" />
92     <property name="org.bedework.project.bwwebapps"
93               location="${org.bedework.project.bedework}/../bwwebapps" />
94     <property name="org.bedework.project.bwcaldav"
95               location="${org.bedework.project.bedework}/../bwcaldav" />
96     <property name="org.bedework.project.caldavTest"
97               location="${org.bedework.project.bedework}/../caldavTest" />
98     <property name="org.bedework.project.testsuite"
99               location="${org.bedework.project.bedework}/../testsuite" />
100     <property name="org.bedework.project.bwtools"
101               location="${org.bedework.project.bedework}/../bwtools" />
102     <property name="org.bedework.project.dumprestore"
103               location="${org.bedework.project.bedework}/../dumprestore" />
104     <property name="org.bedework.project.indexer"
105               location="${org.bedework.project.bedework}/../indexer" />
106     <property name="org.bedework.project.bwsysevents"
107               location="${org.bedework.project.bedework}/../bwsysevents" />
108     <property name="org.bedework.project.bwcalFacade"
109               location="${org.bedework.project.bedework}/../bwcalFacade" />
110     <property name="org.bedework.project.bwcalcore"
111               location="${org.bedework.project.bedework}/../bwcalcore" />
112     <property name="org.bedework.project.carddav"
113               location="${org.bedework.project.bedework}/../carddav" />
114     <property name="org.bedework.project.synch"
115               location="${org.bedework.project.bedework}/../synch" />
116
117
118     <!-- default to debug off -->
119     <property name="app.debug.val" value="0" />
120
121     <!-- set these for the war builds -->
122     <dirname property="app.root.dir" file="${ant.file}"/>
123    
124     <property name="org.bedework.deployment.name"
125               value="bedework" />
126    
127     <property name="org.bedework.sou.hibernate.properties"
128               location="${org.bedework.deployment.resources}/hibernate" />
129    
130     <property name="org.bedework.jboss.datasource.jndiname"
131               value="${org.bedework.global.jboss.db.datasource.jndiname}" />
132    
133     <!-- Common resources directory -->
134     <property name="org.bedework.common.resources"
135               location="${app.root.dir}/resources" />
136
137     <property name="org.bedework.global.build.common.context.war.name"
138               value="bw-common" />
139
140     <!-- Where we put ear stuff -->
141     <if>
142       <isset property="org.bedework.global.build.ear" />
143       <then>
144         <property name="app.ear.file.name"
145                   value="${org.bedework.global.ear.name}.ear" />
146
147         <property name="org.bedework.ear.name"
148                   value="${org.bedework.global.ear.name}" />
149
150         <property name="org.bedework.ear.properties.dir"
151                   location="${org.bedework.temp.dir}/ear-properties" />
152
153         <property name="org.bedework.ear.templib"
154                   location="${org.bedework.temp.dir}/earlib"/>
155        
156         <delete dir="${org.bedework.ear.templib}" />
157         <mkdir dir="${org.bedework.ear.templib}" />
158
159         <delete dir="${org.bedework.ear.properties.dir}" />
160         <mkdir dir="${org.bedework.ear.properties.dir}" />
161       </then>
162     </if>
163
164     <property name="org.bedework.global.context.roots"
165               location="${org.bedework.temp.dir}/context-roots.properties" />
166
167     <if>
168       <not>
169         <isset property="org.bedework.global.context.roots" />
170       </not>
171       <then>
172         <tempfile property="org.bedework.global.context.roots"
173                   destdir="${org.bedework.temp.dir}"
174                   prefix="context-roots" suffix=".properties" />
175       </then>
176     </if>
177   </target>
178
179   <target name="build.configured" depends="init" >
180     <!-- Clean up before we start -->
181     <delete dir="${org.bedework.temp.wars.home}" />
182
183     <antcall target="build.apps" inheritrefs="true" />
184   </target>
185
186   <!-- =================================================================
187        Targets called by the build.configured target. Each is conditional on a
188        config property and each executes a build file in a subdirectory of
189        this component.
190        ================================================================= -->
191
192   <target name="build.apps" >
193     <property name="org.bedework.deploy.kind" value="webapp" />
194     <antcall target="build.configured.apps" inheritrefs="true" />
195   </target>
196
197   <!-- =================================================================
198                          The deploy target.
199        ================================================================= -->
200
201   <target name="deploy" depends="init" >
202     <!-- Clean up before we start -->
203     <delete dir="${org.bedework.temp.wars.home}" />
204
205     <property name="org.bedework.lang.properties"
206               location="${org.bedework.deployment.resources}/org/bedework/locale/resources" />
207
208     <property name="org.bedework.xsllang.dir"
209               location="${org.bedework.temp.dir}/xsllang" />
210
211     <delete dir="${org.bedework.xsllang.dir}"/>
212     <mkdir dir="${org.bedework.xsllang.dir}"/>
213
214     <makeLangXsl dir="${org.bedework.lang.properties}"
215                  prefix="BwResources"
216                  resdir="${org.bedework.xsllang.dir}"
217                  xsldir="${org.bedework.xsllang.dir}"
218                  name="org.bedework.locales"
219                  check="true" />
220
221     <!-- Build the webapps stuff.-->
222     <antcall target="deploy.apps" inheritrefs="true" >
223       <param name="org.bedework.deploy.kind" value="webapp" />
224     </antcall>
225
226     <!-- Build the shellscr stuff.-->
227     <antcall target="deploy.apps" inheritrefs="true" >
228       <param name="org.bedework.deploy.kind" value="shellscr" />
229     </antcall>
230
231     <!-- ================= termination tasks for deployment ================ -->
232
233     <ant antfile="${org.bedework.deployment.base}/termination/build.xml"
234          inheritrefs="true" target="deploy" />
235   </target>
236
237   <!-- =================================================================
238        Targets called by the deploy target. Each is conditional on a
239        config property and each executes a build file in a subdirectory of
240        this component.
241        ================================================================= -->
242
243   <!-- The cp.xalan task conditionally copies the xalan.jar file, if
244        necessary -->
245   <target name="cp.xalan" if="xalan.in.tomcat.common.endorsed">
246     <copy file="${org.bedework.default.lib}/xalan.jar"
247           todir="${appserver.endorsed.dir}"/>
248   </target>
249
250   <!-- =================================================================
251        Targets called by the build.configured target. Each is conditional on a
252        config property and each executes a build file in a subdirectory of
253        this component.
254        ================================================================= -->
255   <target name="build.configured.apps">
256     <forEachApp names="${org.bedework.install.app.names}"
257                 prefix="org.bedework.deploy"
258                 appPrefix="org.bedework.app"
259                 projectPrefix="org.bedework.project">
260       <sequential>
261         <antcall target="build.available.configured.app" inheritrefs="true" />
262       </sequential>
263     </forEachApp>
264
265     <!-- ==================== termination tasks for apps ================= -->
266
267     <ant antfile="${org.bedework.deployment.base}/termination/${org.bedework.deploy.kind}/build.xml"
268          inheritrefs="true" target="build.configured" />
269   </target>
270
271   <target name="build.available.configured.app">
272     <propertycopy name="propval.app.type"
273                   from="bedework-options.org.bedework.app.${org.bedework.deploy.name}.appType" />
274     <property name="org.bedework.deploy.type.dir"
275               location="${app.root.dir}/${org.bedework.deploy.name}/${propval.app.type}" />
276     <if>
277       <istrue value="${org.bedework.build.debug}" />
278       <then>
279         <echo message="*************** deployment build directory is ${org.bedework.deploy.type.dir}" />
280       </then>
281     </if>
282
283     <if>
284       <available file="${org.bedework.deploy.type.dir}/${org.bedework.deploy.kind}/build.xml"/>
285       <then>
286         <propertyset id="deploy-app-properties">
287           <propertyref prefix="org.bedework.app.${org.bedework.deploy.name}"/>
288           <globmapper from="org.bedework.app.${org.bedework.deploy.name}.*" to="propval.app.*"/>
289         </propertyset>
290
291         <propertycopy name="propval.app.unauthenticated"
292                       from="bedework-options.org.bedework.app.${org.bedework.deploy.name}.guestMode" />
293
294         <ant antfile="${org.bedework.deploy.type.dir}/${org.bedework.deploy.kind}/build.xml"
295              inheritrefs="true" target="build.configured" >
296           <propertyset refid="deploy-app-properties" />
297         </ant>
298       </then>
299     </if>
300   </target>
301
302   <target name="deploy.apps">
303     <forEachApp names="${org.bedework.install.app.names}"
304                 prefix="org.bedework.deploy"
305                 appPrefix="org.bedework.app"
306                 projectPrefix="org.bedework.project">
307       <sequential>
308         <antcall target="deploy.available.app" inheritrefs="true" />
309       </sequential>
310     </forEachApp>
311
312     <!-- =================== termination tasks for apps ================= -->
313
314     <ant antfile="${org.bedework.deployment.base}/termination/${org.bedework.deploy.kind}/build.xml"
315          inheritrefs="true" target="deploy" />
316   </target>
317
318   <target name="deploy.available.app">
319     <propertycopy name="propval.app.type"
320                   from="bedework-options.org.bedework.app.${org.bedework.deploy.name}.appType" />
321     <property name="org.bedework.deploy.type.dir"
322               location="${app.root.dir}/${propval.app.type}" />
323     <if>
324       <istrue value="${org.bedework.build.debug}" />
325       <then>
326         <echo message="*********************** deployment build directory is ${org.bedework.deploy.type.dir}" />
327       </then>
328     </if>
329
330     <if>
331       <available file="${org.bedework.deploy.type.dir}/${org.bedework.deploy.kind}/build.xml"/>
332       <then>
333         <propertyset id="deploy-app-properties">
334           <propertyref prefix="org.bedework.app.${org.bedework.deploy.name}"/>
335           <globmapper from="org.bedework.app.${org.bedework.deploy.name}.*" to="propval.app.*"/>
336         </propertyset>
337
338         <propertycopy name="propval.app.unauthenticated"
339                       from="bedework-options.org.bedework.app.${org.bedework.deploy.name}.guestMode" />
340
341         <ant antfile="${org.bedework.deploy.type.dir}/${org.bedework.deploy.kind}/build.xml"
342              inheritrefs="true" target="deploy" >
343           <propertyset refid="deploy-app-properties" />
344         </ant>
345       </then>
346     </if>
347   </target>
348 </project>
349
Note: See TracBrowser for help on using the browser.