root/trunk/build/buildsh.xml

Revision 3148 (checked in by douglm, 2 years ago)

Small change to incorporate bedework services in ear file. Should reduce startup time and build/deploy time as well as memory usage

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   <import file="${build.dir}/platforms/${org.bedework.global.deploy.platform}Service.xml" />
21
22   <target name="init">
23     <!-- Destinations - where we build stuff -->
24     <property name="app.dest.home"
25               location="${org.bedework.temp.shellscr.home}/${propval.app.zip.name}" />
26     <property name="app.dest.lib"
27               location="${app.dest.home}/lib" />
28     <property name="app.dest.classes"
29               location="${app.dest.home}/classes" />
30     <property name="app.dest.properties"
31               location="${app.dest.classes}/properties/${org.bedework.deployment.name}" />
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     <infoMsg message="* =========== Building ${propval.app.zip.name}" />
45
46     <delete dir="${app.dest.home}" />
47
48     <!-- Library stuff -->
49
50     <mkdir dir="${app.dest.lib}" />
51
52     <!-- Platform specific -->
53     <antcall target="addLibs" inheritRefs="true" />
54
55     <if>
56       <isset property="org.bedework.sou.hibernate.properties" />
57       <then>
58         <if>
59           <istrue value="${org.bedework.build.debug}" />
60           <then>
61             <echo message="************* Copy hib properties from ${org.bedework.sou.hibernate.properties}" />
62           </then>
63         </if>
64         <copy todir="${app.dest.classes}">
65           <fileset dir="${org.bedework.sou.hibernate.properties}/properties" />
66           <filterset refid="property.filters" />
67         </copy>
68    
69         <copy todir="${app.dest.classes}">
70           <fileset dir="${org.bedework.sou.hibernate.properties}/hbms" />
71           <filterset refid="property.filters" />
72         </copy>
73       </then>
74     </if>
75
76     <copy tofile="${app.dest.classes}/sysevents.properties"
77           file="${org.bedework.config.sysevents.properties}" />
78
79     <if>
80       <isreference refid="org.bedework.extra.resources" />
81       <then>
82         <copy todir="${app.dest.classes}" overwrite="yes" >
83           <fileset refid="org.bedework.extra.resources" />
84           <filterset refid="property.filters" />
85         </copy>
86       </then>
87     </if>
88
89     <!-- Platform specific hibernate properties -->
90     <antcall target="doHibProps" inheritRefs="true" />
91
92     <!-- Create the env.properties file -->
93     <mkdir dir="${app.dest.properties}" />
94
95     <copy tofile="${app.dest.properties}/options.xml"
96           file="${org.bedework.options.file}" >
97       <filterset>
98         <filter token="RPI-DEBUG" value="${app.debug.val}"/>
99       </filterset>
100       <filterset refid="property.filters" />
101     </copy>
102
103     <!-- ===============================================================
104                        Add any resource files
105          =============================================================== -->
106
107     <!-- Platform specific -->
108     <antcall target="addResources" inheritRefs="true" />
109
110     <!-- ===============================================================
111                        Add any data files
112          =============================================================== -->
113
114     <if>
115       <istrue value="${org.bedework.shellscr.copy.data}" />
116       <then>
117         <mkdir dir="${app.dest.data}" />
118    
119         <copy todir="${app.dest.data}" overwrite="yes" >
120           <fileset refid="org.bedework.shellscr.data" />
121           <filterset refid="property.filters" />
122         </copy>
123       </then>
124     </if>
125
126     <!-- ===============================================================
127                        Add any extra stuff
128          =============================================================== -->
129
130     <!-- Platform specific -->
131     <antcall target="addExtras" inheritRefs="true" />
132    
133     <!-- ================================================================
134          Build the zip file
135          ================================================================ -->
136
137     <mkdir dir="${dist.home}" />
138     <delete file="${app.zip.file}" />
139
140     <zip destfile="${app.zip.file}" >
141       <zipfileset prefix="${propval.app.zip.name}" dir="${app.dest.home}" />
142     </zip>
143   </target>
144 </project>
Note: See TracBrowser for help on using the browser.