root/trunk/build/buildsh.xml

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

Further changes to the build.

Delete (most of) the jar files from the lib directory - we are downloading them from bedework.org at build time.

Use a macro to load the deployment properties adn define some deployment proeprties based on the run time options.

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-calenv}" />
75     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-calfacade}" />
76     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-calsvc}" />
77     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-calsvci}" />
78     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-icalendar}" />
79     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-logging}" />
80     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-mail}" />
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     <!-- This jdbc stuff needs fixing -->
100
101     <!-- jdbc drivers -->
102     <copy todir="${app.dest.lib}" flatten="yes" >
103       <!-- local jdbc drivers -->
104       <fileset dir="${org.bedework.jdbc.lib}">
105         <include name="*.jar"/>
106       </fileset>
107     </copy>
108
109     <!-- add the jdbcdriver if defined -->
110     <if>
111       <isset property="propval.app.jdbcdriver.jar"/>
112       <then>
113         <copy todir="${app.dest.lib}" file="${propval.app.jdbcdriver.jar}"/>
114       </then>
115     </if>
116
117     <!-- Include the quickstart jdbc driver -->
118     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.hsqldb}"/>
119
120     <copy todir="${app.dest.classes}">
121       <fileset dir="${org.bedework.project.calendarapi}/calCore/resources/properties" />
122       <filterset refid="property.filters" />
123     </copy>
124
125     <copy todir="${app.dest.classes}">
126       <fileset dir="${org.bedework.project.calendarapi}/calCore/resources/hbms" />
127       <filterset refid="property.filters" />
128     </copy>
129
130     <copy todir="${app.dest.classes}" overwrite="yes" >
131       <fileset refid="org.bedework.extra.resources" />
132       <filterset refid="property.filters" />
133     </copy>
134
135     <!-- Create the env.properties file -->
136     <mkdir dir="${app.dest.properties}" />
137
138     <copy tofile="${app.dest.properties}/options.xml"
139           file="${org.bedework.config.options}" />
140
141     <!-- ===============================================================
142                        Add any resource files
143          =============================================================== -->
144
145     <copy tofile="${app.dest.resources}/log4j.xml"
146           file="${org.bedework.runsh.log4j.xml}"
147           failonerror="false" />
148
149     <!-- ===============================================================
150                        Add any data files
151          =============================================================== -->
152
153     <mkdir dir="${app.dest.data}" />
154
155     <copy todir="${app.dest.data}" overwrite="yes" >
156       <fileset refid="org.bedework.shellscr.data" />
157       <filterset refid="property.filters" />
158     </copy>
159
160     <!-- ===============================================================
161                        Build the classpath
162          =============================================================== -->
163
164     <path id="app.run.path">
165       <fileset dir="${app.dest.lib}">
166         <include name="*.jar"/>
167       </fileset>
168       <pathelement location="${app.dest.resources}" />
169     </path>
170     <pathconvert property="app.run.cp" refid="app.run.path"
171                  targetos="unix" >
172       <map from="${app.dest.lib}" to="./lib"/>
173       <map from="${app.dest.resources}" to="./resources"/>
174     </pathconvert>
175     <pathconvert property="app.run.wincp" refid="app.run.path"
176                  targetos="windows" >
177       <map from="${app.dest.lib}" to="./lib"/>
178       <map from="${app.dest.resources}" to="./resources"/>
179     </pathconvert>
180
181     <!-- ===============================================================
182                        Copy and modify the shell script
183          =============================================================== -->
184
185     <copy tofile="${app.dest.home}/${propval.app.shellscr.name}"
186           file="${app.run.shellscr}" >
187       <filterset>
188         <filter token="CP"
189                 value=".:./classes:${app.run.cp}"/>
190       </filterset>
191       <filterset refid="property.filters" />
192     </copy>
193
194     <copy tofile="${app.dest.home}/${propval.app.batscr.name}"
195           file="${app.run.batscr}" >
196       <filterset>
197         <filter token="CP"
198                 value=".;./classes;${app.run.wincp}"/>
199       </filterset>
200       <filterset refid="property.filters" />
201     </copy>
202
203     <!-- build the zip file -->
204     <mkdir dir="${dist.home}" />
205     <delete file="${app.zip.file}" />
206
207     <zip destfile="${app.zip.file}" >
208       <zipfileset prefix="${propval.app.zip.name}" dir="${app.dest.home}" />
209     </zip>
210   </target>
211 </project>
212
Note: See TracBrowser for help on using the browser.