root/trunk/deployment/build.xml

Revision 3649 (checked in by douglm, 7 months ago)

Seem to need to define org.bedework.project.monitor

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