root/trunk/deployment/build.xml

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

Set things up so we use a common cache for all quickstart jars

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   <dirname property="this.build.dir" file="${ant.file}"/>
42   <property name="bedework.deployment.base" location="this.build.dir" />
43
44   <import file="${build.dir}/buildTools/getJar.xml"/>
45
46   <import file="${this.build.dir}/appjars.xml" />
47
48   <import file="${build.dir}/loadDeployConfig.xml"/>
49
50   <target name="init" >
51     <getAppJars />
52
53     <property name="source.home" location="${this.build.dir}/src"/>
54
55     <loadDeployConfig />
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   </target>
78
79   <target name="deftasks" depends="init">
80     <path id="app.xml.cp">
81       <pathelement location="${org.bedework.deployutil.jar}"/>
82     </path>
83
84     <taskdef name="forEachApp"
85              classname="org.bedework.deployment.ForEachAppTask">
86       <classpath refid="app.xml.cp"/>
87     </taskdef>
88
89     <taskdef name="resolveFile"
90              classname="org.bedework.deployment.ResolveFile">
91       <classpath refid="app.xml.cp"/>
92     </taskdef>
93
94     <taskdef name="makeLangXsl"
95              classname="org.bedework.deployment.MakeLangXsl">
96       <classpath refid="app.xml.cp"/>
97     </taskdef>
98   </target>
99
100   <target name="build.configured" depends="deftasks" >
101     <!-- Clean up before we start -->
102     <delete dir="${org.bedework.temp.wars.home}" />
103
104     <antcall target="build.apps" inheritrefs="true" />
105   </target>
106
107   <!-- =================================================================
108        Targets called by the build.configured target. Each is conditional on a
109        config property and each executes a build file in a subdirectory of
110        this component.
111        ================================================================= -->
112
113   <target name="build.apps" >
114     <property name="org.bedework.deploy.kind" value="webapp" />
115     <antcall target="build.configured.apps" inheritrefs="true" />
116   </target>
117
118   <!-- =================================================================
119                          The deploy target.
120        ================================================================= -->
121
122   <target name="deploy" depends="deftasks" >
123     <!-- Clean up before we start -->
124     <delete dir="${org.bedework.temp.wars.home}" />
125
126     <property name="org.bedework.lang.properties"
127               location="${org.bedework.project.calendarapi}/calFacade/resources/org/bedework/locale/resources" />
128
129     <property name="org.bedework.xsllang.dir"
130               location="${org.bedework.temp.dir}/xsllang" />
131
132     <delete dir="${org.bedework.xsllang.dir}"/>
133     <mkdir dir="${org.bedework.xsllang.dir}"/>
134
135     <makeLangXsl dir="${org.bedework.lang.properties}"
136                  prefix="BwResources"
137                  resdir="${org.bedework.xsllang.dir}"
138                  xsldir="${org.bedework.xsllang.dir}"
139                  name="org.bedework.locales"
140                  check="true" />
141
142     <!-- Build the webapps stuff.-->
143     <antcall target="deploy.apps" inheritrefs="true" >
144       <param name="org.bedework.deploy.kind" value="webapp" />
145     </antcall>
146
147     <!-- Build the shellscr stuff.-->
148     <antcall target="deploy.apps" inheritrefs="true" >
149       <param name="org.bedework.deploy.kind" value="shellscr" />
150     </antcall>
151
152     <!-- copy startup website that sends you to the applications -->
153     <delete dir="${webapp.root.dir}/bedework"/>
154     <mkdir dir="${webapp.root.dir}/bedework"/>
155     <copy todir="${webapp.root.dir}/bedework">
156       <fileset dir="${app.root.dir}/resources/bedework"/>
157     </copy>
158
159     <!-- copy jdbc jar so datasources work -->
160     <if>
161       <available file="${org.bedework.global.ext.lib}/jdbc" type="dir" />
162       <then>
163         <!-- jdbc drivers -->
164         <copy todir="${appserver.lib.dir}" flatten="yes" >
165           <!-- local jdbc drivers -->
166           <fileset dir="${org.bedework.global.ext.lib}/jdbc">
167             <include name="*.jar"/>
168           </fileset>
169         </copy>
170       </then>
171       <else>
172         <!-- Include the quickstart jdbc driver -->
173         <copy todir="${appserver.lib.dir}" file="${org.bedework.appjar.hsqldb}"/>
174       </else>
175     </if>
176
177     <if>
178       <available file="${java.tools.jar}" />
179       <then>
180         <copy todir="${appserver.lib.dir}" file="${java.tools.jar}"/>
181       </then>
182     </if>
183   </target>
184
185   <!-- =================================================================
186        Targets called by the deploy target. Each is conditional on a
187        config property and each executes a build file in a subdirectory of
188        this component.
189        ================================================================= -->
190
191   <!-- The cp.xalan task conditionally copies the xalan.jar file, if
192        necessary -->
193   <target name="cp.xalan" if="xalan.in.tomcat.common.endorsed">
194     <copy file="${org.bedework.default.lib}/xalan.jar"
195           todir="${appserver.endorsed.dir}"/>
196   </target>
197
198   <!-- =================================================================
199        Targets called by the build.configured target. Each is conditional on a
200        config property and each executes a build file in a subdirectory of
201        this component.
202        ================================================================= -->
203   <target name="build.configured.apps">
204     <forEachApp names="${org.bedework.install.app.names}"
205                 prefix="org.bedework.deploy"
206                 appPrefix="org.bedework.app"
207                 projectPrefix="org.bedework.project">
208       <sequential>
209         <antcall target="build.available.configured.app" inheritrefs="true" />
210       </sequential>
211     </forEachApp>
212
213     <!-- ======================= termination tasks ================= -->
214
215     <ant antfile="${org.bedework.deployment.base}/termination/build.xml"
216          inheritrefs="true" target="build.configured" />
217   </target>
218
219   <target name="build.available.configured.app">
220     <propertycopy name="propval.app.type"
221                   from="bedework-options.org.bedework.app.${org.bedework.deploy.name}.appType" />
222     <property name="org.bedework.deploy.type.dir"
223               location="${app.root.dir}/${org.bedework.deploy.name}/${propval.app.type}" />
224     <echo message="*********************************** deploy directory is ${org.bedework.deploy.type.dir}" />
225
226     <if>
227       <available file="${org.bedework.deploy.type.dir}/${org.bedework.deploy.kind}/build.xml"/>
228       <then>
229         <propertyset id="deploy-app-properties">
230           <propertyref prefix="org.bedework.app.${org.bedework.deploy.name}"/>
231           <globmapper from="org.bedework.app.${org.bedework.deploy.name}.*" to="propval.app.*"/>
232         </propertyset>
233
234         <propertycopy name="propval.app.unauthenticated"
235                       from="bedework-options.org.bedework.app.${org.bedework.deploy.name}.guestMode" />
236
237         <ant antfile="${org.bedework.deploy.type.dir}/${org.bedework.deploy.kind}/build.xml"
238              inheritrefs="true" target="build.configured" >
239           <propertyset refid="deploy-app-properties" />
240         </ant>
241       </then>
242     </if>
243   </target>
244
245   <target name="deploy.apps">
246     <forEachApp names="${org.bedework.install.app.names}"
247                 prefix="org.bedework.deploy"
248                 appPrefix="org.bedework.app"
249                 projectPrefix="org.bedework.project">
250       <sequential>
251         <antcall target="deploy.available.app" inheritrefs="true" />
252       </sequential>
253     </forEachApp>
254
255     <!-- ======================= termination tasks ================= -->
256
257     <ant antfile="${org.bedework.deployment.base}/termination/${org.bedework.deploy.kind}/build.xml"
258          inheritrefs="true" target="deploy" />
259   </target>
260
261   <target name="deploy.available.app">
262     <propertycopy name="propval.app.type"
263                   from="bedework-options.org.bedework.app.${org.bedework.deploy.name}.appType" />
264     <property name="org.bedework.deploy.type.dir"
265               location="${app.root.dir}/${propval.app.type}" />
266     <echo message="*********************************** deploy directory is ${org.bedework.deploy.type.dir}" />
267
268     <if>
269       <available file="${org.bedework.deploy.type.dir}/${org.bedework.deploy.kind}/build.xml"/>
270       <then>
271         <propertyset id="deploy-app-properties">
272           <propertyref prefix="org.bedework.app.${org.bedework.deploy.name}"/>
273           <globmapper from="org.bedework.app.${org.bedework.deploy.name}.*" to="propval.app.*"/>
274         </propertyset>
275
276         <propertycopy name="propval.app.unauthenticated"
277                       from="bedework-options.org.bedework.app.${org.bedework.deploy.name}.guestMode" />
278
279         <ant antfile="${org.bedework.deploy.type.dir}/${org.bedework.deploy.kind}/build.xml"
280              inheritrefs="true" target="deploy" >
281           <propertyset refid="deploy-app-properties" />
282         </ant>
283       </then>
284     </if>
285   </target>
286 </project>
287
Note: See TracBrowser for help on using the browser.