root/trunk/deployment/build.xml

Revision 1900 (checked in by douglm, 5 years ago)

Changes to avoid source of StaleStateExceptions? from hibernate.

Move collection lastmod out of the BwCalendar? class into a separate table and class BwLastMod? (and BwCollectionLastmod?.

Update touchCalendar to only update the lastmod object.

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      A number of properties of the form org.bedework.install.XXX will be
8      defined, each indicating that a particualr component is to be deployed.
9
10      Targets below will be executed only if that property is defined.
11
12      Adding a new configuration, e.g. a different portal platform, requires
13      the steps:
14         Create a subdirectory in each components subdirectory,
15         e.g.  webadmin/myportal
16
17         Create any other required resource directories and resources and
18         create a build.xml file to configure and package the component(s).
19
20         Update the config program to load, save and display the new
21         properties for that configuration.
22
23         Add an antcall for each component and a corresponding target
24
25      Authors: Mike Douglass   douglm@rpi.edu
26      =================================================================== -->
27
28 <project name="deploy.bedework" default="init">
29   <property name="base.name" value="deployment"/>
30
31   <property name="org.bedework.temp.wars.home"
32             location="${org.bedework.temp.dir}/wars" />
33
34   <property name="org.bedework.temp.shellscr.home"
35             location="${org.bedework.temp.dir}/shellscr" />
36
37   <!-- Recreateed by each app build file. Place extra jars here -->
38   <property name="org.bedework.temp.extrajars.dir"
39             location="${org.bedework.temp.dir}/extrajars" />
40
41   <!-- Load the location of the libraries -->
42   <property file="${org.bedework.project.bedework}/build/libjars.properties" />
43
44   <dirname property="this.build.dir" file="${ant.file}"/>
45   <property name="bedework.deployment.base" location="this.build.dir" />
46
47   <import file="${build.dir}/getJar.xml"/>
48
49   <import file="${this.build.dir}/appjars.xml" />
50
51   <target name="init" >
52     <getAppJars />
53
54     <property name="source.home" location="${this.build.dir}/src"/>
55
56     <!-- Load default deploy properties
57     <property file="${this.build.dir}/deploy.properties"/>
58      -->
59
60     <!-- ==================== config properties ========================= -->
61     <property name="org.bedework.config.properties"
62               location="${org.bedework.config.base}/configs/democal.properties" />
63     <property name="org.bedework.config.options"
64               location="${org.bedework.config.base}/configs/democal.options.xml" />
65
66     <echo message="==========================================================" />
67     <echo message="Use config properties ${org.bedework.config.properties}" />
68     <loadproperties
69           srcFile="${org.bedework.config.properties}" >
70       <filterchain>
71         <expandproperties/>
72       </filterchain>
73     </loadproperties>
74
75     <!-- default to debug off -->
76     <property name="app.debug.val" value="0" />
77
78     <!-- set this for the war builds -->
79     <dirname property="app.root.dir" file="${ant.file}"/>
80
81     <!-- Common resources directory -->
82     <property name="org.bedework.common.resources"
83               location="${app.root.dir}/resources" />
84
85     <if>
86       <not>
87         <isset property="org.bedework.global.context.roots" />
88       </not>
89       <then>
90         <tempfile property="org.bedework.global.context.roots"
91                   destdir="${org.bedework.temp.dir}"
92                   prefix="context-roots" suffix=".properties" />
93       </then>
94     </if>
95
96     <!-- ==================== config properties =========================
97     <property name="org.bedework.config.properties"
98               location="${org.bedework.config.base}/configs/${org.bedework.clone.name}.properties" />
99
100     <echo message="==========================================================" />
101     <echo message="Use clone properties ${org.bedework.config.properties}" />
102     <loadproperties
103           srcFile="${org.bedework.config.properties}" >
104       <filterchain>
105         <expandproperties/>
106       </filterchain>
107     </loadproperties>
108     -->
109   </target>
110
111   <target name="deftasks" depends="init">
112     <path id="app.xml.cp">
113       <pathelement location="${org.bedework.deployutil.jar}"/>
114     </path>
115
116     <taskdef name="forEachApp"
117              classname="org.bedework.deployment.ForEachAppTask">
118       <classpath refid="app.xml.cp"/>
119     </taskdef>
120
121     <taskdef name="resolveFile"
122              classname="org.bedework.deployment.ResolveFile">
123       <classpath refid="app.xml.cp"/>
124     </taskdef>
125
126     <taskdef name="makeLangXsl"
127              classname="org.bedework.deployment.MakeLangXsl">
128       <classpath refid="app.xml.cp"/>
129     </taskdef>
130   </target>
131
132   <target name="build.configured" depends="deftasks" >
133     <!-- Clean up before we start -->
134     <delete dir="${org.bedework.temp.wars.home}" />
135
136     <antcall target="build.standalone.apps" inheritrefs="true" />
137
138     <antcall target="build.portal.apps" inheritrefs="true" />
139
140     <antcall target="build.j2ee.apps" inheritrefs="true" />
141   </target>
142
143   <!-- =================================================================
144        Targets called by the build.configured target. Each is conditional on a
145        config property and each executes a build file in a subdirectory of
146        this component.
147        ================================================================= -->
148
149   <target name="build.standalone.apps" if="org.bedework.global.build.standalone.app" >
150     <!-- ======================= webconfig - only standalone =================
151     <ant antfile="${org.bedework.deployment.base}/webconfig/webapp/build.xml"
152          inheritrefs="true" target="build.configured" />
153           -->
154
155     <property name="org.bedework.deploy.kind" value="webapp" />
156     <antcall target="build.configured.apps" inheritrefs="true" />
157   </target>
158
159   <target name="build.portal.apps" if="org.bedework.global.portal.platform" >
160     <property name="org.bedework.deploy.kind"
161               value="${org.bedework.global.portal.platform}" />
162     <antcall target="build.configured.apps" inheritrefs="true" />
163   </target>
164
165   <target name="build.j2ee.apps" if="org.bedework.global.j2ee.platform" >
166     <property name="org.bedework.deploy.kind"
167               value="${org.bedework.global.j2ee.platform}" />
168     <antcall target="build.configured.apps" inheritrefs="true" />
169   </target>
170
171   <!-- =================================================================
172                          The deploy target.
173        ================================================================= -->
174
175   <target name="deploy" depends="deftasks" >
176     <!-- Clean up before we start -->
177     <delete dir="${org.bedework.temp.wars.home}" />
178
179     <property name="org.bedework.lang.properties"
180               location="${org.bedework.project.calendarapi}/calFacade/resources/org/bedework/locale/resources" />
181
182     <property name="org.bedework.xsllang.dir"
183               location="${org.bedework.temp.dir}/xsllang" />
184
185     <delete dir="${org.bedework.xsllang.dir}"/>
186     <mkdir dir="${org.bedework.xsllang.dir}"/>
187
188     <makeLangXsl dir="${org.bedework.lang.properties}"
189                  prefix="BwResources"
190                  resdir="${org.bedework.xsllang.dir}"
191                  xsldir="${org.bedework.xsllang.dir}"
192                  name="org.bedework.locales"
193                  check="true" />
194
195     <echo message="LLLLLLLLLLLLLLLLLLLL locales=${org.bedework.locales}" />
196
197     <!--<antcall target="deploy.standalone.apps" inheritrefs="true" />-->
198     <if>
199       <isset property="org.bedework.global.build.standalone.app" />
200       <then>
201         <antcall target="deploy.apps" inheritrefs="true" >
202           <param name="org.bedework.deploy.kind" value="webapp" />
203         </antcall>
204       </then>
205     </if>
206
207     <!--<antcall target="deploy.shellscr.apps" inheritrefs="true" />-->
208     <!-- Always build the shellscr stuff.-->
209     <antcall target="deploy.apps" inheritrefs="true" >
210       <param name="org.bedework.deploy.kind" value="shellscr" />
211     </antcall>
212
213     <!-- <antcall target="deploy.portal.apps" inheritrefs="true" />-->
214     <if>
215       <isset property="org.bedework.global.portal.platform" />
216       <then>
217         <antcall target="deploy.apps" inheritrefs="true" >
218           <param name="org.bedework.deploy.kind"
219                  value="${org.bedework.global.portal.platform}" />
220         </antcall>
221       </then>
222     </if>
223
224     <!-- <antcall target="deploy.j2ee.apps" inheritrefs="true" />-->
225     <if>
226       <isset property="org.bedework.global.j2ee.platform" />
227       <then>
228         <antcall target="deploy.apps" inheritrefs="true" >
229           <param name="org.bedework.deploy.kind"
230                  value="${org.bedework.global.j2ee.platform}" />
231         </antcall>
232       </then>
233     </if>
234
235     <!-- copy startup website that sends you to the applications -->
236     <delete dir="${webapp.root.dir}/bedework"/>
237     <mkdir dir="${webapp.root.dir}/bedework"/>
238     <copy todir="${webapp.root.dir}/bedework">
239       <fileset dir="${app.root.dir}/resources/bedework"/>
240     </copy>
241
242     <!-- copy libs that the application server needs -->
243     <antcall target="deploy.appserver.jdbcdriver" inheritrefs="true" />
244     <antcall target="deploy.appserver.javatools" inheritrefs="true" />
245   </target>
246
247   <!-- =================================================================
248        Targets called by the deploy target. Each is conditional on a
249        config property and each executes a build file in a subdirectory of
250        this component.
251        ================================================================= -->
252
253   <!-- The cp.xalan task conditionally copies the xalan.jar file, if
254        necessary -->
255   <target name="cp.xalan" if="xalan.in.tomcat.common.endorsed">
256     <copy file="${org.bedework.default.lib}/xalan.jar"
257           todir="${appserver.endorsed.dir}"/>
258   </target>
259
260   <target name="deploy.appserver.jdbcdriver"
261           if="appserver.jdbcdriver.jar" >
262     <!-- copy jdbc jar so datasources work -->
263     <copy todir="${appserver.lib.dir}" file="${appserver.jdbcdriver.jar}"/>
264   </target>
265
266   <target name="deploy.appserver.javatools"
267           if="java.tools.jar" >
268     <!-- copy tools jar so jsps work -->
269     <copy todir="${appserver.lib.dir}" file="${java.tools.jar}"/>
270   </target>
271
272   <!-- =================================================================
273        Targets called by the build.configured target. Each is conditional on a
274        config property and each executes a build file in a subdirectory of
275        this component.
276        ================================================================= -->
277   <target name="build.configured.apps">
278     <forEachApp names="${org.bedework.install.app.names}"
279                 prefix="org.bedework.deploy"
280                 appPrefix="org.bedework.app"
281                 projectPrefix="org.bedework.project">
282       <sequential>
283         <available file="${org.bedework.deploy.type.dir}/${org.bedework.deploy.kind}/build.xml"
284                    property="app.kind.available" />
285         <antcall target="build.available.configured.app" inheritrefs="true" />
286       </sequential>
287     </forEachApp>
288
289     <!-- ======================= termination tasks ================= -->
290     <!--
291     <property name="org.bedework.deploy.type.dir"
292               location="${org.bedework.deployment.base}/termination" />
293               -->
294
295     <ant antfile="${org.bedework.deployment.base}/termination/build.xml"
296          inheritrefs="true" target="build.configured" />
297   </target>
298
299   <target name="build.available.configured.app" if="app.kind.available">
300     <!-- Pick out the application build properties based on the prefix "org.bedework.app."
301          and the deployment name -->
302     <propertyset id="build-app-properties">
303       <propertyref prefix="org.bedework.app.${org.bedework.deploy.name}"/>
304       <globmapper from="org.bedework.app.${org.bedework.deploy.name}.*" to="propval.app.*"/>
305     </propertyset>
306   </target>
307
308   <target name="deploy.apps">
309     <forEachApp names="${org.bedework.install.app.names}"
310                 prefix="org.bedework.deploy"
311                 appPrefix="org.bedework.app"
312                 projectPrefix="org.bedework.project">
313       <sequential>
314         <antcall target="deploy.available.app" inheritrefs="true" />
315       </sequential>
316     </forEachApp>
317
318     <!-- ======================= termination tasks ================= -->
319
320     <ant antfile="${org.bedework.deployment.base}/termination/${org.bedework.deploy.kind}/build.xml"
321          inheritrefs="true" target="deploy" />
322   </target>
323
324   <target name="deploy.available.app">
325     <if>
326       <available file="${org.bedework.deploy.type.dir}/${org.bedework.deploy.kind}/build.xml"/>
327       <then>
328         <propertyset id="deploy-app-properties">
329           <propertyref prefix="org.bedework.app.${org.bedework.deploy.name}"/>
330           <globmapper from="org.bedework.app.${org.bedework.deploy.name}.*" to="propval.app.*"/>
331         </propertyset>
332
333         <ant antfile="${org.bedework.deploy.type.dir}/${org.bedework.deploy.kind}/build.xml"
334              inheritrefs="true" target="deploy" >
335           <propertyset refid="deploy-app-properties" />
336         </ant>
337       </then>
338     </if>
339   </target>
340 </project>
341
Note: See TracBrowser for help on using the browser.