| 1 |
<!-- Define a number of tasks and macros |
|---|
| 2 |
deftasks: define someuseful build tasks |
|---|
| 3 |
projectDefs: standard project definitions |
|---|
| 4 |
xMsg: x=info,debug etc. For message output |
|---|
| 5 |
|
|---|
| 6 |
Authors: Mike Douglass douglm rpi.edu |
|---|
| 7 |
--> |
|---|
| 8 |
|
|---|
| 9 |
<project name="doDeftasks" basedir="." default="" |
|---|
| 10 |
xmlns:artifact="antlib:org.apache.maven.artifact.ant"> |
|---|
| 11 |
<macrodef name="deftasks"> |
|---|
| 12 |
<sequential> |
|---|
| 13 |
<property name="build.dir" location="${bedework.home}/build"/> |
|---|
| 14 |
|
|---|
| 15 |
<path id="build.cp"> |
|---|
| 16 |
<fileset dir="${build.dir}"> |
|---|
| 17 |
<include name="*.jar"/> |
|---|
| 18 |
</fileset> |
|---|
| 19 |
</path> |
|---|
| 20 |
|
|---|
| 21 |
<!-- maven ant tasks --> |
|---|
| 22 |
<typedef resource="org/apache/maven/artifact/ant/antlib.xml" |
|---|
| 23 |
uri="antlib:org.apache.maven.artifact.ant" |
|---|
| 24 |
classpathref="build.cp" /> |
|---|
| 25 |
|
|---|
| 26 |
<taskdef name="applicationXml" |
|---|
| 27 |
classname="org.bedework.deployment.ApplicationXmlTask"> |
|---|
| 28 |
<classpath refid="build.cp"/> |
|---|
| 29 |
</taskdef> |
|---|
| 30 |
|
|---|
| 31 |
<!-- |
|---|
| 32 |
<taskdef name="artifactId" |
|---|
| 33 |
classname="org.bedework.deployment.ArtifactIdTask"> |
|---|
| 34 |
<classpath refid="build.cp"/> |
|---|
| 35 |
</taskdef> |
|---|
| 36 |
|
|---|
| 37 |
<taskdef name="dependencies" |
|---|
| 38 |
classname="org.bedework.deployment.DependenciesTask"> |
|---|
| 39 |
<classpath refid="build.cp"/> |
|---|
| 40 |
</taskdef> |
|---|
| 41 |
|
|---|
| 42 |
<taskdef name="dependency" |
|---|
| 43 |
classname="org.bedework.deployment.DependencyTask"> |
|---|
| 44 |
<classpath refid="build.cp"/> |
|---|
| 45 |
</taskdef>--> |
|---|
| 46 |
|
|---|
| 47 |
<taskdef name="forApp" |
|---|
| 48 |
classname="org.bedework.deployment.ForAppTask"> |
|---|
| 49 |
<classpath refid="build.cp"/> |
|---|
| 50 |
</taskdef> |
|---|
| 51 |
|
|---|
| 52 |
<taskdef name="forEachApp" |
|---|
| 53 |
classname="org.bedework.deployment.ForEachAppTask"> |
|---|
| 54 |
<classpath refid="build.cp"/> |
|---|
| 55 |
</taskdef> |
|---|
| 56 |
|
|---|
| 57 |
<!-- |
|---|
| 58 |
<taskdef name="groupId" |
|---|
| 59 |
classname="org.bedework.deployment.GroupIdTask"> |
|---|
| 60 |
<classpath refid="build.cp"/> |
|---|
| 61 |
</taskdef>--> |
|---|
| 62 |
|
|---|
| 63 |
<taskdef name="license" |
|---|
| 64 |
classname="org.bedework.deployment.LicenseTask"> |
|---|
| 65 |
<classpath refid="build.cp"/> |
|---|
| 66 |
</taskdef> |
|---|
| 67 |
|
|---|
| 68 |
<taskdef name="makeLangXsl" |
|---|
| 69 |
classname="org.bedework.deployment.MakeLangXsl"> |
|---|
| 70 |
<classpath refid="build.cp"/> |
|---|
| 71 |
</taskdef> |
|---|
| 72 |
|
|---|
| 73 |
<taskdef name="optional" |
|---|
| 74 |
classname="org.bedework.deployment.OptionalTask"> |
|---|
| 75 |
<classpath refid="build.cp"/> |
|---|
| 76 |
</taskdef> |
|---|
| 77 |
|
|---|
| 78 |
<taskdef name="resolveFile" |
|---|
| 79 |
classname="org.bedework.deployment.ResolveFile"> |
|---|
| 80 |
<classpath refid="build.cp"/> |
|---|
| 81 |
</taskdef> |
|---|
| 82 |
|
|---|
| 83 |
<!-- |
|---|
| 84 |
<taskdef name="scope" |
|---|
| 85 |
classname="org.bedework.deployment.ScopeTask"> |
|---|
| 86 |
<classpath refid="build.cp"/> |
|---|
| 87 |
</taskdef> |
|---|
| 88 |
|
|---|
| 89 |
<taskdef name="type" |
|---|
| 90 |
classname="org.bedework.deployment.TypeTask"> |
|---|
| 91 |
<classpath refid="build.cp"/> |
|---|
| 92 |
</taskdef> |
|---|
| 93 |
|
|---|
| 94 |
<taskdef name="version" |
|---|
| 95 |
classname="org.bedework.deployment.VersionTask"> |
|---|
| 96 |
<classpath refid="build.cp"/> |
|---|
| 97 |
</taskdef>--> |
|---|
| 98 |
</sequential> |
|---|
| 99 |
</macrodef> |
|---|
| 100 |
|
|---|
| 101 |
<macrodef name="installJar"> |
|---|
| 102 |
<attribute name="dir"/> |
|---|
| 103 |
<attribute name="name"/> |
|---|
| 104 |
<sequential> |
|---|
| 105 |
<artifact:pom id="the-pom" file="@{dir}/pom.xml" /> |
|---|
| 106 |
|
|---|
| 107 |
<if> |
|---|
| 108 |
<isset property="org.bedework.appserver.repository.dir" /> |
|---|
| 109 |
<then> |
|---|
| 110 |
<!-- use this as the local repository --> |
|---|
| 111 |
|
|---|
| 112 |
<artifact:install file="@{name}"> |
|---|
| 113 |
<localRepository path="${org.bedework.appserver.repository.dir}"/> |
|---|
| 114 |
<pom refid="the-pom"/> |
|---|
| 115 |
</artifact:install> |
|---|
| 116 |
</then> |
|---|
| 117 |
<else> |
|---|
| 118 |
<!-- Use default repository --> |
|---|
| 119 |
|
|---|
| 120 |
<artifact:install file="@{name}"> |
|---|
| 121 |
<pom refid="the-pom"/> |
|---|
| 122 |
</artifact:install> |
|---|
| 123 |
</else> |
|---|
| 124 |
</if> |
|---|
| 125 |
</sequential> |
|---|
| 126 |
</macrodef> |
|---|
| 127 |
|
|---|
| 128 |
<macrodef name="installPom"> |
|---|
| 129 |
<attribute name="dir"/> |
|---|
| 130 |
<sequential> |
|---|
| 131 |
<artifact:pom id="the-pom" file="@{dir}/pom.xml" /> |
|---|
| 132 |
|
|---|
| 133 |
<if> |
|---|
| 134 |
<isset property="org.bedework.appserver.repository.dir" /> |
|---|
| 135 |
<then> |
|---|
| 136 |
<!-- use this as the local repository --> |
|---|
| 137 |
|
|---|
| 138 |
<artifact:install file="@{dir}/pom.xml"> |
|---|
| 139 |
<localRepository path="${org.bedework.appserver.repository.dir}"/> |
|---|
| 140 |
<pom refid="the-pom"/> |
|---|
| 141 |
</artifact:install> |
|---|
| 142 |
</then> |
|---|
| 143 |
<else> |
|---|
| 144 |
<!-- Use default repository --> |
|---|
| 145 |
|
|---|
| 146 |
<artifact:install file="@{dir}/pom.xml"> |
|---|
| 147 |
<pom refid="the-pom"/> |
|---|
| 148 |
</artifact:install> |
|---|
| 149 |
</else> |
|---|
| 150 |
</if> |
|---|
| 151 |
</sequential> |
|---|
| 152 |
</macrodef> |
|---|
| 153 |
|
|---|
| 154 |
<!-- Deploy into the app server --> |
|---|
| 155 |
<macrodef name="deployJar"> |
|---|
| 156 |
<attribute name="dir"/> |
|---|
| 157 |
<attribute name="name"/> |
|---|
| 158 |
<sequential> |
|---|
| 159 |
<if> |
|---|
| 160 |
<isset property="org.bedework.appserver.repository.dir" /> |
|---|
| 161 |
<then> |
|---|
| 162 |
<artifact:pom id="the-pom" file="@{dir}/pom.xml" /> |
|---|
| 163 |
|
|---|
| 164 |
<artifact:install file="@{name}"> |
|---|
| 165 |
<localRepository path="${org.bedework.appserver.repository.dir}"/> |
|---|
| 166 |
<pom refid="the-pom"/> |
|---|
| 167 |
</artifact:install> |
|---|
| 168 |
|
|---|
| 169 |
<!-- |
|---|
| 170 |
<artifact:deploy file="@{name}"> |
|---|
| 171 |
<localRepository path="${org.bedework.appserver.repository.dir}"/> |
|---|
| 172 |
<pom refid="the-pom"/> |
|---|
| 173 |
</artifact:deploy> --> |
|---|
| 174 |
</then> |
|---|
| 175 |
</if> |
|---|
| 176 |
</sequential> |
|---|
| 177 |
</macrodef> |
|---|
| 178 |
|
|---|
| 179 |
<!-- Resolve dependencies with the given pom file --> |
|---|
| 180 |
<macrodef name="resolveDependencies"> |
|---|
| 181 |
<attribute name="pomFile"/> |
|---|
| 182 |
<sequential> |
|---|
| 183 |
<artifact:pom id="the-pom" file="@{pomFile}" /> |
|---|
| 184 |
|
|---|
| 185 |
<if> |
|---|
| 186 |
<isset property="org.bedework.appserver.repository.dir" /> |
|---|
| 187 |
<then> |
|---|
| 188 |
<!-- use this as the local repository --> |
|---|
| 189 |
<artifact:dependencies filesetId="dependency.fileset" |
|---|
| 190 |
useScope="compile" |
|---|
| 191 |
pomRefId="the-pom"> |
|---|
| 192 |
<localRepository path="${org.bedework.appserver.repository.dir}"/> |
|---|
| 193 |
</artifact:dependencies> |
|---|
| 194 |
</then> |
|---|
| 195 |
<else> |
|---|
| 196 |
<!-- Use default repository --> |
|---|
| 197 |
<artifact:dependencies filesetId="dependency.fileset" |
|---|
| 198 |
useScope="compile" |
|---|
| 199 |
pomRefId="the-pom"> |
|---|
| 200 |
</artifact:dependencies> |
|---|
| 201 |
</else> |
|---|
| 202 |
</if> |
|---|
| 203 |
|
|---|
| 204 |
<copy todir="${lib.dir}"> |
|---|
| 205 |
<fileset refid="dependency.fileset" /> |
|---|
| 206 |
<!-- This mapper strips off all leading directory information --> |
|---|
| 207 |
<mapper type="flatten" /> |
|---|
| 208 |
</copy> |
|---|
| 209 |
</sequential> |
|---|
| 210 |
</macrodef> |
|---|
| 211 |
|
|---|
| 212 |
<macrodef name="execProject"> |
|---|
| 213 |
<attribute name="project"/> |
|---|
| 214 |
<attribute name="target"/> |
|---|
| 215 |
<sequential> |
|---|
| 216 |
<ant antfile="${bedework.home}/../@{project}/build.xml" |
|---|
| 217 |
inheritall="false" |
|---|
| 218 |
target="@{target}" /> |
|---|
| 219 |
</sequential> |
|---|
| 220 |
</macrodef> |
|---|
| 221 |
|
|---|
| 222 |
<macrodef name="buildfilters"> |
|---|
| 223 |
<sequential> |
|---|
| 224 |
<filterset id="property.filters" > |
|---|
| 225 |
<!-- Global settings --> |
|---|
| 226 |
<filter token="QUICKSTART_DIR" |
|---|
| 227 |
value="${quickstart.dir}"/> |
|---|
| 228 |
|
|---|
| 229 |
<filter token="APPSERVER-DATA-DIR" |
|---|
| 230 |
value="${org.bedework.data.dir}"/> |
|---|
| 231 |
|
|---|
| 232 |
<filter token="DATA_DIR" |
|---|
| 233 |
value="${org.bedework.data.dir}"/> |
|---|
| 234 |
|
|---|
| 235 |
<filter token="BW-APP-NAME" |
|---|
| 236 |
value="${org.bedework.deploy.name}"/> |
|---|
| 237 |
|
|---|
| 238 |
<filter token="HIBERNATE-DIALECT" |
|---|
| 239 |
value="${org.bedework.global.hibernate.dialect}" /> |
|---|
| 240 |
|
|---|
| 241 |
<filter token="SECOND-LEVEL-CACHING" |
|---|
| 242 |
value="${org.bedework.global.hibernate.cache.use_second_level_cache}" /> |
|---|
| 243 |
|
|---|
| 244 |
<filter token="CACHE-PROVIDER" |
|---|
| 245 |
value="${org.bedework.global.hibernate.cache.provider_class}" /> |
|---|
| 246 |
|
|---|
| 247 |
<filter token="DIRECTORY-BROWSING-DISALLOWED" |
|---|
| 248 |
value="${org.bedework.global.directory.browsing.disallowed}" /> |
|---|
| 249 |
|
|---|
| 250 |
<filter token="SERVLET-CLASS" |
|---|
| 251 |
value="${org.bedework.global.servlet.class}"/> |
|---|
| 252 |
|
|---|
| 253 |
<filter token="PORTLET-SERVLET-CLASS" |
|---|
| 254 |
value="${org.bedework.global.portlet-servlet.class}"/> |
|---|
| 255 |
|
|---|
| 256 |
<filter token="PORTAL-SERVLET-CONTEXT-PROVIDER" |
|---|
| 257 |
value="${org.bedework.global.portal-servlet.context.provider}"/> |
|---|
| 258 |
|
|---|
| 259 |
<filter token="PORTAL-SERVLET-CONTEXT-LISTENER" |
|---|
| 260 |
value="${org.bedework.global.portal-servlet.context.listener}"/> |
|---|
| 261 |
|
|---|
| 262 |
<filter token="PORTLET-CLASS" |
|---|
| 263 |
value="${org.bedework.global.portlet.class}"/> |
|---|
| 264 |
|
|---|
| 265 |
<filter token="IGNORE-CONTENT-TYPE" |
|---|
| 266 |
value="${org.bedework.global.ignoreContentType}" /> |
|---|
| 267 |
|
|---|
| 268 |
<filter token="GENURL-TAGLIB-TLD" |
|---|
| 269 |
value="${org.bedework.global.genurl.taglib.tld}"/> |
|---|
| 270 |
|
|---|
| 271 |
<filter token="LIFERAY-COMPANY-ID" |
|---|
| 272 |
value="${org.bedework.global.liferay.company-id}"/> |
|---|
| 273 |
|
|---|
| 274 |
<filter token="JBOSS-CARDDB-DATASOURCE" |
|---|
| 275 |
value="${org.bedework.global.jboss.carddb.datasource.jndiname}"/> |
|---|
| 276 |
|
|---|
| 277 |
<filter token="JBOSS-EVENTREGDB-DATASOURCE" |
|---|
| 278 |
value="${org.bedework.global.jboss.eventreg.datasource.jndiname}"/> |
|---|
| 279 |
|
|---|
| 280 |
<filter token="JBOSS-DB-DATASOURCE" |
|---|
| 281 |
value="${org.bedework.global.jboss.db.datasource.jndiname}"/> |
|---|
| 282 |
|
|---|
| 283 |
<!-- Application settings --> |
|---|
| 284 |
|
|---|
| 285 |
<filter token="APP-DESCRIPTION" |
|---|
| 286 |
value="${propval.app.description}" /> |
|---|
| 287 |
|
|---|
| 288 |
<filter token="PORTLET-NAME" |
|---|
| 289 |
value="${propval.app.portlet.name}"/> |
|---|
| 290 |
|
|---|
| 291 |
<filter token="CAL-SUITE" |
|---|
| 292 |
value="${propval.app.cal.suite}"/> |
|---|
| 293 |
|
|---|
| 294 |
<filter token="SECURITY-DOMAIN" |
|---|
| 295 |
value="${propval.app.security.domain}"/> |
|---|
| 296 |
<filter token="SECURITY-PREFIX" |
|---|
| 297 |
value="${propval.app.security.prefix}"/> |
|---|
| 298 |
<filter token="TRANSPORT-GUARANTEE" |
|---|
| 299 |
value="${propval.app.transport.guarantee}"/> |
|---|
| 300 |
|
|---|
| 301 |
<filter token="DISPLAY-NAME" |
|---|
| 302 |
value="${propval.app.display.name}"/> |
|---|
| 303 |
<filter token="CONTEXT-ROOT" |
|---|
| 304 |
value="${propval.app.context.root}" /> |
|---|
| 305 |
<filter token="APP-NAME" |
|---|
| 306 |
value="${propval.app.name}"/> |
|---|
| 307 |
<filter token="APP-DESCRIPTION" |
|---|
| 308 |
value="${propval.app.description}"/> |
|---|
| 309 |
<filter token="WAR-NAME" |
|---|
| 310 |
value="${propval.app.war.name}"/> |
|---|
| 311 |
<filter token="TOMCAT-DOC-BASE" |
|---|
| 312 |
value="${org.bedework.appserver.dir}${propval.app.deploy.dir}/${propval.app.war.name}"/> |
|---|
| 313 |
|
|---|
| 314 |
<filter token="DEFAULT-CONTENTTYPE" |
|---|
| 315 |
value="${propval.app.default.contenttype}" /> |
|---|
| 316 |
<filter token="NOXSLT" |
|---|
| 317 |
value="${propval.app.noxslt}" /> |
|---|
| 318 |
|
|---|
| 319 |
<!-- Change this to be an app par --> |
|---|
| 320 |
<filter token="RUN-AS-USER" |
|---|
| 321 |
value="${org.bedework.syspar.public.user}" /> |
|---|
| 322 |
|
|---|
| 323 |
<!-- ??????? |
|---|
| 324 |
<filter token="CALFILE-NAME" |
|---|
| 325 |
value="${propval.app.calfile.name}" /> --> |
|---|
| 326 |
|
|---|
| 327 |
<!-- Shell script settings --> |
|---|
| 328 |
|
|---|
| 329 |
<filter token="SCHEMA-DELIMITER" |
|---|
| 330 |
value="${propval.app.schema.delimiter}" /> |
|---|
| 331 |
|
|---|
| 332 |
<filter token="KEYFILE-DIR" |
|---|
| 333 |
value="${org.bedework.global.keyfile.dir}"/> |
|---|
| 334 |
|
|---|
| 335 |
<filter token="calSoapWsURI" |
|---|
| 336 |
value="${org.bedework.calws-soap.uri}" /> |
|---|
| 337 |
|
|---|
| 338 |
<filter token="synchWsURI" |
|---|
| 339 |
value="${org.bedework.synch.uri}" /> |
|---|
| 340 |
|
|---|
| 341 |
<filter token="synchService" |
|---|
| 342 |
value="${org.bedework.synch.service}" /> |
|---|
| 343 |
|
|---|
| 344 |
<filter token="synchServiceManager" |
|---|
| 345 |
value="${org.bedework.synch.service.manager}" /> |
|---|
| 346 |
|
|---|
| 347 |
<filter token="SYNCH_WSDL_DIR" |
|---|
| 348 |
value="${org.bedework.synch.wsdl.deploy.dir}" /> |
|---|
| 349 |
|
|---|
| 350 |
<filter token="synchWsdlURI" |
|---|
| 351 |
value="${org.bedework.synch.wsdl.uri}" /> |
|---|
| 352 |
|
|---|
| 353 |
<filter token="tzdataURI" |
|---|
| 354 |
value="${org.bedework.app.tzsvr.tzdata.url}" /> |
|---|
| 355 |
|
|---|
| 356 |
<filter token="tzdataRefreshInterval" |
|---|
| 357 |
value="${org.bedework.app.tzsvr.refetch.interval}" /> |
|---|
| 358 |
|
|---|
| 359 |
<filter token="tzserverPrimary" |
|---|
| 360 |
value="${org.bedework.app.tzsvr.primary.server}" /> |
|---|
| 361 |
|
|---|
| 362 |
<filter token="tzserverPrimaryUrl" |
|---|
| 363 |
value="${org.bedework.app.tzsvr.primary.url}" /> |
|---|
| 364 |
|
|---|
| 365 |
<filter token="APP-VERSION" |
|---|
| 366 |
value="${org.bedework.global.version}"/> |
|---|
| 367 |
|
|---|
| 368 |
<filter token="orgBedeworkVersion" |
|---|
| 369 |
value="${org.bedework.version}"/> |
|---|
| 370 |
<filter token="orgBedeworkAccessVersion" |
|---|
| 371 |
value="${org.bedework.access.version}"/> |
|---|
| 372 |
<filter token="orgBedeworkAnnotationsVersion" |
|---|
| 373 |
value="${org.bedework.annotations.version}"/> |
|---|
| 374 |
<filter token="orgBedeworkBedenoteVersion" |
|---|
| 375 |
value="${org.bedework.bedenote.version}"/> |
|---|
| 376 |
<filter token="orgBedeworkBwcaldavVersion" |
|---|
| 377 |
value="${org.bedework.bwcaldav.version}"/> |
|---|
| 378 |
<filter token="orgBedeworkBwtoolsVersion" |
|---|
| 379 |
value="${org.bedework.bwtools.version}"/> |
|---|
| 380 |
<filter token="orgBedeworkBwxmlVersion" |
|---|
| 381 |
value="${org.bedework.bwxml.version}"/> |
|---|
| 382 |
<filter token="orgBedeworkCalcoreVersion" |
|---|
| 383 |
value="${org.bedework.calcore.version}"/> |
|---|
| 384 |
<filter token="orgBedeworkCaldavVersion" |
|---|
| 385 |
value="${org.bedework.caldav.version}"/> |
|---|
| 386 |
<filter token="orgBedeworkCaldavtestVersion" |
|---|
| 387 |
value="${org.bedework.caldavtest.version}"/> |
|---|
| 388 |
<filter token="orgBedeworkCalfacadeVersion" |
|---|
| 389 |
value="${org.bedework.calfacade.version}"/> |
|---|
| 390 |
<filter token="orgBedeworkCarddavVersion" |
|---|
| 391 |
value="${org.bedework.carddav.version}"/> |
|---|
| 392 |
<filter token="orgBedeworkDavutilVersion" |
|---|
| 393 |
value="${org.bedework.davutil.version}"/> |
|---|
| 394 |
<filter token="orgBedeworkDumprestoreVersion" |
|---|
| 395 |
value="${org.bedework.dumprestore.version}"/> |
|---|
| 396 |
<filter token="orgBedeworkExchggatewayVersion" |
|---|
| 397 |
value="${org.bedework.exchggateway.version}"/> |
|---|
| 398 |
<filter token="orgBedeworkIcalendarVersion" |
|---|
| 399 |
value="${org.bedework.icalendar.version}"/> |
|---|
| 400 |
<filter token="orgBedeworkIndexerVersion" |
|---|
| 401 |
value="${org.bedework.indexer.version}"/> |
|---|
| 402 |
<filter token="orgBedeworkInterfacesVersion" |
|---|
| 403 |
value="${org.bedework.interfaces.version}"/> |
|---|
| 404 |
<filter token="orgBedeworkMiscVersion" |
|---|
| 405 |
value="${org.bedework.misc.version}"/> |
|---|
| 406 |
<filter token="orgBedeworkMonitorVersion" |
|---|
| 407 |
value="${org.bedework.monitor.version}"/> |
|---|
| 408 |
<filter token="orgBedeworkRpiutilVersion" |
|---|
| 409 |
value="${org.bedework.rpiutil.version}"/> |
|---|
| 410 |
<filter token="orgBedeworkSynchVersion" |
|---|
| 411 |
value="${org.bedework.synch.version}"/> |
|---|
| 412 |
<filter token="orgBedeworkSyseventsVersion" |
|---|
| 413 |
value="${org.bedework.sysevents.version}"/> |
|---|
| 414 |
<filter token="orgBedeworkTestsuiteVersion" |
|---|
| 415 |
value="${org.bedework.testsuite.version}"/> |
|---|
| 416 |
<filter token="orgBedeworkBwtzsvrVersion" |
|---|
| 417 |
value="${org.bedework.bwtzsvr.version}"/> |
|---|
| 418 |
<filter token="orgBedeworkWebappsVersion" |
|---|
| 419 |
value="${org.bedework.webapps.version}"/> |
|---|
| 420 |
<filter token="orgBedeworkWebdavVersion" |
|---|
| 421 |
value="${org.bedework.webdav.version}"/> |
|---|
| 422 |
<filter token="orgBedeworkXmlschemaVersion" |
|---|
| 423 |
value="${org.bedework.xmlschema.version}"/> |
|---|
| 424 |
|
|---|
| 425 |
</filterset> |
|---|
| 426 |
</sequential> |
|---|
| 427 |
</macrodef> |
|---|
| 428 |
|
|---|
| 429 |
<macrodef name="projectDefs"> |
|---|
| 430 |
<attribute name="name"/> |
|---|
| 431 |
<attribute name="version"/> |
|---|
| 432 |
<attribute name="deployment-name" default=""/> |
|---|
| 433 |
<attribute name="subproject" default="false"/> |
|---|
| 434 |
<sequential> |
|---|
| 435 |
<property name="project.name" value="@{name}"/> |
|---|
| 436 |
|
|---|
| 437 |
<property name="project.version" value="@{version}"/> |
|---|
| 438 |
|
|---|
| 439 |
<property name="dist.home" location="${project.home}/dist"/> |
|---|
| 440 |
<mkdir dir="${dist.home}" /> |
|---|
| 441 |
|
|---|
| 442 |
<property name="lib.dir" location="${project.home}/lib"/> |
|---|
| 443 |
|
|---|
| 444 |
<property name="buildjar" location="${build.dir}/buildTools/buildjar.xml"/> |
|---|
| 445 |
<property name="buildwar" location="${build.dir}/buildwar.xml"/> |
|---|
| 446 |
<property name="buildsh" location="${build.dir}/buildsh.xml"/> |
|---|
| 447 |
|
|---|
| 448 |
<property name="resources.dir" location="${project.home}/resources"/> |
|---|
| 449 |
|
|---|
| 450 |
<property name="org.bedework.libcache.dir" |
|---|
| 451 |
location="${bedework.home}/libcache"/> |
|---|
| 452 |
|
|---|
| 453 |
<property name="org.bedework.temp.dir" |
|---|
| 454 |
location="${dist.home}/temp" /> |
|---|
| 455 |
|
|---|
| 456 |
<if> |
|---|
| 457 |
<istrue value="@{subproject}" /> |
|---|
| 458 |
<then> |
|---|
| 459 |
<property name="source.home" location="${project.home}/src"/> |
|---|
| 460 |
</then> |
|---|
| 461 |
<else> |
|---|
| 462 |
<delete dir="${org.bedework.temp.dir}" /> |
|---|
| 463 |
<mkdir dir="${org.bedework.temp.dir}" /> |
|---|
| 464 |
|
|---|
| 465 |
<property name="org.bedework.deployment.name" |
|---|
| 466 |
value="@{deployment-name}" /> |
|---|
| 467 |
|
|---|
| 468 |
<deftasks/> |
|---|
| 469 |
</else> |
|---|
| 470 |
</if> |
|---|
| 471 |
|
|---|
| 472 |
<import file="${build.dir}/buildTools/getJar.xml"/> |
|---|
| 473 |
<import file="${build.dir}/buildTools/jdoc.xml"/> |
|---|
| 474 |
|
|---|
| 475 |
<!-- Now we have getjar build a classpath for the bundle tasks |
|---|
| 476 |
<mkdir dir="${org.bedework.temp.dir}/bundle-build" /> |
|---|
| 477 |
<getJar name="commons-io" version="2.0.1" |
|---|
| 478 |
lib="${org.bedework.temp.dir}/bundle-build"/> |
|---|
| 479 |
<getJar name="bcel" version="5.3-SNAPSHOT" |
|---|
| 480 |
lib="${org.bedework.temp.dir}/bundle-build"/> |
|---|
| 481 |
<getJar name="ch.jm.osgi.util.bundle" version="1.0.0" |
|---|
| 482 |
lib="${org.bedework.temp.dir}/bundle-build"/> |
|---|
| 483 |
|
|---|
| 484 |
<path id="bundle-util.classpath"> |
|---|
| 485 |
<fileset dir="${org.bedework.temp.dir}/bundle-build"/> |
|---|
| 486 |
</path> |
|---|
| 487 |
<taskdef resource="ch/jm/osgi/util/bundle/ant/antlib.xml" |
|---|
| 488 |
classpathref="bundle-util.classpath" onerror="fail"/> --> |
|---|
| 489 |
|
|---|
| 490 |
<!-- And the cargo tasks |
|---|
| 491 |
<mkdir dir="${org.bedework.temp.dir}/cargo" /> |
|---|
| 492 |
<getJar name="cargo-ant" version="1.2.0" |
|---|
| 493 |
lib="${org.bedework.temp.dir}/cargo"/> |
|---|
| 494 |
<getJar name="cargo-core-uberjar" version="1.2.0" |
|---|
| 495 |
lib="${org.bedework.temp.dir}/cargo"/> |
|---|
| 496 |
<getJar name="commons-discovery" version="20040218.194635" |
|---|
| 497 |
lib="${org.bedework.temp.dir}/cargo"/> |
|---|
| 498 |
<getJar name="commons-logging" |
|---|
| 499 |
lib="${org.bedework.temp.dir}/cargo"/> |
|---|
| 500 |
|
|---|
| 501 |
<path id="cargo.classpath"> |
|---|
| 502 |
<fileset dir="${org.bedework.temp.dir}/cargo"/> |
|---|
| 503 |
</path> |
|---|
| 504 |
<taskdef resource="cargo.tasks" |
|---|
| 505 |
classpathref="cargo.classpath" onerror="fail"/>--> |
|---|
| 506 |
</sequential> |
|---|
| 507 |
</macrodef> |
|---|
| 508 |
|
|---|
| 509 |
<!-- =================================================================== |
|---|
| 510 |
Load the deployment configuration from the properties file. We also load |
|---|
| 511 |
the run time options and define some properties based on some of the |
|---|
| 512 |
values found there |
|---|
| 513 |
=================================================================== --> |
|---|
| 514 |
<macrodef name="loadDeployConfig"> |
|---|
| 515 |
<!--<attribute name="extra.options" default="${org.bedework.carddav.options}"/> --> |
|---|
| 516 |
<sequential> |
|---|
| 517 |
<taskdef resource="net/sf/antcontrib/antcontrib.properties" /> |
|---|
| 518 |
|
|---|
| 519 |
<if> |
|---|
| 520 |
<not> |
|---|
| 521 |
<isset property="bedework-options.org.bedework.global.portal.platform"/> |
|---|
| 522 |
</not> |
|---|
| 523 |
<then> |
|---|
| 524 |
<property environment="env"/> |
|---|
| 525 |
|
|---|
| 526 |
<!-- Load build property definition overrides --> |
|---|
| 527 |
<property file="${org.bedework.build.properties}" /> |
|---|
| 528 |
|
|---|
| 529 |
<configMsg message="Loading build properties from ${org.bedework.build.properties}" /> |
|---|
| 530 |
<configMsg message="Use config override properties ${org.bedework.config.override.properties}" /> |
|---|
| 531 |
<configMsg message="Use config properties ${org.bedework.config.properties}" /> |
|---|
| 532 |
<configMsg message="Runtime options from ${org.bedework.config.options}" /> |
|---|
| 533 |
|
|---|
| 534 |
<property file="${org.bedework.configuration.versions}" /> |
|---|
| 535 |
<property file="${org.bedework.config.override.properties}" /> |
|---|
| 536 |
<property file="${org.bedework.config.properties}" /> |
|---|
| 537 |
|
|---|
| 538 |
<!-- Load the run time options and define some properties based on some |
|---|
| 539 |
of the values --> |
|---|
| 540 |
|
|---|
| 541 |
<!-- Load the general bedework options --> |
|---|
| 542 |
<xmlproperty file="${org.bedework.config.options}"/> |
|---|
| 543 |
|
|---|
| 544 |
<!-- Load the extra options |
|---|
| 545 |
<xmlproperty file="@{extra.options}"/>--> |
|---|
| 546 |
|
|---|
| 547 |
<if> |
|---|
| 548 |
<isset property="bedework-options.org.bedework.global.portal.platform"/> |
|---|
| 549 |
<then> |
|---|
| 550 |
<property name="org.bedework.global.portal.platform" |
|---|
| 551 |
value="${bedework-options.org.bedework.global.portal.platform}" /> |
|---|
| 552 |
|
|---|
| 553 |
<property name="org.bedework.config.portal.home" |
|---|
| 554 |
value="${org.bedework.configurations.home}/.portal/${org.bedework.global.portal.platform}" /> |
|---|
| 555 |
|
|---|
| 556 |
<property name="org.bedework.config.portal.common.home" |
|---|
| 557 |
value="${org.bedework.configurations.home}/.portal/common-resources" /> |
|---|
| 558 |
|
|---|
| 559 |
<debugMsg message="******************* load from ${org.bedework.config.portal.home}/portal.properties" /> |
|---|
| 560 |
|
|---|
| 561 |
<property file="${org.bedework.config.portal.home}/portal.properties" /> |
|---|
| 562 |
</then> |
|---|
| 563 |
<else> |
|---|
| 564 |
<debugMsg message="******************* load from ${org.bedework.configurations.home}/.standalone/standalone.properties" /> |
|---|
| 565 |
|
|---|
| 566 |
<property file="${org.bedework.configurations.home}/.platform/standalone.properties" /> |
|---|
| 567 |
</else> |
|---|
| 568 |
</if> |
|---|
| 569 |
|
|---|
| 570 |
<property name="org.bedework.global.version" |
|---|
| 571 |
value="${bedework-options.org.bedework.global.version}" /> |
|---|
| 572 |
|
|---|
| 573 |
<property name="org.bedework.global.directory.browsing.disallowed" |
|---|
| 574 |
value="${bedework-options.org.bedework.syspars.directoryBrowsingDisallowed}" /> |
|---|
| 575 |
</then> |
|---|
| 576 |
</if> |
|---|
| 577 |
</sequential> |
|---|
| 578 |
</macrodef> |
|---|
| 579 |
|
|---|
| 580 |
<!-- ===================================================================== |
|---|
| 581 |
Assumes projectDefs was called previously. |
|---|
| 582 |
===================================================================== --> |
|---|
| 583 |
<macrodef name="projectInit"> |
|---|
| 584 |
<sequential> |
|---|
| 585 |
<infoMsg message="* =========== Building ${project.name}" /> |
|---|
| 586 |
|
|---|
| 587 |
<loadDeployConfig/> |
|---|
| 588 |
|
|---|
| 589 |
<delete dir="${lib.dir}" /> |
|---|
| 590 |
<mkdir dir="${lib.dir}" /> |
|---|
| 591 |
|
|---|
| 592 |
<property name="test.data.dir" |
|---|
| 593 |
location="${dist.home}/test-data" /> |
|---|
| 594 |
|
|---|
| 595 |
<property name="test.reports.dir" |
|---|
| 596 |
location="${dist.home}/test-reports" /> |
|---|
| 597 |
|
|---|
| 598 |
<property name="org.bedework.empty.dir" |
|---|
| 599 |
location="${dist.home}/empty-dir" /> |
|---|
| 600 |
<mkdir dir="${org.bedework.empty.dir}" /> |
|---|
| 601 |
|
|---|
| 602 |
<fileset id="empty.fileset" dir="${org.bedework.empty.dir}" |
|---|
| 603 |
excludes="*" /> |
|---|
| 604 |
|
|---|
| 605 |
<!-- ==================== Compilation Classpath ==================== --> |
|---|
| 606 |
|
|---|
| 607 |
<path id="compile.classpath"> |
|---|
| 608 |
<fileset dir="${lib.dir}"> |
|---|
| 609 |
<include name="*.jar"/> |
|---|
| 610 |
</fileset> |
|---|
| 611 |
<fileset dir="${dist.home}"> |
|---|
| 612 |
<include name="*.jar"/> |
|---|
| 613 |
</fileset> |
|---|
| 614 |
</path> |
|---|
| 615 |
</sequential> |
|---|
| 616 |
</macrodef> |
|---|
| 617 |
|
|---|
| 618 |
<!-- ===================================================================== |
|---|
| 619 |
Assumes projectDefs was called previously. |
|---|
| 620 |
Set things up ready for deployment |
|---|
| 621 |
===================================================================== --> |
|---|
| 622 |
<macrodef name="deployInit"> |
|---|
| 623 |
<attribute name="ear-name"/> |
|---|
| 624 |
<sequential> |
|---|
| 625 |
<!-- Where we put ear stuff --> |
|---|
| 626 |
<if> |
|---|
| 627 |
<isset property="org.bedework.global.build.ear" /> |
|---|
| 628 |
<then> |
|---|
| 629 |
<property name="app.ear.file.name" |
|---|
| 630 |
value="@{ear-name}.ear" /> |
|---|
| 631 |
|
|---|
| 632 |
<property name="org.bedework.ear.name" |
|---|
| 633 |
value="@{ear-name}" /> |
|---|
| 634 |
|
|---|
| 635 |
<property name="org.bedework.ear.templib" |
|---|
| 636 |
location="${org.bedework.temp.dir}/earlib" /> |
|---|
| 637 |
|
|---|
| 638 |
<property name="org.bedework.ear.properties.dir" |
|---|
| 639 |
location="${org.bedework.temp.dir}/ear-properties" /> |
|---|
| 640 |
|
|---|
| 641 |
<delete dir="${org.bedework.ear.templib}" /> |
|---|
| 642 |
<mkdir dir="${org.bedework.ear.templib}" /> |
|---|
| 643 |
|
|---|
| 644 |
<delete dir="${org.bedework.ear.properties.dir}" /> |
|---|
| 645 |
<mkdir dir="${org.bedework.ear.properties.dir}" /> |
|---|
| 646 |
</then> |
|---|
| 647 |
</if> |
|---|
| 648 |
|
|---|
| 649 |
<property name="org.bedework.global.build.common.context.war.name" |
|---|
| 650 |
value="bw-common" /> |
|---|
| 651 |
|
|---|
| 652 |
<property name="org.bedework.temp.wars.home" |
|---|
| 653 |
location="${org.bedework.temp.dir}/wars" /> |
|---|
| 654 |
|
|---|
| 655 |
<property name="org.bedework.temp.shellscr.home" |
|---|
| 656 |
location="${org.bedework.temp.dir}/shellscr" /> |
|---|
| 657 |
|
|---|
| 658 |
<!-- Recreated by each app build file. Place extra jars here --> |
|---|
| 659 |
<property name="org.bedework.temp.extrajars.dir" |
|---|
| 660 |
location="${org.bedework.temp.dir}/extrajars" /> |
|---|
| 661 |
|
|---|
| 662 |
<!-- Preserve extra jars for ear builds --> |
|---|
| 663 |
<property name="org.bedework.temp.ear.extrajars.dir" |
|---|
| 664 |
location="${org.bedework.temp.dir}/earextrajars" /> |
|---|
| 665 |
|
|---|
| 666 |
<property name="org.bedework.global.context.roots" |
|---|
| 667 |
location="${org.bedework.temp.dir}/context-roots.properties" /> |
|---|
| 668 |
|
|---|
| 669 |
<tempfile property="org.bedework.global.context.roots" |
|---|
| 670 |
destdir="${org.bedework.temp.dir}" |
|---|
| 671 |
prefix="context-roots" suffix=".properties" /> |
|---|
| 672 |
|
|---|
| 673 |
<!-- Clean up before we start --> |
|---|
| 674 |
<delete dir="${org.bedework.temp.wars.home}" /> |
|---|
| 675 |
<mkdir dir="${org.bedework.temp.wars.home}" /> |
|---|
| 676 |
|
|---|
| 677 |
<delete dir="${org.bedework.temp.ear.extrajars.dir}" /> |
|---|
| 678 |
<mkdir dir="${org.bedework.temp.ear.extrajars.dir}" /> |
|---|
| 679 |
|
|---|
| 680 |
<delete dir="${org.bedework.temp.extrajars.dir}" /> |
|---|
| 681 |
<mkdir dir="${org.bedework.temp.extrajars.dir}" /> |
|---|
| 682 |
</sequential> |
|---|
| 683 |
</macrodef> |
|---|
| 684 |
|
|---|
| 685 |
<macrodef name="deployTerm"> |
|---|
| 686 |
<sequential> |
|---|
| 687 |
<if> |
|---|
| 688 |
<equals arg1="${propval.app.package.type}" arg2="service" /> |
|---|
| 689 |
<then> |
|---|
| 690 |
<ant antfile="${build.dir}/../deployment/termination/service/build.xml" |
|---|
| 691 |
target="deploy" inheritRefs="true" /> |
|---|
| 692 |
</then> |
|---|
| 693 |
<else> |
|---|
| 694 |
<ant antfile="${build.dir}/../deployment/termination/webapp/build.xml" |
|---|
| 695 |
target="deploy" inheritRefs="true" /> |
|---|
| 696 |
</else> |
|---|
| 697 |
</if> |
|---|
| 698 |
|
|---|
| 699 |
<!-- Platform specific --> |
|---|
| 700 |
<ant antfile="${build.dir}/../deployment/termination/build.xml" |
|---|
| 701 |
target="deploy" inheritRefs="true" /> |
|---|
| 702 |
</sequential> |
|---|
| 703 |
</macrodef> |
|---|
| 704 |
|
|---|
| 705 |
<!-- ================================================================= |
|---|
| 706 |
Standard targets for build files. Two targets (at least) need to be |
|---|
| 707 |
overridden by the importing task |
|---|
| 708 |
|
|---|
| 709 |
init - carry out project specific initialisation |
|---|
| 710 |
build-source - builds the source to creat ejars. |
|---|
| 711 |
=================================================================--> |
|---|
| 712 |
|
|---|
| 713 |
<!-- Override this --> |
|---|
| 714 |
<target name="init" /> |
|---|
| 715 |
|
|---|
| 716 |
<!-- Override this if needed --> |
|---|
| 717 |
<target name="build-init" depends="init"> |
|---|
| 718 |
<resolveDependencies pomFile="pom.xml" /> |
|---|
| 719 |
</target> |
|---|
| 720 |
|
|---|
| 721 |
<!-- Override this --> |
|---|
| 722 |
<target name="build-source" /> |
|---|
| 723 |
|
|---|
| 724 |
<!-- Override this --> |
|---|
| 725 |
<target name="deploy-init" depends="init"> |
|---|
| 726 |
<deployInit ear-name="" /> |
|---|
| 727 |
</target> |
|---|
| 728 |
|
|---|
| 729 |
<!-- This should be called from the deploy target for bundles. --> |
|---|
| 730 |
<macrodef name="deployBundle"> |
|---|
| 731 |
<attribute name="bundle"/> |
|---|
| 732 |
<sequential> |
|---|
| 733 |
<!-- |
|---|
| 734 |
<if> |
|---|
| 735 |
<isset property="org.bedework.global.deploy.bundles" /> |
|---|
| 736 |
<then> |
|---|
| 737 |
<cargo containerId="${org.bedework.global.deploy.platform}" |
|---|
| 738 |
home="${org.bedework.appserver.dir}" |
|---|
| 739 |
action="deploy"> |
|---|
| 740 |
<configuration> |
|---|
| 741 |
<deployable type="bundle" file="@{bundle}"/> |
|---|
| 742 |
</configuration> |
|---|
| 743 |
</cargo> |
|---|
| 744 |
</then> |
|---|
| 745 |
</if> |
|---|
| 746 |
--> |
|---|
| 747 |
</sequential> |
|---|
| 748 |
</macrodef> |
|---|
| 749 |
|
|---|
| 750 |
<!-- Override this --> |
|---|
| 751 |
<target name="deploy" depends="deploy-init,build" /> |
|---|
| 752 |
|
|---|
| 753 |
<!-- ================================================================= |
|---|
| 754 |
Clean out all library files from other projects and all generated |
|---|
| 755 |
files in preparation for a complete rebuild. |
|---|
| 756 |
|
|---|
| 757 |
Needed because switching versions leaves a load of old bedework |
|---|
| 758 |
generated stuff in the libraries. |
|---|
| 759 |
================================================================= --> |
|---|
| 760 |
<target name="deep-clean" depends="clean"> |
|---|
| 761 |
</target> |
|---|
| 762 |
|
|---|
| 763 |
<!-- ================================================================= |
|---|
| 764 |
Clean all generated files |
|---|
| 765 |
================================================================= --> |
|---|
| 766 |
<target name="clean"> |
|---|
| 767 |
<delete dir="${dist.home}" /> |
|---|
| 768 |
<delete dir="${lib.dir}" /> |
|---|
| 769 |
</target> |
|---|
| 770 |
|
|---|
| 771 |
<target name="quickstart-clean" depends="clean" > |
|---|
| 772 |
</target> |
|---|
| 773 |
|
|---|
| 774 |
<!-- ================================================================= |
|---|
| 775 |
Clean and deploy in one go |
|---|
| 776 |
================================================================= --> |
|---|
| 777 |
<target name="clean.deploy" depends="clean,deploy" /> |
|---|
| 778 |
|
|---|
| 779 |
<!-- ================================================================= |
|---|
| 780 |
Clean up after a build. |
|---|
| 781 |
================================================================= --> |
|---|
| 782 |
<target name="cleanup"> |
|---|
| 783 |
<!-- |
|---|
| 784 |
<delete dir="${org.bedework.empty.dir}" /> |
|---|
| 785 |
--> |
|---|
| 786 |
</target> |
|---|
| 787 |
|
|---|
| 788 |
<!-- ========================== Base build Targets =================== |
|---|
| 789 |
Here we have one target building the classes and interfaces that make |
|---|
| 790 |
up the access control suite. |
|---|
| 791 |
================================================================= --> |
|---|
| 792 |
|
|---|
| 793 |
<target name="clean-build" depends="clean,build" |
|---|
| 794 |
description="Clean and compile classes"/> |
|---|
| 795 |
|
|---|
| 796 |
<target name="clean-build-all" depends="clean,build-all" |
|---|
| 797 |
description="Clean and compile classes"/> |
|---|
| 798 |
|
|---|
| 799 |
<target name="build" depends="init,build-source,cleanup" |
|---|
| 800 |
description="Compile classes"/> |
|---|
| 801 |
|
|---|
| 802 |
<target name="build-all" depends="build" |
|---|
| 803 |
description="Compile classes"/> |
|---|
| 804 |
|
|---|
| 805 |
<target name="javadoc" depends="build-init" |
|---|
| 806 |
description="Create Javadoc API documentation"> |
|---|
| 807 |
<jdoc/> |
|---|
| 808 |
</target> |
|---|
| 809 |
|
|---|
| 810 |
<macrodef name="build-jar-stats"> |
|---|
| 811 |
<sequential> |
|---|
| 812 |
<if> |
|---|
| 813 |
<not> |
|---|
| 814 |
<isset property="org.bedework.jars.built" /> |
|---|
| 815 |
</not> |
|---|
| 816 |
<then> |
|---|
| 817 |
<echo message="No jars were checked or built" /> |
|---|
| 818 |
</then> |
|---|
| 819 |
<else> |
|---|
| 820 |
<echo message="${org.bedework.jars.checked} jars checked: ${org.bedework.jars.built} built" /> |
|---|
| 821 |
</else> |
|---|
| 822 |
</if> |
|---|
| 823 |
</sequential> |
|---|
| 824 |
</macrodef> |
|---|
| 825 |
|
|---|
| 826 |
<!-- This macro builds a single jar file. It just sets defaults for the java |
|---|
| 827 |
compiler then invokes it. |
|---|
| 828 |
|
|---|
| 829 |
This is the only place we compile files. |
|---|
| 830 |
|
|---|
| 831 |
On entry we require: |
|---|
| 832 |
jar.file Fully specified name of destination jar file. |
|---|
| 833 |
base.java.sources Defines the java source files |
|---|
| 834 |
base.class.patternset Defines the java class files |
|---|
| 835 |
base.resource.files Defines extra resources to go in the jar |
|---|
| 836 |
|
|---|
| 837 |
We will copy all files defined by base.java.patternset to a temporary |
|---|
| 838 |
location and compile out of that into a temporary classes location. |
|---|
| 839 |
|
|---|
| 840 |
We do that to avoid a problematic feature of the java compilers, the |
|---|
| 841 |
tendency to recompile any referenced sources found on the source path. |
|---|
| 842 |
|
|---|
| 843 |
So, if we have all our sources under the directory "src" and compile a |
|---|
| 844 |
single package in that tree, all referenced classes will be compiled, |
|---|
| 845 |
even if they exist in a jar file on the class path. |
|---|
| 846 |
|
|---|
| 847 |
The other side-effect is that we might compile and include classes we |
|---|
| 848 |
didn't realise we were compiling. |
|---|
| 849 |
|
|---|
| 850 |
The downside is that we need to be very specific about the classes we |
|---|
| 851 |
compile for a package and we might need to put classes in |
|---|
| 852 |
base.java.sources which we don't want in the final jar file. |
|---|
| 853 |
|
|---|
| 854 |
On exit we will have created classes in the directory |
|---|
| 855 |
${jar.temp.classes} |
|---|
| 856 |
and a jar file |
|---|
| 857 |
${build.jar.file} |
|---|
| 858 |
|
|---|
| 859 |
Authors: Mike Douglass douglm rpi.edu |
|---|
| 860 |
--> |
|---|
| 861 |
<macrodef name="build-jar"> |
|---|
| 862 |
<attribute name="module-base"/> |
|---|
| 863 |
<attribute name="jar-file"/> |
|---|
| 864 |
<attribute name="jar-dependency" default=""/> |
|---|
| 865 |
<attribute name="generated-sources" default=""/> |
|---|
| 866 |
<attribute name="property-resources" default=""/> |
|---|
| 867 |
<attribute name="bundle-xml" default=""/> <!-- bundle --> |
|---|
| 868 |
<attribute name="jar-name" default=""/> <!-- bundle --> |
|---|
| 869 |
<attribute name="jar-version" default=""/> <!-- bundle --> |
|---|
| 870 |
|
|---|
| 871 |
<sequential> |
|---|
| 872 |
<if> |
|---|
| 873 |
<not> |
|---|
| 874 |
<isset property="org.bedework.jars.built" /> |
|---|
| 875 |
</not> |
|---|
| 876 |
<then> |
|---|
| 877 |
<var name="org.bedework.jars.built" value="0" /> |
|---|
| 878 |
<var name="org.bedework.jars.checked" value="0" /> |
|---|
| 879 |
</then> |
|---|
| 880 |
</if> |
|---|
| 881 |
|
|---|
| 882 |
<math result="org.bedework.jars.checked" |
|---|
| 883 |
operand1="${org.bedework.jars.checked}" |
|---|
| 884 |
operation="+" operand2="1" datatype="int"/> |
|---|
| 885 |
|
|---|
| 886 |
<if> |
|---|
| 887 |
<equals arg1="@{generated-sources}" arg2="" /> |
|---|
| 888 |
<then> |
|---|
| 889 |
<fileset id="buildjar.generated.java.sources" refid="empty.fileset" /> |
|---|
| 890 |
</then> |
|---|
| 891 |
<else> |
|---|
| 892 |
<fileset id="buildjar.generated.java.sources" dir="@{generated-sources}" > |
|---|
| 893 |
<include name="org/bedework/**/*.java"/> |
|---|
| 894 |
</fileset> |
|---|
| 895 |
</else> |
|---|
| 896 |
</if> |
|---|
| 897 |
|
|---|
| 898 |
<if> |
|---|
| 899 |
<equals arg1="@{property-resources}" arg2="" /> |
|---|
| 900 |
<then> |
|---|
| 901 |
<fileset id="buildjar.resource.files" refid="empty.fileset" /> |
|---|
| 902 |
</then> |
|---|
| 903 |
<else> |
|---|
| 904 |
<fileset id="buildjar.resource.files" dir="@{property-resources}" > |
|---|
| 905 |
<include name="**/*.properties"/> |
|---|
| 906 |
</fileset> |
|---|
| 907 |
</else> |
|---|
| 908 |
</if> |
|---|
| 909 |
|
|---|
| 910 |
<fileset id="buildjar.java.sources" dir="@{module-base}/src" > |
|---|
| 911 |
<include name="**/*.java"/> |
|---|
| 912 |
</fileset> |
|---|
| 913 |
|
|---|
| 914 |
<patternset id="base.class.patternset"> |
|---|
| 915 |
<include name="**/*.class"/> |
|---|
| 916 |
</patternset> |
|---|
| 917 |
|
|---|
| 918 |
<if> |
|---|
| 919 |
<not> |
|---|
| 920 |
<equals arg1="@{jar-dependency}" arg2="" /> |
|---|
| 921 |
</not> |
|---|
| 922 |
<then> |
|---|
| 923 |
<var name="build.jar.dependency" value="@{jar-dependency}" /> |
|---|
| 924 |
</then> |
|---|
| 925 |
</if> |
|---|
| 926 |
|
|---|
| 927 |
<!-- =================== Compilation Control Options =============== |
|---|
| 928 |
These properties control option settings on the Javac compiler when it |
|---|
| 929 |
is invoked using the <javac> task. |
|---|
| 930 |
|
|---|
| 931 |
compile.debug Should compilation include the debug option? |
|---|
| 932 |
compile.deprecation Should compilation include the deprecation option? |
|---|
| 933 |
compile.optimize Should compilation include the optimize option? |
|---|
| 934 |
|
|---|
| 935 |
Below are the defaults. They may already be set in the build properties. |
|---|
| 936 |
--> |
|---|
| 937 |
|
|---|
| 938 |
<property name="compile.debug" value="true"/> |
|---|
| 939 |
<property name="compile.deprecation" value="false"/> |
|---|
| 940 |
<property name="compile.optimize" value="true"/> |
|---|
| 941 |
<property name="compile.verbose" value="false"/> |
|---|
| 942 |
<property name="compile.listfiles" value="false"/> |
|---|
| 943 |
|
|---|
| 944 |
<var name="jar.temp.sources" |
|---|
| 945 |
value="${dist.home}/source" /> |
|---|
| 946 |
<var name="jar.temp.classes" |
|---|
| 947 |
value="${dist.home}/classes" /> |
|---|
| 948 |
|
|---|
| 949 |
<!-- ============================================================== |
|---|
| 950 |
See if the jar is up to date. We recompile if any of the |
|---|
| 951 |
source files or metainf files are newer. We also recompile if |
|---|
| 952 |
any jars on the package classpath are newer. |
|---|
| 953 |
============================================================== --> |
|---|
| 954 |
|
|---|
| 955 |
<noisyMsg message="build.jar.file=@{jar-file}" /> |
|---|
| 956 |
|
|---|
| 957 |
<if> |
|---|
| 958 |
<isset property="build.jar.dependency"/> |
|---|
| 959 |
<then> |
|---|
| 960 |
<dirname file="${build.jar.dependency}" |
|---|
| 961 |
property="dependency.dirname" /> |
|---|
| 962 |
<basename file="${build.jar.dependency}" |
|---|
| 963 |
property="dependency.basename" /> |
|---|
| 964 |
<fileset dir="${dependency.dirname}" id="dependency.fileset"> |
|---|
| 965 |
<include name="${dependency.basename}"/> |
|---|
| 966 |
</fileset> |
|---|
| 967 |
</then> |
|---|
| 968 |
<else> |
|---|
| 969 |
<fileset refid="empty.fileset" id="dependency.fileset"/> |
|---|
| 970 |
</else> |
|---|
| 971 |
</if> |
|---|
| 972 |
|
|---|
| 973 |
<!-- See if the libraries are later than any classes --> |
|---|
| 974 |
|
|---|
| 975 |
<var name="org.bedework.libraries.changed" value="false" /> |
|---|
| 976 |
|
|---|
| 977 |
<outofdate outputsources="org.bedework,changed.sources"> |
|---|
| 978 |
<sourcefiles> |
|---|
| 979 |
<fileset dir="${lib.dir}"> |
|---|
| 980 |
<include name="*.jar"/> |
|---|
| 981 |
</fileset> |
|---|
| 982 |
<!-- This makes almost everything rebuild all the time |
|---|
| 983 |
because it has the generated jars for the current package |
|---|
| 984 |
<path refid="compile.classpath"/> |
|---|
| 985 |
--> |
|---|
| 986 |
</sourcefiles> |
|---|
| 987 |
<targetfiles> |
|---|
| 988 |
<pathelement path="@{jar-file}"/> |
|---|
| 989 |
</targetfiles> |
|---|
| 990 |
<sequential> |
|---|
| 991 |
<var name="org.bedework.libraries.changed" value="true" /> |
|---|
| 992 |
<noisyMsg message="**** @{jar-file} needs rebuilding - libraries changed" /> |
|---|
| 993 |
</sequential> |
|---|
| 994 |
</outofdate> |
|---|
| 995 |
|
|---|
| 996 |
<noisyMsg message="**** org.bedework,changed.sources = ${org.bedework,changed.sources}" /> |
|---|
| 997 |
<noisyMsg message="**** org.bedework.libraries.changed = ${org.bedework.libraries.changed}" /> |
|---|
| 998 |
|
|---|
| 999 |
<if> |
|---|
| 1000 |
<and> |
|---|
| 1001 |
<not> |
|---|
| 1002 |
<equals arg1="${org.bedework.libraries.changed}" arg2="true" /> |
|---|
| 1003 |
</not> |
|---|
| 1004 |
<uptodate targetfile="@{jar-file}" > |
|---|
| 1005 |
<srcfiles refid="buildjar.java.sources" /> |
|---|
| 1006 |
<srcfiles refid="buildjar.generated.java.sources" /> |
|---|
| 1007 |
<srcfiles refid="buildjar.resource.files"/> |
|---|
| 1008 |
<srcfiles refid="dependency.fileset"/> |
|---|
| 1009 |
</uptodate> |
|---|
| 1010 |
</and> |
|---|
| 1011 |
<then> |
|---|
| 1012 |
<noisyMsg message="**** @{jar-file} is up to date" /> |
|---|
| 1013 |
</then> |
|---|
| 1014 |
<else> |
|---|
| 1015 |
<noisyMsg message="**** @{jar-file} needs rebuilding" /> |
|---|
| 1016 |
|
|---|
| 1017 |
<math result="org.bedework.jars.built" |
|---|
| 1018 |
operand1="${org.bedework.jars.built}" |
|---|
| 1019 |
operation="+" operand2="1" datatype="int"/> |
|---|
| 1020 |
|
|---|
| 1021 |
<!-- Delete jar file --> |
|---|
| 1022 |
<delete file="@{jar-file}"/> |
|---|
| 1023 |
|
|---|
| 1024 |
<dirname property="build.jar.dir" file="@{jar-file}"/> |
|---|
| 1025 |
|
|---|
| 1026 |
<mkdir dir="${build.jar.dir}" /> |
|---|
| 1027 |
|
|---|
| 1028 |
<!-- ========================================================== |
|---|
| 1029 |
Build the classes |
|---|
| 1030 |
========================================================== --> |
|---|
| 1031 |
|
|---|
| 1032 |
<!-- First copy the sources we are going to compile into a temp |
|---|
| 1033 |
directory. --> |
|---|
| 1034 |
<delete dir="${jar.temp.sources}" /> |
|---|
| 1035 |
<mkdir dir="${jar.temp.sources}" /> |
|---|
| 1036 |
|
|---|
| 1037 |
<copy toDir="${jar.temp.sources}"> |
|---|
| 1038 |
<fileset refid="buildjar.java.sources" /> |
|---|
| 1039 |
<fileset refid="buildjar.generated.java.sources" /> |
|---|
| 1040 |
<fileset refid="buildjar.resource.files"/> |
|---|
| 1041 |
</copy> |
|---|
| 1042 |
|
|---|
| 1043 |
<mkdir dir="${jar.temp.classes}"/> |
|---|
| 1044 |
|
|---|
| 1045 |
<debugMsg message="About to build jar @{jar-file}"/> |
|---|
| 1046 |
<debugCpid idpar="compile.classpath" /> |
|---|
| 1047 |
|
|---|
| 1048 |
<javac srcdir="${jar.temp.sources}" |
|---|
| 1049 |
destdir="${jar.temp.classes}" |
|---|
| 1050 |
debug="${compile.debug}" |
|---|
| 1051 |
verbose="${compile.verbose}" |
|---|
| 1052 |
listfiles="${compile.listfiles}" |
|---|
| 1053 |
deprecation="${compile.deprecation}" |
|---|
| 1054 |
optimize="${compile.optimize}"> |
|---|
| 1055 |
<classpath refid="compile.classpath"/> |
|---|
| 1056 |
<include name="**/*.java"/> |
|---|
| 1057 |
<compilerarg value="-nowarn" compiler="jikes" /> |
|---|
| 1058 |
</javac> |
|---|
| 1059 |
|
|---|
| 1060 |
<!-- ========================================================== |
|---|
| 1061 |
Build jar file |
|---|
| 1062 |
========================================================== --> |
|---|
| 1063 |
|
|---|
| 1064 |
<if> |
|---|
| 1065 |
<equals arg1="@{bundle-xml}" arg2="" /> |
|---|
| 1066 |
<then> |
|---|
| 1067 |
<!-- Not a bundle --> |
|---|
| 1068 |
<jar jarfile="@{jar-file}"> |
|---|
| 1069 |
<fileset dir="${jar.temp.classes}"> |
|---|
| 1070 |
<patternset refid="base.class.patternset"/> |
|---|
| 1071 |
</fileset> |
|---|
| 1072 |
<fileset refid="buildjar.resource.files"/> |
|---|
| 1073 |
</jar> |
|---|
| 1074 |
</then> |
|---|
| 1075 |
<else> |
|---|
| 1076 |
<!-- Build manifest from bundle descriptor and add additional entries --> |
|---|
| 1077 |
<bundle-manifest file="${jar.temp.classes}/META-INF/MANIFEST.MF" |
|---|
| 1078 |
classes="${jar.temp.classes}" |
|---|
| 1079 |
descriptor="@{bundle-xml}"> |
|---|
| 1080 |
<attribute name="Bundle-Version" value="@{jar-version}"/> |
|---|
| 1081 |
<attribute name="Bundle-Vendor" value="Bedework"/> |
|---|
| 1082 |
<attribute name="Bundle-DocURL" value="bedework.org"/> |
|---|
| 1083 |
<attribute name="Implementation-Title" |
|---|
| 1084 |
value="@{jar-name} (${project.name})"/> |
|---|
| 1085 |
<attribute name="Implementation-Version" value="@{jar-version}"/> |
|---|
| 1086 |
<attribute name="Implementation-Vendor" |
|---|
| 1087 |
value="bedework"/> |
|---|
| 1088 |
<attribute name="Implementation-URL" |
|---|
| 1089 |
value="bedework.org"/> |
|---|
| 1090 |
</bundle-manifest> |
|---|
| 1091 |
|
|---|
| 1092 |
<!-- Now build the actual bundle. --> |
|---|
| 1093 |
<jar jarfile="@{jar-file}" |
|---|
| 1094 |
filesetmanifest="merge" manifestencoding="UTF-8"> |
|---|
| 1095 |
<fileset dir="${jar.temp.classes}"/> |
|---|
| 1096 |
<!-- |
|---|
| 1097 |
<metainf dir="${project.home}" includes="LICENSE.txt,NOTICE.txt"/> |
|---|
| 1098 |
--> |
|---|
| 1099 |
<metainf dir="${project.home}" includes="LICENSE.txt"/> |
|---|
| 1100 |
</jar> |
|---|
| 1101 |
</else> |
|---|
| 1102 |
</if> |
|---|
| 1103 |
|
|---|
| 1104 |
<!-- ========================================================== |
|---|
| 1105 |
Clean up |
|---|
| 1106 |
========================================================== --> |
|---|
| 1107 |
|
|---|
| 1108 |
<delete dir="${jar.temp.sources}" /> |
|---|
| 1109 |
<delete dir="${jar.temp.classes}"/> |
|---|
| 1110 |
</else> |
|---|
| 1111 |
</if> |
|---|
| 1112 |
</sequential> |
|---|
| 1113 |
</macrodef> |
|---|
| 1114 |
|
|---|
| 1115 |
<macrodef name="infoMsg"> |
|---|
| 1116 |
<attribute name="message"/> |
|---|
| 1117 |
<sequential> |
|---|
| 1118 |
<if> |
|---|
| 1119 |
<not> |
|---|
| 1120 |
<istrue value="${org.bedework.build.silent}" /> |
|---|
| 1121 |
</not> |
|---|
| 1122 |
<then> |
|---|
| 1123 |
<echo message="@{message}" /> |
|---|
| 1124 |
</then> |
|---|
| 1125 |
</if> |
|---|
| 1126 |
</sequential> |
|---|
| 1127 |
</macrodef> |
|---|
| 1128 |
|
|---|
| 1129 |
<macrodef name="noisyMsg"> |
|---|
| 1130 |
<attribute name="message"/> |
|---|
| 1131 |
<sequential> |
|---|
| 1132 |
<if> |
|---|
| 1133 |
<istrue value="${org.bedework.build.noisy}" /> |
|---|
| 1134 |
<then> |
|---|
| 1135 |
<echo message="@{message}" /> |
|---|
| 1136 |
</then> |
|---|
| 1137 |
</if> |
|---|
| 1138 |
</sequential> |
|---|
| 1139 |
</macrodef> |
|---|
| 1140 |
|
|---|
| 1141 |
<macrodef name="configMsg"> |
|---|
| 1142 |
<attribute name="message"/> |
|---|
| 1143 |
<sequential> |
|---|
| 1144 |
<if> |
|---|
| 1145 |
<istrue value="${org.bedework.build.showconfigs}" /> |
|---|
| 1146 |
<then> |
|---|
| 1147 |
<echo message="@{message}" /> |
|---|
| 1148 |
</then> |
|---|
| 1149 |
</if> |
|---|
| 1150 |
</sequential> |
|---|
| 1151 |
</macrodef> |
|---|
| 1152 |
|
|---|
| 1153 |
<macrodef name="debugMsg"> |
|---|
| 1154 |
<attribute name="message"/> |
|---|
| 1155 |
<sequential> |
|---|
| 1156 |
<if> |
|---|
| 1157 |
<istrue value="${org.bedework.build.debug}" /> |
|---|
| 1158 |
<then> |
|---|
| 1159 |
<echo message="@{message}" /> |
|---|
| 1160 |
</then> |
|---|
| 1161 |
</if> |
|---|
| 1162 |
</sequential> |
|---|
| 1163 |
</macrodef> |
|---|
| 1164 |
|
|---|
| 1165 |
<macrodef name="debugCpid"> |
|---|
| 1166 |
<attribute name="idpar"/> |
|---|
| 1167 |
<sequential> |
|---|
| 1168 |
<if> |
|---|
| 1169 |
<istrue value="${org.bedework.build.debug}" /> |
|---|
| 1170 |
<then> |
|---|
| 1171 |
<property name="cp" refid="@{idpar}" /> |
|---|
| 1172 |
<echo message="***************cp: ${cp}"/> |
|---|
| 1173 |
</then> |
|---|
| 1174 |
</if> |
|---|
| 1175 |
</sequential> |
|---|
| 1176 |
</macrodef> |
|---|
| 1177 |
</project> |
|---|