root/trunk/build/buildsh.xml

Revision 1330 (checked in by douglm, 6 years ago)

Need an extra jar for dump/restore

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-davdefs*.jar"/>
70         <include name="bw-davio*.jar"/>
71
72         <!-- Calendar api jars -->
73         <include name="bw-apiutil*.jar"/>
74         <include name="bw-calcore*.jar"/>
75         <include name="bw-calcorei*.jar"/>
76         <include name="bw-calenv*.jar"/>
77         <include name="bw-calfacade*.jar"/>
78         <include name="bw-calsvc*.jar"/>
79         <include name="bw-calsvci*.jar"/>
80         <include name="bw-icalendar*.jar"/>
81         <include name="bw-locale*.jar"/>
82         <include name="bw-logging*.jar"/>
83         <include name="bw-mail*.jar"/>
84       </fileset>
85     </copy>
86
87      <!-- any extra bin files-->
88     <copy todir="${app.dest.lib}" >
89       <fileset refid="app.bin.files" />
90     </copy>
91
92     <!-- Some more standard libs -->
93     <copy todir="${app.dest.lib}" file="${log4j.jar}"/>
94     <copy todir="${app.dest.lib}" file="${lucene.core.jar}"/>
95     <copy todir="${app.dest.lib}" file="${lucene.misc.jar}"/>
96     <copy todir="${app.dest.lib}" file="${ical4j.jar}"/>
97     <copy todir="${app.dest.lib}" file="${commons-digester.jar}"/>
98     <copy todir="${app.dest.lib}" file="${commons-httpclient.jar}"/>
99     <copy todir="${app.dest.lib}" file="${commons-ssl.jar}"/>
100     <copy todir="${app.dest.lib}" file="${commons-codec.jar}"/>
101     <copy todir="${app.dest.lib}" file="${commons-lang.jar}"/>
102
103     <!-- Extra libraries specified in calling build file -->
104     <copy todir="${app.dest.lib}" flatten="yes" >
105       <fileset refid="org.bedework.run.jars" />
106       <fileset refid="org.bedework.run.lib.jars" />
107
108       <!-- local jdbc drivers -->
109       <fileset dir="${org.bedework.jdbc.lib}">
110         <include name="*.jar"/>
111       </fileset>
112     </copy>
113
114     <!-- Include the quickstart jdbc driver -->
115     <copy todir="${app.dest.lib}" file="${hsqldb.jdbcdriver.jar}"/>
116
117     <copy todir="${app.dest.classes}">
118       <fileset dir="${org.bedework.project.calendarapi}/calCore/resources/properties" />
119       <filterset refid="property.filters" />
120     </copy>
121
122     <copy todir="${app.dest.classes}">
123       <fileset dir="${org.bedework.project.calendarapi}/calCore/resources/hbms" />
124       <filterset refid="property.filters" />
125     </copy>
126
127     <copy todir="${app.dest.classes}" overwrite="yes" >
128       <fileset refid="org.bedework.extra.resources" />
129       <filterset refid="property.filters" />
130     </copy>
131
132     <!-- add the jdbcdriver if defined -->
133     <antcall target="add.jdbcdriver" inheritRefs="true" />
134
135     <!-- Create the env.properties file -->
136     <mkdir dir="${app.dest.properties}" />
137
138     <copy tofile="${app.dest.properties}/env.properties"
139           file="${org.bedework.config.properties}" />
140
141     <copy tofile="${app.dest.properties}/options.xml"
142           file="${org.bedework.config.options}" />
143
144     <!-- ===============================================================
145                        Add any resource files
146          =============================================================== -->
147
148     <copy tofile="${app.dest.resources}/log4j.xml"
149           file="${org.bedework.runsh.log4j.xml}"
150           failonerror="false" />
151
152     <!-- ===============================================================
153                        Add any data files
154          =============================================================== -->
155
156     <mkdir dir="${app.dest.data}" />
157
158     <copy todir="${app.dest.data}" overwrite="yes" >
159       <fileset refid="org.bedework.shellscr.data" />
160       <filterset refid="property.filters" />
161     </copy>
162
163     <!-- ===============================================================
164                        Build the classpath
165          =============================================================== -->
166
167     <path id="app.run.path">
168       <fileset dir="${app.dest.lib}">
169         <include name="*.jar"/>
170       </fileset>
171       <pathelement location="${app.dest.resources}" />
172     </path>
173     <pathconvert property="app.run.cp" refid="app.run.path"
174                  targetos="unix" >
175       <map from="${app.dest.lib}" to="./lib"/>
176       <map from="${app.dest.resources}" to="./resources"/>
177     </pathconvert>
178     <pathconvert property="app.run.wincp" refid="app.run.path"
179                  targetos="windows" >
180       <map from="${app.dest.lib}" to="./lib"/>
181       <map from="${app.dest.resources}" to="./resources"/>
182     </pathconvert>
183
184     <!-- ===============================================================
185                        Copy and modify the shell script
186          =============================================================== -->
187
188     <copy tofile="${app.dest.home}/${propval.app.shellscr.name}"
189           file="${app.run.shellscr}" >
190       <filterset>
191         <filter token="CP"
192                 value=".:./classes:${app.run.cp}"/>
193       </filterset>
194       <filterset refid="property.filters" />
195     </copy>
196
197     <copy tofile="${app.dest.home}/${propval.app.batscr.name}"
198           file="${app.run.batscr}" >
199       <filterset>
200         <filter token="CP"
201                 value=".;./classes;${app.run.wincp}"/>
202       </filterset>
203       <filterset refid="property.filters" />
204     </copy>
205
206     <!-- build the zip file -->
207     <mkdir dir="${dist.home}" />
208     <delete file="${app.zip.file}" />
209
210     <zip destfile="${app.zip.file}" >
211       <zipfileset prefix="${propval.app.zip.name}" dir="${app.dest.home}" />
212     </zip>
213   </target>
214
215   <target name="add.jdbcdriver" if="propval.app.jdbcdriver.jar">
216     <copy todir="${app.dest.lib}" file="${propval.app.jdbcdriver.jar}"/>
217   </target>
218 </project>
219
Note: See TracBrowser for help on using the browser.