root/releases/bedework-3.7/build/buildsh.xml

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

Remove definition of property "base.name" from (almost) every build file. Was not used.
Stop defining, creating and copying to libapi. Wasn't in use.

Remove build directory from every project and use the build files in the main bedework project. improves consistency and maintainability. Also allowed some bugs to be fixed.

Allow setting of message level during build and set it at quiet. Allows error messages to be more obvious.

Create macro to handle the common property definitions. Reduces size and complexity of build files.

Add a build-jar macro. Removes need for build files for sub-modules. Partway through converting to use that.

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