root/trunk/build/buildsh.xml

Revision 2052 (checked in by douglm, 4 years ago)

Extract notifications code from within calintf and calsvc and make it a separate package.

No real functional difference as yet

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="bw.buildsh" default="build">
18   <import file="${build.dir}/buildfilters.xml" />
19
20   <target name="init">
21     <!-- Destinations - where we build stuff -->
22     <property name="app.dest.home"
23               location="${org.bedework.temp.shellscr.home}/${propval.app.zip.name}" />
24     <property name="app.dest.lib"
25               location="${app.dest.home}/lib" />
26     <property name="app.dest.classes"
27               location="${app.dest.home}/classes" />
28     <property name="app.dest.properties"
29               location="${app.dest.classes}/properties/calendar" />
30     <property name="app.dest.resources"
31               location="${app.dest.home}/resources" />
32     <property name="app.dest.data"
33               location="${app.dest.home}/data" />
34
35     <property name="app.zip.file"
36               location="${dist.home}/${propval.app.zip.name}.zip" />
37   </target>
38
39   <!-- ================================================================
40        build target
41        ================================================================ -->
42
43   <target name="build" depends="init">
44     <delete dir="${app.dest.home}" />
45
46     <!-- Library stuff -->
47
48     <mkdir dir="${app.dest.lib}" />
49
50     <!-- hibernate jars -->
51     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.antlr}" />
52     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.asm-attrs}" />
53     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.asm}" />
54     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.cglib}" />
55     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.dom4j}" />
56     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.ehcache}" />
57     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.hibernate}" />
58     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.jgroups}" />
59     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.jta}" />
60
61     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.commons-collections}"/>
62     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.commons-logging}"/>
63
64     <!-- core files -->
65
66     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.rpiaccess}" />
67     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.rpiutil}" />
68     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-davio}" />
69
70     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-annotations}" />
71     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-apiutil}" />
72     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-calcore}" />
73     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-calcorei}" />
74     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-calfacade}" />
75     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-calsvc}" />
76     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-calsvci}" />
77     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-icalendar}" />
78     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-logging}" />
79     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-mail}" />
80     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-sysevents}" />
81
82     <!-- any extra files-->
83    <copy todir="${app.dest.lib}" >
84      <fileset dir="${org.bedework.temp.extrajars.dir}" />
85    </copy>
86
87     <!-- Some more standard libs -->
88     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.log4j}"/>
89     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.lucene-core}"/>
90     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.lucene-misc}"/>
91     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.ical4j}"/>
92     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.commons-codec}"/>
93     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.commons-digester}"/>
94     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.commons-collections}"/>
95     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.commons-httpclient}"/>
96     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.commons-lang}"/>
97     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.commons-ssl}"/>
98
99     <!-- jdbc stuff -->
100
101     <if>
102       <available file="${org.bedework.global.ext.lib}/jdbc" type="dir" />
103       <then>
104         <!-- jdbc drivers -->
105         <copy todir="${app.dest.lib}" flatten="yes" >
106           <!-- local jdbc drivers -->
107           <fileset dir="${org.bedework.global.ext.lib}/jdbc">
108             <include name="*.jar"/>
109           </fileset>
110         </copy>
111       </then>
112       <else>
113         <!-- Include the quickstart jdbc driver -->
114         <copy todir="${app.dest.lib}" file="${org.bedework.appjar.hsqldb}"/>
115       </else>
116     </if>
117
118     <copy todir="${app.dest.classes}">
119       <fileset dir="${org.bedework.project.calendarapi}/calCore/resources/properties" />
120       <filterset refid="property.filters" />
121     </copy>
122
123     <copy todir="${app.dest.classes}">
124       <fileset dir="${org.bedework.project.calendarapi}/calCore/resources/hbms" />
125       <filterset refid="property.filters" />
126     </copy>
127
128     <copy todir="${app.dest.classes}" overwrite="yes" >
129       <fileset refid="org.bedework.extra.resources" />
130       <filterset refid="property.filters" />
131     </copy>
132
133     <!-- Create the env.properties file -->
134     <mkdir dir="${app.dest.properties}" />
135
136     <copy tofile="${app.dest.properties}/options.xml"
137           file="${org.bedework.config.options}" />
138
139     <!-- ===============================================================
140                        Add any resource files
141          =============================================================== -->
142
143     <copy tofile="${app.dest.resources}/log4j.xml"
144           file="${org.bedework.runsh.log4j.xml}"
145           failonerror="false" />
146
147     <!-- ===============================================================
148                        Add any data files
149          =============================================================== -->
150
151     <mkdir dir="${app.dest.data}" />
152
153     <copy todir="${app.dest.data}" overwrite="yes" >
154       <fileset refid="org.bedework.shellscr.data" />
155       <filterset refid="property.filters" />
156     </copy>
157
158     <!-- ===============================================================
159                        Build the classpath
160          =============================================================== -->
161
162     <path id="app.run.path">
163       <fileset dir="${app.dest.lib}">
164         <include name="*.jar"/>
165       </fileset>
166       <pathelement location="${app.dest.resources}" />
167     </path>
168     <pathconvert property="app.run.cp" refid="app.run.path"
169                  targetos="unix" >
170       <map from="${app.dest.lib}" to="./lib"/>
171       <map from="${app.dest.resources}" to="./resources"/>
172     </pathconvert>
173     <pathconvert property="app.run.wincp" refid="app.run.path"
174                  targetos="windows" >
175       <map from="${app.dest.lib}" to="./lib"/>
176       <map from="${app.dest.resources}" to="./resources"/>
177     </pathconvert>
178
179     <!-- ===============================================================
180                        Copy and modify the shell script
181          =============================================================== -->
182
183     <copy tofile="${app.dest.home}/${propval.app.shellscr.name}"
184           file="${app.run.shellscr}" >
185       <filterset>
186         <filter token="CP"
187                 value=".:./classes:${app.run.cp}"/>
188       </filterset>
189       <filterset refid="property.filters" />
190     </copy>
191
192     <copy tofile="${app.dest.home}/${propval.app.batscr.name}"
193           file="${app.run.batscr}" >
194       <filterset>
195         <filter token="CP"
196                 value=".;./classes;${app.run.wincp}"/>
197       </filterset>
198       <filterset refid="property.filters" />
199     </copy>
200
201     <!-- build the zip file -->
202     <mkdir dir="${dist.home}" />
203     <delete file="${app.zip.file}" />
204
205     <zip destfile="${app.zip.file}" >
206       <zipfileset prefix="${propval.app.zip.name}" dir="${app.dest.home}" />
207     </zip>
208   </target>
209 </project>
210
Note: See TracBrowser for help on using the browser.