root/trunk/deployment/build.xml

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

Fixed a build bug that caused a build failure after a clean.
Removed a lot of copying of files. There's now a definition of exactly which libraries are needed for the ears. This allows us to be more specific about which jars get loaded

Removed some geronimo stuff added a while back. It was all out of date.

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 application 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
75   <import file="${build.dir}/buildTools/getJar.xml"/>
76
77   <import file="${build.dir}/loadDeployConfig.xml"/>
78  
79   <property name="ear.meta.dir" location="${this.build.dir}/ear.meta"/>
80
81   <target name="init" >
82     <property name="org.bedework.struts.tlds"
83               location="${resources.dir}/struts-1.2.9/tlds"/>
84
85     <loadDeployConfig />
86
87     <!-- default to debug off -->
88     <property name="app.debug.val" value="0" />
89
90     <!-- set these for the war builds -->
91     <dirname property="app.root.dir" file="${ant.file}"/>
92    
93     <property name="org.bedework.deployment.name"
94               value="bedework" />
95    
96     <property name="org.bedework.sou.hibernate.properties"
97               location="${org.bedework.project.calendarapi}/calCore/resources" />
98    
99     <property name="org.bedework.jboss.datasource.jndiname"
100               value="${org.bedework.global.jboss.db.datasource.jndiname}" />
101    
102     <!-- Common resources directory -->
103     <property name="org.bedework.common.resources"
104               location="${app.root.dir}/resources" />
105
106     <property name="org.bedework.global.build.common.context.war.name"
107               value="bw-common" />
108
109     <!-- Where we put ear stuff -->
110     <if>
111       <isset property="org.bedework.global.build.ear" />
112       <then>
113         <property name="app.ear.file.name"
114                   value="${org.bedework.global.ear.name}.ear" />
115
116         <property name="org.bedework.ear.name"
117                   value="${org.bedework.global.ear.name}" />
118
119         <property name="org.bedework.ear.properties.dir"
120                   location="${org.bedework.temp.dir}/ear-properties" />
121
122         <delete dir="${org.bedework.ear.templib}" />
123         <mkdir dir="${org.bedework.ear.templib}" />
124
125         <delete dir="${org.bedework.ear.properties.dir}" />
126         <mkdir dir="${org.bedework.ear.properties.dir}" />
127       </then>
128     </if>
129
130     <property name="org.bedework.global.context.roots"
131               location="${org.bedework.temp.dir}/context-roots.properties" />
132
133     <if>
134       <not>
135         <isset property="org.bedework.global.context.roots" />
136       </not>
137       <then>
138         <tempfile property="org.bedework.global.context.roots"
139                   destdir="${org.bedework.temp.dir}"
140                   prefix="context-roots" suffix=".properties" />
141       </then>
142     </if>
143   </target>
144
145   <target name="build.configured" depends="init" >
146     <!-- Clean up before we start -->
147     <delete dir="${org.bedework.temp.wars.home}" />
148
149     <antcall target="build.apps" inheritrefs="true" />
150   </target>
151
152   <!-- =================================================================
153        Targets called by the build.configured target. Each is conditional on a
154        config property and each executes a build file in a subdirectory of
155        this component.
156        ================================================================= -->
157
158   <target name="build.apps" >
159     <property name="org.bedework.deploy.kind" value="webapp" />
160     <antcall target="build.configured.apps" inheritrefs="true" />
161   </target>
162
163   <!-- =================================================================
164                          The deploy target.
165        ================================================================= -->
166
167   <target name="deploy" depends="init" >
168     <!-- Clean up before we start -->
169     <delete dir="${org.bedework.temp.wars.home}" />
170
171     <property name="org.bedework.lang.properties"
172               location="${org.bedework.project.calendarapi}/calFacade/resources/org/bedework/locale/resources" />
173
174     <property name="org.bedework.xsllang.dir"
175               location="${org.bedework.temp.dir}/xsllang" />
176
177     <delete dir="${org.bedework.xsllang.dir}"/>
178     <mkdir dir="${org.bedework.xsllang.dir}"/>
179
180     <makeLangXsl dir="${org.bedework.lang.properties}"
181                  prefix="BwResources"
182                  resdir="${org.bedework.xsllang.dir}"
183                  xsldir="${org.bedework.xsllang.dir}"
184                  name="org.bedework.locales"
185                  check="true" />
186
187     <!-- Build the webapps stuff.-->
188     <antcall target="deploy.apps" inheritrefs="true" >
189       <param name="org.bedework.deploy.kind" value="webapp" />
190     </antcall>
191
192     <!-- Build the shellscr stuff.-->
193     <antcall target="deploy.apps" inheritrefs="true" >
194       <param name="org.bedework.deploy.kind" value="shellscr" />
195     </antcall>
196
197     <!-- ================= termination tasks for deployment ================ -->
198
199     <ant antfile="${org.bedework.deployment.base}/termination/build.xml"
200          inheritrefs="true" target="deploy" />
201   </target>
202
203   <!-- =================================================================
204        Targets called by the deploy target. Each is conditional on a
205        config property and each executes a build file in a subdirectory of
206        this component.
207        ================================================================= -->
208
209   <!-- The cp.xalan task conditionally copies the xalan.jar file, if
210        necessary -->
211   <target name="cp.xalan" if="xalan.in.tomcat.common.endorsed">
212     <copy file="${org.bedework.default.lib}/xalan.jar"
213           todir="${appserver.endorsed.dir}"/>
214   </target>
215
216   <!-- =================================================================
217        Targets called by the build.configured target. Each is conditional on a
218        config property and each executes a build file in a subdirectory of
219        this component.
220        ================================================================= -->
221   <target name="build.configured.apps">
222     <forEachApp names="${org.bedework.install.app.names}"
223                 prefix="org.bedework.deploy"
224                 appPrefix="org.bedework.app"
225                 projectPrefix="org.bedework.project">
226       <sequential>
227         <antcall target="build.available.configured.app" inheritrefs="true" />
228       </sequential>
229     </forEachApp>
230
231     <!-- ==================== termination tasks for apps ================= -->
232
233     <ant antfile="${org.bedework.deployment.base}/termination/${org.bedework.deploy.kind}/build.xml"
234          inheritrefs="true" target="build.configured" />
235   </target>
236
237   <target name="build.available.configured.app">
238     <propertycopy name="propval.app.type"
239                   from="bedework-options.org.bedework.app.${org.bedework.deploy.name}.appType" />
240     <property name="org.bedework.deploy.type.dir"
241               location="${app.root.dir}/${org.bedework.deploy.name}/${propval.app.type}" />
242     <if>
243       <istrue value="${org.bedework.build.debug}" />
244       <then>
245         <echo message="*************** deployment build directory is ${org.bedework.deploy.type.dir}" />
246       </then>
247     </if>
248
249     <if>
250       <available file="${org.bedework.deploy.type.dir}/${org.bedework.deploy.kind}/build.xml"/>
251       <then>
252         <propertyset id="deploy-app-properties">
253           <propertyref prefix="org.bedework.app.${org.bedework.deploy.name}"/>
254           <globmapper from="org.bedework.app.${org.bedework.deploy.name}.*" to="propval.app.*"/>
255         </propertyset>
256
257         <propertycopy name="propval.app.unauthenticated"
258                       from="bedework-options.org.bedework.app.${org.bedework.deploy.name}.guestMode" />
259
260         <ant antfile="${org.bedework.deploy.type.dir}/${org.bedework.deploy.kind}/build.xml"
261              inheritrefs="true" target="build.configured" >
262           <propertyset refid="deploy-app-properties" />
263         </ant>
264       </then>
265     </if>
266   </target>
267
268   <target name="deploy.apps">
269     <forEachApp names="${org.bedework.install.app.names}"
270                 prefix="org.bedework.deploy"
271                 appPrefix="org.bedework.app"
272                 projectPrefix="org.bedework.project">
273       <sequential>
274         <antcall target="deploy.available.app" inheritrefs="true" />
275       </sequential>
276     </forEachApp>
277
278     <!-- =================== termination tasks for apps ================= -->
279
280     <ant antfile="${org.bedework.deployment.base}/termination/${org.bedework.deploy.kind}/build.xml"
281          inheritrefs="true" target="deploy" />
282   </target>
283
284   <target name="deploy.available.app">
285     <propertycopy name="propval.app.type"
286                   from="bedework-options.org.bedework.app.${org.bedework.deploy.name}.appType" />
287     <property name="org.bedework.deploy.type.dir"
288               location="${app.root.dir}/${propval.app.type}" />
289     <if>
290       <istrue value="${org.bedework.build.debug}" />
291       <then>
292         <echo message="*********************** deployment build directory is ${org.bedework.deploy.type.dir}" />
293       </then>
294     </if>
295
296     <if>
297       <available file="${org.bedework.deploy.type.dir}/${org.bedework.deploy.kind}/build.xml"/>
298       <then>
299         <propertyset id="deploy-app-properties">
300           <propertyref prefix="org.bedework.app.${org.bedework.deploy.name}"/>
301           <globmapper from="org.bedework.app.${org.bedework.deploy.name}.*" to="propval.app.*"/>
302         </propertyset>
303
304         <propertycopy name="propval.app.unauthenticated"
305                       from="bedework-options.org.bedework.app.${org.bedework.deploy.name}.guestMode" />
306
307         <ant antfile="${org.bedework.deploy.type.dir}/${org.bedework.deploy.kind}/build.xml"
308              inheritrefs="true" target="deploy" >
309           <propertyset refid="deploy-app-properties" />
310         </ant>
311       </then>
312     </if>
313   </target>
314 </project>
315
Note: See TracBrowser for help on using the browser.