1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412
|
<!-- $Id: build.xml 235 2005-06-13 14:26:47Z blindsey $ -->
<project name="federator" default="help" basedir=".">
<!--
|ANT Build targets for compiling sources, generating
|documentation and packaging a distribution
+-->
<!--
| the top of the build directory structure
+-->
<property name="top" value="${basedir}" />
<!-- deprecate: use ${ENV.var} to access environment variables -->
<property environment="ENV"/>
<!--
| location of distributions of third party packages we need for compiling,
| installing, or running
+-->
<property name="third-party" value="${top}/thirdparty" />
<!--
|
+-->
<property name="test-dir" value="${top}/testsuite" />
<!--
| local, machine-specific configuration properties
+-->
<property file="local.properties" />
<!--
| the root of source files to be compiled
+-->
<property name="src" value="${top}/src" />
<!--
| location for placing distribution images
+-->
<property name="dist" value="${top}/dist" />
<property name="Name" value="Palomar" />
<!--
| target location for the source distribution image
+-->
<property name="src-dist-name" value="xt-${version}" />
<property name="src-dist-dir" value="${dist}/${src-dist-name}" />
<!--
| target location for the binary distribution image
+-->
<property name="bin-dist-name" value="xt-${version}" />
<property name="bin-dist-dir" value="${dist}/${bin-dist-name}" />
<!--
| location for compiling classes into
+-->
<property name="stage" value="${top}/stage" />
<!--
| the location for compiling documentation into
+-->
<property name="docs" value="${top}/docs" />
<!--
|third party jar files get copied to here for compiling phase, then
| get copied from here into the distribution image
+-->
<property name="lib" value="${top}/lib" />
<!--
| sources for default configuration files which get
| shipped in a distribution
+-->
<property name="config" value="${src}/config" />
<!-- ANT resources -->
<property name="buildlib" value="./ant/lib" />
<!-- <property file="ant/build.ant.properties"/> -->
<!--
| define which jar files are shipped with a distribution
+-->
<fileset id="distJars"
dir="${lib}"
includes="*.jar">
</fileset>
<!--
| define which jar files are available during compilation
+-->
<path id="compileJars" >
<fileset dir="${lib}"
includes="*.jar" >
</fileset>
</path>
<!--
| source location of core palomar java files
+-->
<property name="echoJsrc" value="${top}/src/echo/java" />
<!--
| source location of xt java files
+-->
<property name="xtJsrc" value="${top}/src/xt/java" />
<!--
| source location of documentation files
+-->
<property name="docsrc" value="${top}/src/docs" />
<!--
| target location for compiling javadoc into
+-->
<property name="javadocDir" value="${docs}/api"/>
<!-- default target -->
<target name="help">
<echo message="You must specify an Ant target. " />
</target>
<!-- full distribution -->
<target name="all" depends="init, src-dist, bin-dist">
</target>
<!-- source distribution -->
<target name="src-dist"
depends="init, unzip, compile, docs, bin-dist">
<copy todir="${src-dist-dir}" file="${top}/README.txt" />
<copy todir="${src-dist-dir}" file="${top}/index.html" />
<copy todir="${src-dist-dir}" file="${top}/copying.txt" />
<copy todir="${src-dist-dir}" file="${top}/copyingjc.txt" />
<copy todir="${src-dist-dir}" file="${top}/build.xml" />
<copy todir="${src-dist-dir}" file="${top}/local.properties" />
<copy todir="${src-dist-dir}" file="${top}/build.sh" />
<copy todir="${src-dist-dir}" file="${top}/build.bat" />
<copy todir="${src-dist-dir}/docs">
<fileset dir="${docs}" />
</copy>
<copy todir="${src-dist-dir}/src">
<fileset dir="${src}" />
</copy>
<copy todir="${src-dist-dir}/thirdparty">
<fileset dir="${third-party}" includes="build.xml, **/*.zip, servlet/*"/>
</copy>
<zip destfile="${dist}/${src-dist-name}-src.zip"
basedir="${dist}"
includes="${src-dist-name}/**/*.*">
</zip>
</target>
<!-- binary distribution -->
<target name="bin-dist"
depends="init, unzip, compile, docs">
<copy todir="${bin-dist-dir}" file="${top}/README.txt" />
<copy todir="${bin-dist-dir}" file="${top}/build.xml" />
<copy todir="${bin-dist-dir}" file="${top}/local.properties" />
<copy todir="${bin-dist-dir}" file="${top}/build.sh" />
<copy todir="${bin-dist-dir}" file="${top}/build.bat" />
<copy todir="${bin-dist-dir}/docs">
<fileset dir="${docs}" />
</copy>
<!--
<echo message="copying ${stage}/docs/out"/>
<copy todir="${bin-dist-dir}/docs">
<fileset dir="${stage}/docs/out" />
</copy>
-->
<copy todir="${bin-dist-dir}/lib">
<fileset dir="${lib}" />
</copy>
<zip destfile="${dist}/${bin-dist-name}-bin.zip"
basedir="${dist}"
includes="${bin-dist-name}/**/*.*">
</zip>
</target>
<!--
| regression tests
+-->
<target name="testsuite">
<ant dir="${test-dir}" target="all">
</ant>
</target>
<!-- display ant environment -->
<target name="env">
<echo message="os.name: ${os.name}"/>
<echo message="JAVA_HOME: ${ENV.JAVA_HOME}" />
<echo message="user.home: ${user.home}" />
<echo message="user.dir: ${user.dir}" />
<echo message="top: ${top}" />
<echo message="dist: ${dist}" />
<echo message="ANT_HOME: ${ENV.ANT_HOME}" />
</target>
<!--
| initializes state of the build, sets some properties
| to indicate which of our targets are up to date
+-->
<target name="init">
<!-- need to make javadoc? -->
<uptodate property="javadocUptodate"
targetFile="${javadocDir}/index.html">
<srcfiles dir="${xtJsrc}/org/xmlecho/palomar"
includes="**/*.java" />
</uptodate>
<!-- any new zip files in the third-party area needing extracting -->
<uptodate property="unzip.done" targetfile="${third-party}/unzipped">
<srcfiles dir="${third-party}">
<include name="**/*.zip" />
</srcfiles>
</uptodate>
<!-- for debugging this build script -->
<echo message="top: ${top}" />
<echo message="dist: ${dist}" />
<echo message="javadocUptodate: ${javadocUptodate}" />
<echo message="unzip.done: ${unzip.done}" />
</target>
<!--
| unzip third party packages we need for compiling,
| instaling or running
+-->
<target name="unzip" depends="init"
unless="unzip.done" >
<ant dir="${third-party}" target="unzipall">
<property name="lib" value="${lib}" />
</ant>
</target>
<!--
| Clean out the staging and distribution directory
+-->
<target name="clean">
<delete dir="${stage}" />
<delete dir="${dist}" />
<delete dir="${docs}" />
<delete>
<fileset dir="${lib}" includes="*.jar"/>
</delete>
<delete file="${third-party}/unzipped" />
<ant dir="${src}/docs" target="clean" />
</target>
<!--
| Clean out everything but sources
+-->
<target name="really-clean" depends="clean">
<delete dir="${lib}" />
<delete dir="${docs}" />
</target>
<!--
| compiles the Java classes and builds xt.jar
+-->
<target name="compile"
unless="echoJarUptodate"
depends="_check, init">
<echo message="compiling and jarring" />
<mkdir dir="${stage}/xt" />
<!-- compile java code -->
<javac debug="on"
srcdir="${xtJsrc}"
destdir="${stage}/xt" >
<classpath refid="compileJars" />
</javac>
<!-- bundle up any local properties files -->
<copy todir="${stage}/xt" >
<fileset dir="${xtJsrc}" includes='**/*.properties, *.properties, *.xml, **/*.xml' />
</copy>
<!-- jar it up -->
<jar jarfile="${stage}/xt${version}.jar"
basedir="${stage}/xt"
includes="**/*" />
<copy todir="${lib}" file="${stage}/xt${version}.jar"/>
</target>
<!--
| compiles documentation
+-->
<target name="docs" depends="init, unzip, javadoc" >
<ant dir="${docsrc}" target="alldocs"/>
</target>
<!--
| Builds the developer's API javadocs
+-->
<target name="javadoc"
unless="javadocUptodate"
depends="init, unzip" >
<!-- if packageNames not sent in from caller then default to below -->
<property name="packageNames" value="
com.jclark.xsl.sax2,
com.jclark.xsl.sax,
com.jclark.xsl.conv,
com.jclark.xsl.dom,
com.jclark.xsl.om,
com.jclark.xsl.util,
com.jclark.xsl.expr,
com.jclark.xsl.tr" />
<mkdir dir="${javadocDir}" />
<javadoc destdir="${javadocDir}"
packagenames="${packageNames}"
windowtitle="${Name} ${version} API"
doctitle="${Name} ${version} API"
overview="${xtJsrc}/overview.html">
<classpath refid="compileJars" />
<sourcepath>
<pathelement path="${xtJsrc}" />
</sourcepath>
</javadoc>
</target>
<!--
| assembles the ant components into our distribution
| for installing ECHO using ANT.
+-->
<target name="dist_ant" depends="init" >
<mkdir dir="${dist}/ant" />
<!-- overridable properties for installing and running
from the distribution image -->
<copy file="${src}/scripts/install-time/local.properties"
tofile="${dist}/local.properties"
filtering="true"/>
<copy file="${top}/build.sh" tofile="${dist}/install.sh" />
<copy file="${top}/build.bat" tofile="${dist}/install.bat" />
<!-- "all" the jar files any installation needs for running ANT -->
<mkdir dir="${dist}/ant/lib" />
<copy todir="${dist}/ant/lib" >
<fileset dir="${top}/ant/lib"/>
</copy>
</target>
<!--
|ensures that local build properties are defined
+-->
<target name="_check">
<available file="local.properties" property="local.properties.present"/>
<fail message="Cannot find local.properties in the current directory!"
unless="local.properties.present"/>
</target>
<!--
| runs XSLT engine, XT, against the given source and stylesheet
+ -->
<target name="xt" depends="compile">
<java classname="com.jclark.xsl.sax.Driver" fork="yes">
<arg value="${src}"/>
<arg value="${stylesheet}"/>
<arg value="${dest}" />
<classpath>
<pathelement path="${lib}/xt${version}.jar" />
<pathelement path="${lib}/xp.jar" />
<pathelement path="${lib}/xml-apis.jar" />
</classpath>
</java>
</target>
</project>
|