root/trunk/calendar3/deployment/build.xml

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

Changes to allow build of suite for jboss

Creates a single ear file with all components.

Requires ant version 1.6.5. Changes ant scripts in quickstart to avoid some problems with running different versions.

Added an ant task to the deployment suite to build an application.xml file
Fixed a serialization problem in client code.

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="build.configured" depends="build" >
85     <!-- Clean up before we start -->
86     <delete dir="${org.bedework.temp.wars.home}" />
87
88     <antcall target="build.standalone.apps" inheritrefs="true" />
89
90     <antcall target="build.portal.apps" inheritrefs="true" />
91
92     <antcall target="build.j2ee.apps" inheritrefs="true" />
93
94     <!-- dump restore - always built (until we have a choice of windows/unix. -->
95     <ant antfile="${org.bedework.deployment.base}/dumprestore/shellscr/build.xml"
96          inheritrefs="true" target="build.configured" />
97   </target>
98
99   <!-- =================================================================
100        Targets called by the build.configured target. Each is conditional on a
101        config property and each executes a build file in a subdirectory of
102        this component.
103        ================================================================= -->
104
105   <target name="build.standalone.apps" if="org.bedework.global.build.standalone.app" >
106     <!-- ======================= webconfig - only standalone ================= -->
107     <ant antfile="${org.bedework.deployment.base}/webconfig/webapp/build.xml"
108          inheritrefs="true" target="build.configured" />
109
110     <build.configured.apps kind="webapp" />
111   </target>
112
113   <target name="build.portal.apps" if="org.bedework.global.portal.platform" >
114     <build.configured.apps kind="${org.bedework.global.portal.platform}" />
115   </target>
116
117   <target name="build.j2ee.apps" if="org.bedework.global.j2ee.platform" >
118     <build.configured.apps kind="${org.bedework.global.j2ee.platform}" />
119   </target>
120
121   <!-- =================================================================
122                          The deploy target.
123        ================================================================= -->
124
125   <target name="deploy" depends="build" >
126     <!-- Clean up before we start -->
127     <delete dir="${org.bedework.temp.wars.home}" />
128
129     <antcall target="deploy.standalone.apps" inheritrefs="true" />
130
131     <antcall target="deploy.portal.apps" inheritrefs="true" />
132
133     <antcall target="deploy.j2ee.apps" inheritrefs="true" />
134
135     <!-- copy an index file that sends you to the applications -->
136     <copy file="${app.root.dir}/resources/html/cal.html"
137           todir="${webapp.root.dir}"/>
138
139     <!-- copy libs that the application server needs -->
140     <antcall target="deploy.appserver.jdbcdriver" inheritrefs="true" />
141     <antcall target="deploy.appserver.javatools" inheritrefs="true" />
142   </target>
143
144   <!-- =================================================================
145        Targets called by the deploy target. Each is conditional on a
146        config property and each executes a build file in a subdirectory of
147        this component.
148        ================================================================= -->
149
150   <target name="deploy.standalone.apps" if="org.bedework.global.build.standalone.app" >
151     <!-- ======================= webconfig - only standalone ================= -->
152     <ant antfile="${org.bedework.deployment.base}/webconfig/webapp/build.xml"
153          inheritrefs="true" target="deploy" />
154
155     <deploy.apps kind="webapp" />
156   </target>
157
158   <target name="deploy.portal.apps" if="org.bedework.global.portal.platform" >
159     <deploy.apps kind="${org.bedework.global.portal.platform}" />
160   </target>
161
162   <target name="deploy.j2ee.apps" if="org.bedework.global.j2ee.platform" >
163     <deploy.apps kind="${org.bedework.global.j2ee.platform}" />
164   </target>
165
166   <!-- The cp.xalan task conditionally copies the xalan.jar file, if
167        necessary -->
168   <target name="cp.xalan" if="xalan.in.tomcat.common.endorsed">
169     <copy file="${org.bedework.default.lib}/xalan.jar"
170           todir="${appserver.endorsed.dir}"/>
171   </target>
172
173   <target name="deploy.appserver.jdbcdriver"
174           if="appserver.jdbcdriver.jar" >
175     <!-- copy jdbc jar so datasources work -->
176     <copy todir="${appserver.lib.dir}" file="${appserver.jdbcdriver.jar}"/>
177   </target>
178
179   <target name="deploy.appserver.javatools"
180           if="java.tools.jar" >
181     <!-- copy tools jar so jsps work -->
182     <copy todir="${appserver.lib.dir}" file="${java.tools.jar}"/>
183   </target>
184
185   <!-- =================================================================
186        Targets called by the build.configured target. Each is conditional on a
187        config property and each executes a build file in a subdirectory of
188        this component.
189        ================================================================= -->
190   <macrodef name="build.configured.apps">
191       <attribute name="kind" />
192     <sequential>
193       <!-- ======================= webadmin ================= -->
194       <ant antfile="${org.bedework.deployment.base}/webadmin/@{kind}/build.xml"
195            inheritrefs="true" target="build.configured" />
196
197       <!-- ======================= pubevents ================= -->
198       <ant antfile="${org.bedework.deployment.base}/webpublic/@{kind}/build.xml"
199            inheritrefs="true" target="build.configured" />
200
201       <!-- ======================= personal ================= -->
202       <ant antfile="${org.bedework.deployment.base}/webuser/@{kind}/build.xml"
203            inheritrefs="true" target="build.configured" />
204
205       <!-- ======================= caldav - public ================= -->
206       <ant antfile="${org.bedework.deployment.base}/publiccaldav/@{kind}/build.xml"
207            inheritrefs="true" target="build.configured" />
208
209       <!-- ======================= caldav - user ================= -->
210       <ant antfile="${org.bedework.deployment.base}/usercaldav/@{kind}/build.xml"
211            inheritrefs="true" target="build.configured" />
212
213       <!-- ======================= termination tasks ================= -->
214       <ant antfile="${org.bedework.deployment.base}/termination/@{kind}/build.xml"
215            inheritrefs="true" target="build.configured" />
216     </sequential>
217   </macrodef>
218
219   <macrodef name="deploy.apps">
220       <attribute name="kind" />
221     <sequential>
222       <!-- ======================= webadmin ================= -->
223       <ant antfile="${org.bedework.deployment.base}/webadmin/@{kind}/build.xml"
224            inheritrefs="true" target="deploy" />
225
226       <!-- ======================= pubevents ================= -->
227       <ant antfile="${org.bedework.deployment.base}/webpublic/@{kind}/build.xml"
228            inheritrefs="true" target="deploy" />
229
230       <!-- ======================= personal ================= -->
231       <ant antfile="${org.bedework.deployment.base}/webuser/@{kind}/build.xml"
232            inheritrefs="true" target="deploy" />
233
234       <!-- ======================= caldav - public ================= -->
235       <ant antfile="${org.bedework.deployment.base}/publiccaldav/@{kind}/build.xml"
236            inheritrefs="true" target="deploy" />
237
238       <!-- ======================= caldav - user ================= -->
239       <ant antfile="${org.bedework.deployment.base}/usercaldav/@{kind}/build.xml"
240            inheritrefs="true" target="deploy" />
241
242       <!-- ======================= termination tasks ================= -->
243       <ant antfile="${org.bedework.deployment.base}/termination/@{kind}/build.xml"
244            inheritrefs="true" target="deploy" />
245     </sequential>
246   </macrodef>
247 </project>
Note: See TracBrowser for help on using the browser.