root/trunk/calendar3/deployment/build.xml

Revision 295 (checked in by douglm, 7 years ago)

Fix jboss build so it works again.

Fix a couple of synchronization bugs shown up during jboss tests

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   <target name="init" >
32     <dirname property="this.build.dir" file="${ant.file}"/>
33
34     <property name="source.home" location="${this.build.dir}/src"/>
35
36     <!-- default to debug off -->
37     <property name="app.debug.val" value="0" />
38
39     <!-- set this for the war builds -->
40     <dirname property="app.root.dir" file="${ant.file}"/>
41
42     <!-- ==================== config properties =========================
43     <property name="org.bedework.config.properties"
44               location="${org.bedework.config.base}/configs/${org.bedework.clone.name}.properties" />
45
46     <echo message="==========================================================" />
47     <echo message="Use clone properties ${org.bedework.config.properties}" />
48     <loadproperties
49           srcFile="${org.bedework.config.properties}" >
50       <filterchain>
51         <expandproperties/>
52       </filterchain>
53     </loadproperties>
54     -->
55   </target>
56
57   <target name="build" depends="init"
58           description="Compile deployment Java sources">
59     <!-- ==================== Sources and classes ====================== -->
60
61     <fileset id="base.java.sources" dir="${source.home}" >
62      <include name="org/bedework/deployment/*.java"/>
63       <include name="org/bedework/deployment/*.java"/>
64     </fileset>
65
66     <patternset id="base.class.patternset">
67       <include name="org/bedework/deployment/*.class"/>
68       <include name="org/bedework/deployment/*.class"/>
69     </patternset>
70
71     <!-- ==================== Compilation Classpath ==================== -->
72
73     <path id="compile.classpath">
74       <pathelement location="${ant.jar}"/>
75     </path>
76
77     <!-- ==================== Build Target ============================= -->
78
79     <property name="build.jar.file" location="${org.bedework.deployment.jar}" />
80
81     <ant antfile="${buildjar}" inheritRefs="true" target="build" />
82   </target>
83
84   <target name="deftasks" >
85     <path id="app.xml.cp">
86       <pathelement location="${org.bedework.deployment.jar}"/>
87     </path>
88
89     <taskdef name="forEachApp"
90              classname="org.bedework.deployment.ForEachAppTask">
91       <classpath refid="app.xml.cp"/>
92     </taskdef>
93   </target>
94
95   <target name="build.configured" depends="build,deftasks" >
96     <!-- Clean up before we start -->
97     <delete dir="${org.bedework.temp.wars.home}" />
98
99     <antcall target="build.standalone.apps" inheritrefs="true" />
100
101     <antcall target="build.portal.apps" inheritrefs="true" />
102
103     <antcall target="build.j2ee.apps" inheritrefs="true" />
104
105     <!-- dump restore - always built (until we have a choice of windows/unix. -->
106     <ant antfile="${org.bedework.deployment.base}/dumprestore/shellscr/build.xml"
107          inheritrefs="true" target="build.configured" />
108   </target>
109
110   <!-- =================================================================
111        Targets called by the build.configured target. Each is conditional on a
112        config property and each executes a build file in a subdirectory of
113        this component.
114        ================================================================= -->
115
116   <target name="build.standalone.apps" if="org.bedework.global.build.standalone.app" >
117     <!-- ======================= webconfig - only standalone ================= -->
118     <ant antfile="${org.bedework.deployment.base}/webconfig/webapp/build.xml"
119          inheritrefs="true" target="build.configured" />
120
121     <property name="org.bedework.deploy.kind" value="webapp" />
122     <antcall target="build.configured.apps" inheritrefs="true" />
123   </target>
124
125   <target name="build.portal.apps" if="org.bedework.global.portal.platform" >
126     <property name="org.bedework.deploy.kind"
127               value="${org.bedework.global.portal.platform}" />
128     <antcall target="build.configured.apps" inheritrefs="true" />
129   </target>
130
131   <target name="build.j2ee.apps" if="org.bedework.global.j2ee.platform" >
132     <property name="org.bedework.deploy.kind"
133               value="${org.bedework.global.j2ee.platform}" />
134     <antcall target="build.configured.apps" inheritrefs="true" />
135   </target>
136
137   <!-- =================================================================
138                          The deploy target.
139        ================================================================= -->
140
141   <target name="deploy" depends="build,deftasks" >
142     <!-- Clean up before we start -->
143     <delete dir="${org.bedework.temp.wars.home}" />
144
145     <antcall target="deploy.standalone.apps" inheritrefs="true" />
146
147     <antcall target="deploy.portal.apps" inheritrefs="true" />
148
149     <antcall target="deploy.j2ee.apps" inheritrefs="true" />
150
151     <!-- copy an index file that sends you to the applications -->
152     <copy file="${app.root.dir}/resources/html/cal.html"
153           todir="${webapp.root.dir}"/>
154
155     <!-- copy libs that the application server needs -->
156     <antcall target="deploy.appserver.jdbcdriver" inheritrefs="true" />
157     <antcall target="deploy.appserver.javatools" inheritrefs="true" />
158   </target>
159
160   <!-- =================================================================
161        Targets called by the deploy target. Each is conditional on a
162        config property and each executes a build file in a subdirectory of
163        this component.
164        ================================================================= -->
165
166   <target name="deploy.standalone.apps" if="org.bedework.global.build.standalone.app" >
167     <property name="org.bedework.deploy.kind" value="webapp" />
168     <antcall target="deploy.apps" inheritrefs="true" />
169   </target>
170
171   <target name="deploy.portal.apps" if="org.bedework.global.portal.platform" >
172     <property name="org.bedework.deploy.kind"
173               value="${org.bedework.global.portal.platform}" />
174     <antcall target="deploy.apps" inheritrefs="true" />
175   </target>
176
177   <target name="deploy.j2ee.apps" if="org.bedework.global.j2ee.platform" >
178     <property name="org.bedework.deploy.kind"
179               value="${org.bedework.global.j2ee.platform}" />
180     <antcall target="deploy.apps" inheritrefs="true" />
181   </target>
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     <copy file="${org.bedework.default.lib}/xalan.jar"
187           todir="${appserver.endorsed.dir}"/>
188   </target>
189
190   <target name="deploy.appserver.jdbcdriver"
191           if="appserver.jdbcdriver.jar" >
192     <!-- copy jdbc jar so datasources work -->
193     <copy todir="${appserver.lib.dir}" file="${appserver.jdbcdriver.jar}"/>
194   </target>
195
196   <target name="deploy.appserver.javatools"
197           if="java.tools.jar" >
198     <!-- copy tools jar so jsps work -->
199     <copy todir="${appserver.lib.dir}" file="${java.tools.jar}"/>
200   </target>
201
202   <!-- =================================================================
203        Targets called by the build.configured target. Each is conditional on a
204        config property and each executes a build file in a subdirectory of
205        this component.
206        ================================================================= -->
207   <target name="build.configured.apps">
208     <forEachApp names="${org.bedework.install.app.names}"
209                 types="${org.bedework.install.app.types}"
210                 prefix="org.bedework.deploy">
211       <sequential>
212         <propertyset id="app-properties">
213           <propertyref prefix="org.bedework.app.${org.bedework.deploy.name}"/>
214           <globmapper from="org.bedework.app.${org.bedework.deploy.name}.*" to="propval.app.*"/>
215         </propertyset>
216
217         <ant antfile="${org.bedework.deployment.base}/${org.bedework.deploy.type}/${org.bedework.deploy.kind}/build.xml"
218              inheritrefs="true" target="build.configured" >
219           <propertyset refid="app-properties" />
220         </ant>
221       </sequential>
222     </forEachApp>
223
224     <!-- ======================= termination tasks ================= -->
225     <ant antfile="${org.bedework.deployment.base}/termination/${org.bedework.deploy.kind}/build.xml"
226          inheritrefs="true" target="build.configured" />
227   </target>
228
229   <target name="deploy.apps">
230     <forEachApp names="${org.bedework.install.app.names}"
231                 types="${org.bedework.install.app.types}"
232                 prefix="org.bedework.deploy">
233       <sequential>
234         <propertyset id="app-properties">
235           <propertyref prefix="org.bedework.app.${org.bedework.deploy.name}"/>
236           <globmapper from="org.bedework.app.${org.bedework.deploy.name}.*" to="propval.app.*"/>
237         </propertyset>
238
239         <ant antfile="${org.bedework.deployment.base}/${org.bedework.deploy.type}/${org.bedework.deploy.kind}/build.xml"
240              inheritrefs="true" target="deploy" >
241           <propertyset refid="app-properties" />
242         </ant>
243       </sequential>
244     </forEachApp>
245
246     <!-- ======================= termination tasks ================= -->
247     <ant antfile="${org.bedework.deployment.base}/termination/${org.bedework.deploy.kind}/build.xml"
248          inheritrefs="true" target="deploy" />
249   </target>
250 </project>
Note: See TracBrowser for help on using the browser.