root/trunk/build/buildsh.xml

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

Fix issues with event proxy object which prevented overrides and annotations from restoring.

Also improve efficiency of the restore process.

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