root/trunk/calendar3/deployment/build.xml

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

Fix free/busy day bug

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.shellscr.apps" inheritrefs="true" />
148
149     <antcall target="deploy.portal.apps" inheritrefs="true" />
150
151     <antcall target="deploy.j2ee.apps" inheritrefs="true" />
152
153     <!-- copy an index file that sends you to the applications -->
154     <copy file="${app.root.dir}/resources/html/cal.html"
155           todir="${webapp.root.dir}"/>
156
157     <!-- copy libs that the application server needs -->
158     <antcall target="deploy.appserver.jdbcdriver" inheritrefs="true" />
159     <antcall target="deploy.appserver.javatools" inheritrefs="true" />
160   </target>
161
162   <!-- =================================================================
163        Targets called by the deploy target. Each is conditional on a
164        config property and each executes a build file in a subdirectory of
165        this component.
166        ================================================================= -->
167
168   <target name="deploy.standalone.apps" if="org.bedework.global.build.standalone.app" >
169     <property name="org.bedework.deploy.kind" value="webapp" />
170     <antcall target="deploy.apps" inheritrefs="true" />
171   </target>
172
173   <target name="deploy.portal.apps" if="org.bedework.global.portal.platform" >
174     <property name="org.bedework.deploy.kind"
175               value="${org.bedework.global.portal.platform}" />
176     <antcall target="deploy.apps" inheritrefs="true" />
177   </target>
178
179   <target name="deploy.j2ee.apps" if="org.bedework.global.j2ee.platform" >
180     <property name="org.bedework.deploy.kind"
181               value="${org.bedework.global.j2ee.platform}" />
182     <antcall target="deploy.apps" inheritrefs="true" />
183   </target>
184
185   <!-- Always build the shellscr stuff. -->
186   <target name="deploy.shellscr.apps" >
187     <property name="org.bedework.deploy.kind" value="shellscr" />
188     <antcall target="deploy.apps" inheritrefs="true" />
189   </target>
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   <target name="deploy.appserver.jdbcdriver"
199           if="appserver.jdbcdriver.jar" >
200     <!-- copy jdbc jar so datasources work -->
201     <copy todir="${appserver.lib.dir}" file="${appserver.jdbcdriver.jar}"/>
202   </target>
203
204   <target name="deploy.appserver.javatools"
205           if="java.tools.jar" >
206     <!-- copy tools jar so jsps work -->
207     <copy todir="${appserver.lib.dir}" file="${java.tools.jar}"/>
208   </target>
209
210   <!-- =================================================================
211        Targets called by the build.configured target. Each is conditional on a
212        config property and each executes a build file in a subdirectory of
213        this component.
214        ================================================================= -->
215   <target name="build.configured.apps">
216     <forEachApp names="${org.bedework.install.app.names}"
217                 types="${org.bedework.install.app.types}"
218                 prefix="org.bedework.deploy">
219       <sequential>
220         <available file="${org.bedework.deployment.base}/${org.bedework.deploy.type}/${org.bedework.deploy.kind}/build.xml"
221                    property="app.kind.available" />
222         <antcall target="build.available.configured.app" inheritrefs="true" />
223       </sequential>
224     </forEachApp>
225
226     <!-- ======================= termination tasks ================= -->
227     <ant antfile="${org.bedework.deployment.base}/termination/${org.bedework.deploy.kind}/build.xml"
228          inheritrefs="true" target="build.configured" />
229   </target>
230
231   <target name="build.available.configured.app" if="app.kind.available">
232     <!-- Pick out the application build properties based on the prefix "org.bedework.app."
233          and the deployment name -->
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="build.configured" >
241       <propertyset refid="app-properties" />
242     </ant>
243   </target>
244
245   <target name="deploy.apps">
246     <forEachApp names="${org.bedework.install.app.names}"
247                 types="${org.bedework.install.app.types}"
248                 prefix="org.bedework.deploy">
249       <sequential>
250         <antcall target="wrap.deploy.available.app" inheritrefs="true" />
251       </sequential>
252     </forEachApp>
253
254     <!-- ======================= termination tasks ================= -->
255     <ant antfile="${org.bedework.deployment.base}/termination/${org.bedework.deploy.kind}/build.xml"
256          inheritrefs="true" target="deploy" />
257   </target>
258
259   <target name="wrap.deploy.available.app">
260     <!-- just to make app.kind.available go away -->
261     <available file="${org.bedework.deployment.base}/${org.bedework.deploy.type}/${org.bedework.deploy.kind}/build.xml"
262                property="app.kind.available" />
263     <antcall target="deploy.available.app" inheritrefs="true" />
264   </target>
265
266   <target name="deploy.available.app" if="app.kind.available">
267     <propertyset id="app-properties">
268       <propertyref prefix="org.bedework.app.${org.bedework.deploy.name}"/>
269       <globmapper from="org.bedework.app.${org.bedework.deploy.name}.*" to="propval.app.*"/>
270     </propertyset>
271
272     <ant antfile="${org.bedework.deployment.base}/${org.bedework.deploy.type}/${org.bedework.deploy.kind}/build.xml"
273          inheritrefs="true" target="deploy" >
274       <propertyset refid="app-properties" />
275     </ant>
276   </target>
277 </project>
Note: See TracBrowser for help on using the browser.