root/trunk/deployment/build.xml

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

A whole bunch of changes that somehow got missed

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   <dirname property="this.build.dir" file="${ant.file}"/>
59
60   <property name="bedework.deployment.base" location="${this.build.dir}" />
61  
62   <property name="org.bedework.deployment.resources"
63             location="${bedework.deployment.base}/resources" />
64  
65   <property name="ear.meta.dir" location="${this.build.dir}/ear.meta"/>
66
67   <target name="init" >
68     <property name="org.bedework.struts.tlds"
69               location="${resources.dir}/struts-1.2.9/tlds"/>
70
71     <!-- All the projects we deploy -->
72     <property name="org.bedework.project.bwtzsvr"
73               location="${org.bedework.project.bedework}/../bwtzsvr" />
74     <property name="org.bedework.project.bwwebapps"
75               location="${org.bedework.project.bedework}/../bwwebapps" />
76     <property name="org.bedework.project.bwcaldav"
77               location="${org.bedework.project.bedework}/../bwcaldav" />
78     <property name="org.bedework.project.caldavTest"
79               location="${org.bedework.project.bedework}/../caldavTest" />
80     <property name="org.bedework.project.testsuite"
81               location="${org.bedework.project.bedework}/../testsuite" />
82     <property name="org.bedework.project.bwtools"
83               location="${org.bedework.project.bedework}/../bwtools" />
84     <property name="org.bedework.project.dumprestore"
85               location="${org.bedework.project.bedework}/../dumprestore" />
86     <property name="org.bedework.project.indexer"
87               location="${org.bedework.project.bedework}/../indexer" />
88     <property name="org.bedework.project.bwsysevents"
89               location="${org.bedework.project.bedework}/../bwsysevents" />
90     <property name="org.bedework.project.bwcalFacade"
91               location="${org.bedework.project.bedework}/../bwcalFacade" />
92     <property name="org.bedework.project.bwcalcore"
93               location="${org.bedework.project.bedework}/../bwcalcore" />
94     <property name="org.bedework.project.carddav"
95               location="${org.bedework.project.bedework}/../carddav" />
96     <property name="org.bedework.project.synch"
97               location="${org.bedework.project.bedework}/../synch" />
98
99
100     <!-- default to debug off -->
101     <property name="app.debug.val" value="0" />
102
103     <!-- set these for the war builds -->
104     <dirname property="app.root.dir" file="${ant.file}"/>
105    
106     <property name="org.bedework.sou.hibernate.properties"
107               location="${org.bedework.deployment.resources}/hibernate" />
108    
109     <property name="org.bedework.jboss.datasource.jndiname"
110               value="${org.bedework.global.jboss.db.datasource.jndiname}" />
111    
112     <!-- Common resources directory -->
113     <property name="org.bedework.common.resources"
114               location="${app.root.dir}/resources" />
115   </target>
116
117   <target name="build.configured" depends="init" >
118     <!-- Clean up before we start -->
119     <delete dir="${org.bedework.temp.wars.home}" />
120
121     <antcall target="build.apps" inheritrefs="true" />
122   </target>
123
124   <!-- =================================================================
125        Targets called by the build.configured target. Each is conditional on a
126        config property and each executes a build file in a subdirectory of
127        this component.
128        ================================================================= -->
129
130   <target name="build.apps" >
131     <property name="org.bedework.deploy.kind" value="webapp" />
132     <antcall target="build.configured.apps" inheritrefs="true" />
133   </target>
134
135   <!-- =================================================================
136                          The deploy target.
137        ================================================================= -->
138
139   <target name="deploy" depends="init" >
140     <!-- Clean up before we start -->
141     <delete dir="${org.bedework.temp.wars.home}" />
142
143     <property name="org.bedework.lang.properties"
144               location="${org.bedework.deployment.resources}/org/bedework/locale/resources" />
145
146     <property name="org.bedework.xsllang.dir"
147               location="${org.bedework.temp.dir}/xsllang" />
148
149     <delete dir="${org.bedework.xsllang.dir}"/>
150     <mkdir dir="${org.bedework.xsllang.dir}"/>
151
152     <makeLangXsl dir="${org.bedework.lang.properties}"
153                  prefix="BwResources"
154                  resdir="${org.bedework.xsllang.dir}"
155                  xsldir="${org.bedework.xsllang.dir}"
156                  name="org.bedework.locales"
157                  check="true" />
158
159     <!-- Build the webapps stuff.-->
160     <antcall target="deploy.apps" inheritrefs="true" >
161       <param name="org.bedework.deploy.kind" value="webapp" />
162     </antcall>
163
164     <!-- Build the shellscr stuff.-->
165     <antcall target="deploy.apps" inheritrefs="true" >
166       <param name="org.bedework.deploy.kind" value="shellscr" />
167     </antcall>
168
169     <!-- ================= termination tasks for deployment ================ -->
170
171     <ant antfile="${org.bedework.deployment.base}/termination/build.xml"
172          inheritrefs="true" target="deploy" />
173   </target>
174
175   <!-- =================================================================
176        Targets called by the deploy target. Each is conditional on a
177        config property and each executes a build file in a subdirectory of
178        this component.
179        ================================================================= -->
180
181   <!-- The cp.xalan task conditionally copies the xalan.jar file, if
182        necessary -->
183   <target name="cp.xalan" if="xalan.in.tomcat.common.endorsed">
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   <target name="build.configured.apps">
192     <forEachApp names="${org.bedework.install.app.names}"
193                 prefix="org.bedework.deploy"
194                 appPrefix="org.bedework.app"
195                 projectPrefix="org.bedework.project">
196       <sequential>
197         <antcall target="build.available.configured.app" inheritrefs="true" />
198       </sequential>
199     </forEachApp>
200
201     <!-- ==================== termination tasks for apps ================= -->
202
203     <ant antfile="${org.bedework.deployment.base}/termination/${org.bedework.deploy.kind}/build.xml"
204          inheritrefs="true" target="build.configured" />
205   </target>
206
207   <target name="build.available.configured.app">
208     <propertycopy name="propval.app.type"
209                   from="bedework-options.org.bedework.app.${org.bedework.deploy.name}.appType" />
210     <property name="org.bedework.deploy.type.dir"
211               location="${app.root.dir}/${org.bedework.deploy.name}/${propval.app.type}" />
212     <if>
213       <istrue value="${org.bedework.build.debug}" />
214       <then>
215         <echo message="*************** deployment build directory is ${org.bedework.deploy.type.dir}" />
216       </then>
217     </if>
218
219     <if>
220       <available file="${org.bedework.deploy.type.dir}/${org.bedework.deploy.kind}/build.xml"/>
221       <then>
222         <propertyset id="deploy-app-properties">
223           <propertyref prefix="org.bedework.app.${org.bedework.deploy.name}"/>
224           <globmapper from="org.bedework.app.${org.bedework.deploy.name}.*" to="propval.app.*"/>
225         </propertyset>
226
227         <propertycopy name="propval.app.unauthenticated"
228                       from="bedework-options.org.bedework.app.${org.bedework.deploy.name}.guestMode" />
229         <ant antfile="${org.bedework.deploy.type.dir}/${org.bedework.deploy.kind}/build.xml"
230              inheritrefs="true" target="build.configured" >
231           <propertyset refid="deploy-app-properties" />
232         </ant>
233       </then>
234     </if>
235   </target>
236
237   <target name="deploy.apps">
238     <forEachApp names="${org.bedework.install.app.names}"
239                 prefix="org.bedework.deploy"
240                 appPrefix="org.bedework.app"
241                 projectPrefix="org.bedework.project">
242       <sequential>
243         <antcall target="deploy.available.app" inheritrefs="true" />
244       </sequential>
245     </forEachApp>
246
247     <!-- =================== termination tasks for apps ================= -->
248
249     <ant antfile="${org.bedework.deployment.base}/termination/${org.bedework.deploy.kind}/build.xml"
250          inheritrefs="true" target="deploy" />
251   </target>
252
253   <target name="deploy.available.app">
254     <propertycopy name="propval.app.type"
255                   from="bedework-options.org.bedework.app.${org.bedework.deploy.name}.appType" />
256     <property name="org.bedework.deploy.type.dir"
257               location="${app.root.dir}/${propval.app.type}" />
258     <if>
259       <istrue value="${org.bedework.build.debug}" />
260       <then>
261         <echo message="*********************** deployment build directory is ${org.bedework.deploy.type.dir}" />
262       </then>
263     </if>
264
265     <if>
266       <available file="${org.bedework.deploy.type.dir}/${org.bedework.deploy.kind}/build.xml"/>
267       <then>
268         <propertyset id="deploy-app-properties">
269           <propertyref prefix="org.bedework.app.${org.bedework.deploy.name}."/>
270           <globmapper from="org.bedework.app.${org.bedework.deploy.name}.*" to="propval.app.*"/>
271         </propertyset>
272
273         <propertycopy name="propval.app.unauthenticated"
274                       from="bedework-options.org.bedework.app.${org.bedework.deploy.name}.guestMode" />
275        
276         <ant antfile="${org.bedework.deploy.type.dir}/${org.bedework.deploy.kind}/build.xml"
277              inheritrefs="true" target="deploy" >
278           <propertyset refid="deploy-app-properties" />
279         </ant>
280       </then>
281     </if>
282   </target>
283 </project>
284
Note: See TracBrowser for help on using the browser.