root/trunk/build/buildsh.xml

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

Merge in revision 1806 from release 3.4.1

Line 
1 <?xml version="1.0"?>
2
3 <!-- ===================================================================
4      This file builds a runnable application wrapped up as a zip file.
5      Unpacking the zip should result in a directory containing a shell
6      script, a set of jars and any other resources needed.
7
8      Properties we need:
9        app.core.env.pname     core properties source
10        app.run.shellscr       location of the skeleton shell script.
11        app.run.jar.file       application jar file
12        app.run.main.class     main class for application.
13
14      Authors: Mike Douglass   douglm@rpi.edu
15      =================================================================== -->
16
17 <project name="uwcal.buildsh" default="build">
18   <import file="${build.dir}/buildfilters.xml" />
19
20   <target name="init">
21     <!-- Load the location of the libraries -->
22     <property file="${org.bedework.project.bedework}/build/libjars.properties" />
23
24     <!-- Destinations - where we build stuff -->
25     <property name="app.dest.home"
26               location="${org.bedework.temp.shellscr.home}/${propval.app.zip.name}" />
27     <property name="app.dest.lib"
28               location="${app.dest.home}/lib" />
29     <property name="app.dest.classes"
30               location="${app.dest.home}/classes" />
31     <property name="app.dest.properties"
32               location="${app.dest.classes}/properties/calendar" />
33     <property name="app.dest.resources"
34               location="${app.dest.home}/resources" />
35     <property name="app.dest.data"
36               location="${app.dest.home}/data" />
37
38     <property name="app.zip.file"
39               location="${dist.home}/${propval.app.zip.name}.zip" />
40   </target>
41
42   <!-- ================================================================
43        build target
44        ================================================================ -->
45
46   <target name="build" depends="init">
47     <delete dir="${app.dest.home}" />
48
49     <!-- Library stuff -->
50
51     <mkdir dir="${app.dest.lib}" />
52
53     <copy todir="${app.dest.lib}">
54       <fileset dir="${hibernate.jars.dir}">
55         <include name="*.jar"/>
56       </fileset>
57     </copy>
58
59     <copy todir="${app.dest.lib}" file="${commons-collections.jar}"/>
60     <copy todir="${app.dest.lib}" file="${commons-logging.jar}"/>
61
62     <!-- core files -->
63
64     <copy todir="${app.dest.lib}" overwrite="yes">
65       <fileset dir="${bin.home}">
66         <!-- jars from sub-projects needed by all -->
67         <include name="rpiaccess*.jar"/>
68         <include name="rpiutil*.jar"/>
69         <include name="bw-davio*.jar"/>
70
71         <!-- Calendar api jars -->
72         <include name="bw-apiutil*.jar"/>
73         <include name="bw-calcore*.jar"/>
74         <include name="bw-calcorei*.jar"/>
75         <include name="bw-calenv*.jar"/>
76         <include name="bw-calfacade*.jar"/>
77         <include name="bw-calsvc*.jar"/>
78         <include name="bw-calsvci*.jar"/>
79         <include name="bw-icalendar*.jar"/>
80         <include name="bw-locale*.jar"/>
81         <include name="bw-logging*.jar"/>
82         <include name="bw-mail*.jar"/>
83       </fileset>
84     </copy>
85
86      <!-- any extra bin files-->
87     <copy todir="${app.dest.lib}" >
88       <fileset refid="app.bin.files" />
89     </copy>
90
91     <!-- Some more standard libs -->
92     <copy todir="${app.dest.lib}" file="${log4j.jar}"/>
93     <copy todir="${app.dest.lib}" file="${lucene.core.jar}"/>
94     <copy todir="${app.dest.lib}" file="${lucene.misc.jar}"/>
95     <copy todir="${app.dest.lib}" file="${ical4j.jar}"/>
96     <copy todir="${app.dest.lib}" file="${commons-digester.jar}"/>
97     <copy todir="${app.dest.lib}" file="${commons-httpclient.jar}"/>
98     <copy todir="${app.dest.lib}" file="${commons-ssl.jar}"/>
99     <copy todir="${app.dest.lib}" file="${commons-codec.jar}"/>
100     <copy todir="${app.dest.lib}" file="${commons-lang.jar}"/>
101
102     <!-- Extra libraries specified in calling build file -->
103     <copy todir="${app.dest.lib}" flatten="yes" >
104       <fileset refid="org.bedework.run.jars" />
105       <fileset refid="org.bedework.run.lib.jars" />
106
107       <!-- local jdbc drivers -->
108       <fileset dir="${org.bedework.jdbc.lib}">
109         <include name="*.jar"/>
110       </fileset>
111     </copy>
112
113     <!-- Include the quickstart jdbc driver -->
114     <copy todir="${app.dest.lib}" file="${appserver.jdbcdriver.jar}"/>
115
116     <copy todir="${app.dest.classes}">
117       <fileset dir="${org.bedework.project.calendarapi}/calCore/resources/properties" />
118       <filterset refid="property.filters" />
119     </copy>
120
121     <copy todir="${app.dest.classes}">
122       <fileset dir="${org.bedework.project.calendarapi}/calCore/resources/hbms" />
123       <filterset refid="property.filters" />
124     </copy>
125
126     <copy todir="${app.dest.classes}" overwrite="yes" >
127       <fileset refid="org.bedework.extra.resources" />
128       <filterset refid="property.filters" />
129     </copy>
130
131     <!-- add the jdbcdriver if defined -->
132     <antcall target="add.jdbcdriver" inheritRefs="true" />
133
134     <!-- Create the env.properties file -->
135     <mkdir dir="${app.dest.properties}" />
136
137     <copy tofile="${app.dest.properties}/env.properties"
138           file="${org.bedework.config.properties}" />
139
140     <copy tofile="${app.dest.properties}/options.xml"
141           file="${org.bedework.config.options}" />
142
143     <!-- ===============================================================
144                        Add any resource files
145          =============================================================== -->
146
147     <copy tofile="${app.dest.resources}/log4j.xml"
148           file="${org.bedework.runsh.log4j.xml}"
149           failonerror="false" />
150
151     <!-- ===============================================================
152                        Add any data files
153          =============================================================== -->
154
155     <mkdir dir="${app.dest.data}" />
156
157     <copy todir="${app.dest.data}" overwrite="yes" >
158       <fileset refid="org.bedework.shellscr.data" />
159       <filterset refid="property.filters" />
160     </copy>
161
162     <!-- ===============================================================
163                        Build the classpath
164          =============================================================== -->
165
166     <path id="app.run.path">
167       <fileset dir="${app.dest.lib}">
168         <include name="*.jar"/>
169       </fileset>
170       <pathelement location="${app.dest.resources}" />
171     </path>
172     <pathconvert property="app.run.cp" refid="app.run.path"
173                  targetos="unix" >
174       <map from="${app.dest.lib}" to="./lib"/>
175       <map from="${app.dest.resources}" to="./resources"/>
176     </pathconvert>
177     <pathconvert property="app.run.wincp" refid="app.run.path"
178                  targetos="windows" >
179       <map from="${app.dest.lib}" to="./lib"/>
180       <map from="${app.dest.resources}" to="./resources"/>
181     </pathconvert>
182
183     <!-- ===============================================================
184                        Copy and modify the shell script
185          =============================================================== -->
186
187     <copy tofile="${app.dest.home}/${propval.app.shellscr.name}"
188           file="${app.run.shellscr}" >
189       <filterset>
190         <filter token="CP"
191                 value=".:./classes:${app.run.cp}"/>
192       </filterset>
193       <filterset refid="property.filters" />
194     </copy>
195
196     <copy tofile="${app.dest.home}/${propval.app.batscr.name}"
197           file="${app.run.batscr}" >
198       <filterset>
199         <filter token="CP"
200                 value=".;./classes;${app.run.wincp}"/>
201       </filterset>
202       <filterset refid="property.filters" />
203     </copy>
204
205     <!-- build the zip file -->
206     <mkdir dir="${dist.home}" />
207     <delete file="${app.zip.file}" />
208
209     <zip destfile="${app.zip.file}" >
210       <zipfileset prefix="${propval.app.zip.name}" dir="${app.dest.home}" />
211     </zip>
212   </target>
213
214   <target name="add.jdbcdriver" if="propval.app.jdbcdriver.jar">
215     <copy todir="${app.dest.lib}" file="${propval.app.jdbcdriver.jar}"/>
216   </target>
217 </project>
218
Note: See TracBrowser for help on using the browser.