root/trunk/deployment/build.xml

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

Upgrade ant jar in library to 1.7.0

Add an ant task to process the language resource files and generate xsl

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