Browse Source

Initial versions of a build script that will create nightly distribution

files of Ant (and optionally install them on the Jakarta web server) that
include the JAXP reference implementation JAR files ("jaxp.jar" and
"parser.jar") that are redistributable.

Prerequisites for the successful execution of this script are listed in
the comments.  Because the script is intended to run from a "cron" job on
the Jakarta server, no Windows version is provided.


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@267662 13f79535-47bb-0310-9956-ffa450edef68
master
Craig R. McClanahan 25 years ago
parent
commit
1aa72f21ba
2 changed files with 117 additions and 0 deletions
  1. +33
    -0
      buildAnt
  2. +84
    -0
      buildAnt.xml

+ 33
- 0
buildAnt View File

@@ -0,0 +1,33 @@
#!/bin/bash
# -----------------------------------------------------------------------------
# buildAnt -- Build Nightly Distribution Files for ANT
#
# Goals:
# - Create nightly distribution files of Ant, including the JAXP reference
# implementation JAR files (so no extra downloads are needed), in the usual
# formats
# - Optionally, install these distribution files on the Jakarta web server
#
# Prerequisites:
# - The user under which this script runs must have done a CVS "login"
# for anonymous access to the Jakarta repositories
# - Java Development Kit, version 1.2.2, installed and configured
# (avoids compiler problems in 1.1 and 1.3 related to XML classes)
# - Ant 3.1 binary distribution installed
# - ANT_HOME points at this distribution directory (you can set it
# in ~/.antrc)
# - The "ant" script in $ANT_HOME/bin is accessible on your PATH
# - Java API for XML Parsing (JAXP) 1.0 reference implementation installed
# - JAXP_HOME points at this distribution directory (you can set it
# in ~/.antrc)
# - The "buildAnt.xml" script (from the Ant source repository) is
# in the same directory that this script is.
# - To execute the "install" target, you must be running on the Jakarta
# server, as part of group "jakarta".
#
# Author: Craig R. McClanahan
# Version: $Revision$ $Date$
# -----------------------------------------------------------------------------

. ~/.antrc
ant -buildfile buildAnt.xml -Djaxp.home=$JAXP_HOME "$@"

+ 84
- 0
buildAnt.xml View File

@@ -0,0 +1,84 @@
<project name="Ant Nightly Distribution" default="all" basedir=".">

<!-- Build Management Properties

buildAnt.archive Distribution directory to be archived
buildAnt.cvsRoot CVS login root for Ant
buildAnt.dateStamp YYYYMMDD date stamp (from executing script)
buildAnt.dist Distribution directory produced by "build" target
buildAnt.name Base name of packaged distribution files
buildAnt.package CVS package name for Ant
buildAnt.server Jakarta server's nightly builds directory
buildAnt.source Directory into which Ant sources are extracted
buildAnt.uploads Directory into which archives to upload are made
jaxp.home Home directory of the JAXP distribution

-->

<property name="buildAnt.archive" value="archive/jakarta-ant"/>
<property name="buildAnt.cvsRoot" value=":pserver:anoncvs@jakarta.apache.org:/home/cvspublic"/>
<property name="buildAnt.dist" value="dist/ant"/>
<property name="buildAnt.name" value="jakarta-ant"/>
<property name="buildAnt.package" value="jakarta-ant"/>
<property name="buildAnt.server" value="/www/jakarta.apache.org/builds/ant/nightly"/>
<property name="buildAnt.source" value="jakarta-ant"/>
<property name="buildAnt.uploads" value="uploads/ant"/>

<!-- Extract the most recent sources from the CVS repository -->
<target name="extract">
<deltree dir="${buildAnt.source}"/>
<cvs cvsRoot="${buildAnt.cvsRoot}" package="${buildAnt.package}"
dest="${buildAnt.source}"/>
</target>

<!-- Build the distribution according to its instructions -->
<target name="build">
<ant dir="${buildAnt.source}" target="clean"/>
<ant dir="${buildAnt.source}" target="dist"/>
</target>

<!-- Insert add-ons as required for the nightly distribution -->
<target name="addons">
<echo message="Copying addons from '${jaxp.home}' to '${buildAnt.dist}/lib'"/>
<copyfile src="${jaxp.home}/jaxp.jar"
dest="${buildAnt.dist}/lib/jaxp.jar"/>
<copyfile src="${jaxp.home}/parser.jar"
dest="${buildAnt.dist}/lib/parser.jar"/>
</target>

<!-- Package up the distribution in various formats -->
<target name="package">
<!-- Recreate the archive directory -->
<deltree dir="${buildAnt.archive}"/>
<mkdir dir="${buildAnt.archive}"/>
<copydir src="${buildAnt.dist}" dest="${buildAnt.archive}"/>
<!-- Recreate the uploads directory -->
<deltree dir="${buildAnt.uploads}"/>
<mkdir dir="${buildAnt.uploads}"/>
<!-- Create the uploadable files in various formats -->
<tstamp/>
<tar tarfile="${buildAnt.uploads}/${buildAnt.name}-${DSTAMP}.tar"
basedir="${buildAnt.archive}/.."/>
<gzip src="${buildAnt.uploads}/${buildAnt.name}-${DSTAMP}.tar"
zipfile="${buildAnt.uploads}/${buildAnt.name}-${DSTAMP}.tar.gz"/>
<exec dir="${buildAnt.uploads}"
command="compress ${buildAnt.name}-${DSTAMP}.tar"/>
<zip zipfile="${buildAnt.uploads}/${buildAnt.name}-${DSTAMP}.zip"
basedir="${buildAnt.archive}/.."/>
</target>

<!-- Install the distributable files to the Jakarta server -->
<!-- Obviously, this will only work right on the real server!!! -->
<target name="install">
<copydir src="${buildAnt.uploads}" dest="${buildAnt.server}"
includes="${buildAnt.name}-${DSTAMP}.*"/>
<chmod src="${buildAnt.server}/${buildAnt.name}-${DSTAMP}.*"
perm="g+w"/>
<chmod src="${buildAnt.server}/${buildAnt.name}-${DSTAMP}.*"
perm="o+r"/>
</target>

<!-- All-in-one target (except for install) -->
<target name="all" depends="extract,build,addons,package"/>

</project>

Loading…
Cancel
Save