| 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="uwcal.buildsh" default="build"> |
|---|
| 18 |
<target name="init"> |
|---|
| 19 |
<!-- Load the location of the libraries --> |
|---|
| 20 |
<property file="${org.bedework.project.bedework}/build/libjars.properties" /> |
|---|
| 21 |
|
|---|
| 22 |
<!-- Destinations - where we build stuff --> |
|---|
| 23 |
<property name="app.dest.home" |
|---|
| 24 |
location="${org.bedework.temp.shellscr.home}/${propval.app.zip.name}" /> |
|---|
| 25 |
<property name="app.dest.lib" |
|---|
| 26 |
location="${app.dest.home}/lib" /> |
|---|
| 27 |
<property name="app.dest.classes" |
|---|
| 28 |
location="${app.dest.home}/classes" /> |
|---|
| 29 |
<property name="app.dest.properties" |
|---|
| 30 |
location="${app.dest.classes}/properties/calendar" /> |
|---|
| 31 |
<property name="app.dest.resources" |
|---|
| 32 |
location="${app.dest.home}/resources" /> |
|---|
| 33 |
<property name="app.dest.data" |
|---|
| 34 |
location="${app.dest.home}/data" /> |
|---|
| 35 |
|
|---|
| 36 |
<property name="app.zip.file" |
|---|
| 37 |
location="${dist.home}/${propval.app.zip.name}.zip" /> |
|---|
| 38 |
</target> |
|---|
| 39 |
|
|---|
| 40 |
<!-- ================================================================ |
|---|
| 41 |
build target |
|---|
| 42 |
================================================================ --> |
|---|
| 43 |
|
|---|
| 44 |
<target name="build" depends="init"> |
|---|
| 45 |
<filterset id="property.filters" > |
|---|
| 46 |
<filter token="BW-APP-NAME" |
|---|
| 47 |
value="${org.bedework.deploy.name}"/> |
|---|
| 48 |
|
|---|
| 49 |
<filter token="HIBERNATE-DIALECT" |
|---|
| 50 |
value="${org.bedework.global.hibernate.dialect}" /> |
|---|
| 51 |
|
|---|
| 52 |
<filter token="SECOND-LEVEL-CACHING" |
|---|
| 53 |
value="${org.bedework.global.hibernate.cache.use_second_level_cache}" /> |
|---|
| 54 |
|
|---|
| 55 |
<filter token="CACHE-PROVIDER" |
|---|
| 56 |
value="${org.bedework.global.hibernate.cache.provider_class}" /> |
|---|
| 57 |
|
|---|
| 58 |
<filter token="DIRECTORY-BROWSING-DISALLOWED" |
|---|
| 59 |
value="${org.bedework.global.directory.browsing.disallowed}" /> |
|---|
| 60 |
|
|---|
| 61 |
<filter token="APP-DESCRIPTION" |
|---|
| 62 |
value="${propval.app.description}" /> |
|---|
| 63 |
|
|---|
| 64 |
<filter token="CALDAVTEST-CLASS" |
|---|
| 65 |
value="org.bedework.caldav.test.TestCalDav"/> |
|---|
| 66 |
|
|---|
| 67 |
<filter token="DUMP-CLASS" |
|---|
| 68 |
value="org.bedework.dumprestore.dump.Dump"/> |
|---|
| 69 |
<filter token="RESTORE-CLASS" |
|---|
| 70 |
value="org.bedework.dumprestore.restore.Restore"/> |
|---|
| 71 |
|
|---|
| 72 |
<filter token="APP-NAME" |
|---|
| 73 |
value="${propval.app.name}"/> |
|---|
| 74 |
<filter token="APP-VERSION" |
|---|
| 75 |
value="${propval.app.version}"/> |
|---|
| 76 |
</filterset> |
|---|
| 77 |
|
|---|
| 78 |
<delete dir="${app.dest.home}" /> |
|---|
| 79 |
|
|---|
| 80 |
<!-- Library stuff --> |
|---|
| 81 |
|
|---|
| 82 |
<mkdir dir="${app.dest.lib}" /> |
|---|
| 83 |
|
|---|
| 84 |
<copy todir="${app.dest.lib}"> |
|---|
| 85 |
<fileset dir="${hibernate.jars.dir}"> |
|---|
| 86 |
<include name="*.jar"/> |
|---|
| 87 |
</fileset> |
|---|
| 88 |
</copy> |
|---|
| 89 |
|
|---|
| 90 |
<copy todir="${app.dest.lib}" file="${commons-collections.jar}"/> |
|---|
| 91 |
<copy todir="${app.dest.lib}" file="${commons-logging.jar}"/> |
|---|
| 92 |
|
|---|
| 93 |
<!-- core files --> |
|---|
| 94 |
|
|---|
| 95 |
<copy todir="${app.dest.lib}" overwrite="yes"> |
|---|
| 96 |
<fileset dir="${bin.home}"> |
|---|
| 97 |
<!-- jars from sub-projects needed by all --> |
|---|
| 98 |
<include name="rpiaccess*.jar"/> |
|---|
| 99 |
<include name="rpiutil*.jar"/> |
|---|
| 100 |
<include name="bw-davdefs*.jar"/> |
|---|
| 101 |
<include name="bw-davio*.jar"/> |
|---|
| 102 |
|
|---|
| 103 |
<!-- Calendar api jars --> |
|---|
| 104 |
<include name="bw-apiutil*.jar"/> |
|---|
| 105 |
<include name="bw-calcore*.jar"/> |
|---|
| 106 |
<include name="bw-calcorei*.jar"/> |
|---|
| 107 |
<include name="bw-calenv*.jar"/> |
|---|
| 108 |
<include name="bw-calfacade*.jar"/> |
|---|
| 109 |
<include name="bw-calsvc*.jar"/> |
|---|
| 110 |
<include name="bw-calsvci*.jar"/> |
|---|
| 111 |
<include name="bw-icalendar*.jar"/> |
|---|
| 112 |
<include name="bw-locale*.jar"/> |
|---|
| 113 |
<include name="bw-logging*.jar"/> |
|---|
| 114 |
</fileset> |
|---|
| 115 |
</copy> |
|---|
| 116 |
|
|---|
| 117 |
<!-- any extra bin files--> |
|---|
| 118 |
<copy todir="${app.dest.lib}" > |
|---|
| 119 |
<fileset refid="app.bin.files" /> |
|---|
| 120 |
</copy> |
|---|
| 121 |
|
|---|
| 122 |
<!-- Some more standard libs --> |
|---|
| 123 |
<copy todir="${app.dest.lib}" file="${log4j.jar}"/> |
|---|
| 124 |
<copy todir="${app.dest.lib}" file="${lucene.core.jar}"/> |
|---|
| 125 |
<copy todir="${app.dest.lib}" file="${lucene.misc.jar}"/> |
|---|
| 126 |
<copy todir="${app.dest.lib}" file="${ical4j.jar}"/> |
|---|
| 127 |
<copy todir="${app.dest.lib}" file="${commons-digester.jar}"/> |
|---|
| 128 |
<copy todir="${app.dest.lib}" file="${commons-httpclient.jar}"/> |
|---|
| 129 |
<copy todir="${app.dest.lib}" file="${commons-ssl.jar}"/> |
|---|
| 130 |
<copy todir="${app.dest.lib}" file="${commons-codec.jar}"/> |
|---|
| 131 |
<copy todir="${app.dest.lib}" file="${commons-lang.jar}"/> |
|---|
| 132 |
|
|---|
| 133 |
<!-- Extra libraries specified in calling build file --> |
|---|
| 134 |
<copy todir="${app.dest.lib}" flatten="yes" > |
|---|
| 135 |
<fileset refid="org.bedework.run.jars" /> |
|---|
| 136 |
<fileset refid="org.bedework.run.lib.jars" /> |
|---|
| 137 |
|
|---|
| 138 |
<!-- local jdbc drivers --> |
|---|
| 139 |
<fileset dir="${org.bedework.jdbc.lib}"> |
|---|
| 140 |
<include name="*.jar"/> |
|---|
| 141 |
</fileset> |
|---|
| 142 |
</copy> |
|---|
| 143 |
|
|---|
| 144 |
<!-- Include the quickstart jdbc driver --> |
|---|
| 145 |
<copy todir="${app.dest.lib}" file="${hsqldb.jdbcdriver.jar}"/> |
|---|
| 146 |
|
|---|
| 147 |
<copy todir="${app.dest.classes}"> |
|---|
| 148 |
<fileset dir="${org.bedework.project.calendarapi}/calCore/resources/properties" /> |
|---|
| 149 |
<filterset refid="property.filters" /> |
|---|
| 150 |
</copy> |
|---|
| 151 |
|
|---|
| 152 |
<copy todir="${app.dest.classes}"> |
|---|
| 153 |
<fileset dir="${org.bedework.project.calendarapi}/calCore/resources/hbms" /> |
|---|
| 154 |
<filterset refid="property.filters" /> |
|---|
| 155 |
</copy> |
|---|
| 156 |
|
|---|
| 157 |
<copy todir="${app.dest.classes}" overwrite="yes" > |
|---|
| 158 |
<fileset refid="org.bedework.extra.resources" /> |
|---|
| 159 |
<filterset refid="property.filters" /> |
|---|
| 160 |
</copy> |
|---|
| 161 |
|
|---|
| 162 |
<!-- add the jdbcdriver if defined --> |
|---|
| 163 |
<antcall target="add.jdbcdriver" inheritRefs="true" /> |
|---|
| 164 |
|
|---|
| 165 |
<!-- Create the env.properties file --> |
|---|
| 166 |
<mkdir dir="${app.dest.properties}" /> |
|---|
| 167 |
|
|---|
| 168 |
<copy tofile="${app.dest.properties}/env.properties" |
|---|
| 169 |
file="${org.bedework.config.properties}" /> |
|---|
| 170 |
|
|---|
| 171 |
<copy tofile="${app.dest.properties}/options.xml" |
|---|
| 172 |
file="${org.bedework.config.options}" /> |
|---|
| 173 |
|
|---|
| 174 |
<!-- =============================================================== |
|---|
| 175 |
Add any resource files |
|---|
| 176 |
=============================================================== --> |
|---|
| 177 |
|
|---|
| 178 |
<copy tofile="${app.dest.resources}/log4j.xml" |
|---|
| 179 |
file="${org.bedework.runsh.log4j.xml}" |
|---|
| 180 |
failonerror="false" /> |
|---|
| 181 |
|
|---|
| 182 |
<!-- =============================================================== |
|---|
| 183 |
Add any data files |
|---|
| 184 |
=============================================================== --> |
|---|
| 185 |
|
|---|
| 186 |
<mkdir dir="${app.dest.data}" /> |
|---|
| 187 |
|
|---|
| 188 |
<copy todir="${app.dest.data}" overwrite="yes" > |
|---|
| 189 |
<fileset refid="org.bedework.shellscr.data" /> |
|---|
| 190 |
<filterset refid="property.filters" /> |
|---|
| 191 |
</copy> |
|---|
| 192 |
|
|---|
| 193 |
<!-- =============================================================== |
|---|
| 194 |
Build the classpath |
|---|
| 195 |
=============================================================== --> |
|---|
| 196 |
|
|---|
| 197 |
<path id="app.run.path"> |
|---|
| 198 |
<fileset dir="${app.dest.lib}"> |
|---|
| 199 |
<include name="*.jar"/> |
|---|
| 200 |
</fileset> |
|---|
| 201 |
<pathelement location="${app.dest.resources}" /> |
|---|
| 202 |
</path> |
|---|
| 203 |
<pathconvert property="app.run.cp" refid="app.run.path" |
|---|
| 204 |
targetos="unix" > |
|---|
| 205 |
<map from="${app.dest.lib}" to="./lib"/> |
|---|
| 206 |
<map from="${app.dest.resources}" to="./resources"/> |
|---|
| 207 |
</pathconvert> |
|---|
| 208 |
<pathconvert property="app.run.wincp" refid="app.run.path" |
|---|
| 209 |
targetos="windows" > |
|---|
| 210 |
<map from="${app.dest.lib}" to="./lib"/> |
|---|
| 211 |
<map from="${app.dest.resources}" to="./resources"/> |
|---|
| 212 |
</pathconvert> |
|---|
| 213 |
|
|---|
| 214 |
<!-- =============================================================== |
|---|
| 215 |
Copy and modify the shell script |
|---|
| 216 |
=============================================================== --> |
|---|
| 217 |
|
|---|
| 218 |
<copy tofile="${app.dest.home}/${propval.app.shellscr.name}" |
|---|
| 219 |
file="${app.run.shellscr}" > |
|---|
| 220 |
<filterset> |
|---|
| 221 |
<filter token="CP" |
|---|
| 222 |
value=".:./classes:${app.run.cp}"/> |
|---|
| 223 |
</filterset> |
|---|
| 224 |
<filterset refid="property.filters" /> |
|---|
| 225 |
</copy> |
|---|
| 226 |
|
|---|
| 227 |
<copy tofile="${app.dest.home}/${propval.app.batscr.name}" |
|---|
| 228 |
file="${app.run.batscr}" > |
|---|
| 229 |
<filterset> |
|---|
| 230 |
<filter token="CP" |
|---|
| 231 |
value=".;./classes;${app.run.wincp}"/> |
|---|
| 232 |
</filterset> |
|---|
| 233 |
<filterset refid="property.filters" /> |
|---|
| 234 |
</copy> |
|---|
| 235 |
|
|---|
| 236 |
<!-- build the zip file --> |
|---|
| 237 |
<mkdir dir="${dist.home}" /> |
|---|
| 238 |
<delete file="${app.zip.file}" /> |
|---|
| 239 |
|
|---|
| 240 |
<zip destfile="${app.zip.file}" > |
|---|
| 241 |
<zipfileset prefix="${propval.app.zip.name}" dir="${app.dest.home}" /> |
|---|
| 242 |
</zip> |
|---|
| 243 |
</target> |
|---|
| 244 |
|
|---|
| 245 |
<target name="add.jdbcdriver" if="propval.app.jdbcdriver.jar"> |
|---|
| 246 |
<copy todir="${app.dest.lib}" file="${propval.app.jdbcdriver.jar}"/> |
|---|
| 247 |
</target> |
|---|
| 248 |
</project> |
|---|
| 249 |
|
|---|