You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by cr...@locus.apache.org on 2000/04/27 22:26:10 UTC

cvs commit: jakarta-ant buildAnt buildAnt.xml

craigmcc    00/04/27 13:26:10

  Added:       .        buildAnt buildAnt.xml
  Log:
  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.
  
  Revision  Changes    Path
  1.1                  jakarta-ant/buildAnt
  
  Index: buildAnt
  ===================================================================
  #!/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: 1.1 $ $Date: 2000/04/27 20:26:10 $
  # -----------------------------------------------------------------------------
  
  . ~/.antrc
  ant -buildfile buildAnt.xml -Djaxp.home=$JAXP_HOME "$@"
  
  
  
  1.1                  jakarta-ant/buildAnt.xml
  
  Index: buildAnt.xml
  ===================================================================
  <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>