root/trunk/build/buildsh.xml

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

Use a separate properties file for activemq jndi configuration. Avoid issues with systems with their own jndi config.

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