root/trunk/build/buildsh.xml

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

Comment change

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
81     <!-- any extra files-->
82    <copy todir="${app.dest.lib}" >
83      <fileset dir="${org.bedework.temp.extrajars.dir}" />
84    </copy>
85
86     <!-- Some more standard libs -->
87     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.log4j}"/>
88     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.lucene-core}"/>
89     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.lucene-misc}"/>
90     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.ical4j}"/>
91     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.commons-codec}"/>
92     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.commons-digester}"/>
93     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.commons-collections}"/>
94     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.commons-httpclient}"/>
95     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.commons-lang}"/>
96     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.commons-ssl}"/>
97
98     <!-- jdbc stuff -->
99
100     <if>
101       <available file="${org.bedework.global.ext.lib}/jdbc" type="dir" />
102       <then>
103         <!-- jdbc drivers -->
104         <copy todir="${app.dest.lib}" flatten="yes" >
105           <!-- local jdbc drivers -->
106           <fileset dir="${org.bedework.global.ext.lib}/jdbc">
107             <include name="*.jar"/>
108           </fileset>
109         </copy>
110       </then>
111       <else>
112         <!-- Include the quickstart jdbc driver -->
113         <copy todir="${app.dest.lib}" file="${org.bedework.appjar.hsqldb}"/>
114       </else>
115     </if>
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     <!-- Create the env.properties file -->
133     <mkdir dir="${app.dest.properties}" />
134
135     <copy tofile="${app.dest.properties}/options.xml"
136           file="${org.bedework.config.options}" />
137
138     <!-- ===============================================================
139                        Add any resource files
140          =============================================================== -->
141
142     <copy tofile="${app.dest.resources}/log4j.xml"
143           file="${org.bedework.runsh.log4j.xml}"
144           failonerror="false" />
145
146     <!-- ===============================================================
147                        Add any data files
148          =============================================================== -->
149
150     <mkdir dir="${app.dest.data}" />
151
152     <copy todir="${app.dest.data}" overwrite="yes" >
153       <fileset refid="org.bedework.shellscr.data" />
154       <filterset refid="property.filters" />
155     </copy>
156
157     <!-- ===============================================================
158                        Build the classpath
159          =============================================================== -->
160
161     <path id="app.run.path">
162       <fileset dir="${app.dest.lib}">
163         <include name="*.jar"/>
164       </fileset>
165       <pathelement location="${app.dest.resources}" />
166     </path>
167     <pathconvert property="app.run.cp" refid="app.run.path"
168                  targetos="unix" >
169       <map from="${app.dest.lib}" to="./lib"/>
170       <map from="${app.dest.resources}" to="./resources"/>
171     </pathconvert>
172     <pathconvert property="app.run.wincp" refid="app.run.path"
173                  targetos="windows" >
174       <map from="${app.dest.lib}" to="./lib"/>
175       <map from="${app.dest.resources}" to="./resources"/>
176     </pathconvert>
177
178     <!-- ===============================================================
179                        Copy and modify the shell script
180          =============================================================== -->
181
182     <copy tofile="${app.dest.home}/${propval.app.shellscr.name}"
183           file="${app.run.shellscr}" >
184       <filterset>
185         <filter token="CP"
186                 value=".:./classes:${app.run.cp}"/>
187       </filterset>
188       <filterset refid="property.filters" />
189     </copy>
190
191     <copy tofile="${app.dest.home}/${propval.app.batscr.name}"
192           file="${app.run.batscr}" >
193       <filterset>
194         <filter token="CP"
195                 value=".;./classes;${app.run.wincp}"/>
196       </filterset>
197       <filterset refid="property.filters" />
198     </copy>
199
200     <!-- build the zip file -->
201     <mkdir dir="${dist.home}" />
202     <delete file="${app.zip.file}" />
203
204     <zip destfile="${app.zip.file}" >
205       <zipfileset prefix="${propval.app.zip.name}" dir="${app.dest.home}" />
206     </zip>
207   </target>
208 </project>
209
Note: See TracBrowser for help on using the browser.