You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oro-dev@jakarta.apache.org by df...@apache.org on 2001/05/16 10:53:36 UTC

cvs commit: jakarta-oro/build build.bat build.sh build.xml build-oro.bat build-oro.sh build-oro.xml

dfs         01/05/16 01:53:35

  Added:       build    build.bat build.sh build.xml
  Removed:     build    build-oro.bat build-oro.sh build-oro.xml
  Log:
  Renamed build-oro.xml to build.xml.  Renamed build-oro scripts to build.sh
  and build.bat, but they may go away in the future depending on the
  direction of Jakarta project conventions.
  
  Revision  Changes    Path
  1.1                  jakarta-oro/build/build.bat
  
  Index: build.bat
  ===================================================================
  @echo off
  
  REM $Id: build.bat,v 1.1 2001/05/16 08:53:33 dfs Exp $
  REM --------------------------------------------
  REM Default == jar
  REM "lib"            target builds the library
  REM "examples"       target builds the example programs
  REM "tools"          target builds the tools
  REM "clean"          target removes generated files
  REM "jar"            target builds core + jar
  REM "javadocs"       target builds the javadoc
  REM "package"        target builds core + jar + javadoc + distribution
  REM --------------------------------------------
  set TARGET=%1%
  
  
  REM --------------------------------------------
  REM No need to edit anything past here
  REM --------------------------------------------
  set BUILDFILE=build.xml
  if "%TARGET%" == "" goto setdist
  goto final
  
  :setdist
  set TARGET=jar
  goto final
  
  :final
  
  if "%JAVA_HOME%" == "" goto javahomeerror
  
  if exist %JAVA_HOME%\lib\tools.jar set CLASSPATH=%CLASSPATH%;%JAVA_HOME%\lib\tools.jar
  set CP=%CLASSPATH%;ant-1.3.jar;parser.jar
  
  echo Classpath: %CP%
  echo JAVA_HOME: %JAVA_HOME%
  
  %JAVA_HOME%\bin\java.exe -classpath "%CP%" org.apache.tools.ant.Main -buildfile %BUILDFILE% %TARGET%
  
  goto end
  
  
  REM -----------ERROR-------------
  :javahomeerror
  echo "ERROR: JAVA_HOME not found in your environment."
  echo "Please, set the JAVA_HOME variable in your environment to match the"
  echo "location of the Java Virtual Machine you want to use."
  
  :end
  
  
  
  1.1                  jakarta-oro/build/build.sh
  
  Index: build.sh
  ===================================================================
  #!/bin/sh
  
  #
  # $Id: build.sh,v 1.1 2001/05/16 08:53:34 dfs Exp $
  #
  
  # --------------------------------------------
  # Default == jar
  # "lib"            target builds the library
  # "examples"       target builds the example programs
  # "tools"          target builds the tools
  # "clean"          target removes generated files
  # "jar"            target builds lib + jar
  # "javadocs"       target builds the javadoc
  # "package"        target builds lib + jar + javadoc + distribution
  # --------------------------------------------
  
  
  PROGRAM=$0
  PROGRAM_NAME="`basename $PROGRAM`"
  PROGRAM_DIR="`dirname $PROGRAM`"
  JAR_DIR=.
  BUILDFILE=./build.xml
  JAKARTA_SITE2=../../jakarta-site2
  JAKARTA_SITE2_LIB="${JAKARTA_SITE2}/lib"
  
  cd "$PROGRAM_DIR"
  
  #--------------------------------------------
  # No need to edit anything past here
  #--------------------------------------------
  if test -z "${JAVA_HOME}" ; then
      echo "ERROR: JAVA_HOME not found in your environment."
      echo "Please, set the JAVA_HOME variable in your environment to match the"
      echo "location of the Java Virtual Machine you want to use."
      exit
  fi
  
  if test -f "${JAVA_HOME}/lib/tools.jar" ; then
      CLASSPATH="${CLASSPATH}:${JAVA_HOME}/lib/tools.jar"
  fi
  
  if test -d "$JAKARTA_SITE2" ; then
      for jar in "$JAKARTA_SITE2_LIB"/*.jar; do
  	CLASSPATH="${CLASSPATH}:$jar"
      done
  fi
  
  for jar in "$JAR_DIR"/*.jar; do
      CLASSPATH="${CLASSPATH}:$jar"
  done
  
  echo "Now building ${TARGET}..."
  
  echo "CLASSPATH: ${CLASSPATH}"
  echo "JAVA_HOME: ${JAVA_HOME}"
  
  
  "${JAVA_HOME}/bin/java" -classpath "$CLASSPATH" \
      -Djakarta-site2.dir="$JAKARTA_SITE2" \
     org.apache.tools.ant.Main -buildfile "$BUILDFILE" "$@"
  
  
  
  1.1                  jakarta-oro/build/build.xml
  
  Index: build.xml
  ===================================================================
  <?xml version="1.0"?>
  <!-- $Id: build.xml,v 1.1 2001/05/16 08:53:34 dfs Exp $ -->
  
  <project name="Jakarta-ORO" default="jar" basedir=".">
  
    <property name="Name" value="Jakarta-ORO"/>
    <property name="year" value="2001"/>
    <property name="version" value="2.0.2"/>
    <property name="project" value="jakarta-oro"/>
    <property name="code.src" value="../src"/>
    <property name="build.src" value="../src/java"/>
    <property name="build.dest" value="../classes"/>
    <property name="javadoc.destdir" value="../docs/api"/>
    <property name="final.name" value="${project}-${version}"/>
    <property name="final.dir" value="../${final.name}/"/>
    <property name="debug" value="off"/>
    <property name="optimize" value="on"/>
    <property name="deprecation" value="off"/>
    <property name="ant.home" value="."/>
    <property name="docs.src" value="../xdocs"/>
    <property name="docs.dest" value="../docs"/>
  
      <!-- prepare target.  Creates build directory. -->
  
      <target name="prepare">
          <mkdir dir="${build.dest}"/>
  	<available classname="org.apache.velocity.anakia.AnakiaTask"
  	 property="AnakiaTask.present"/>
  	<!--
          <chmod perm="+x" file="bin/antRun"/>
  	-->
      </target>
  
      <target name="prepare-error" depends="prepare"
       unless="AnakiaTask.present">
         <echo>
          AnakiaTask is not present! Please check to make sure that 
          velocity.jar is in your classpath.
         </echo>
      </target>
  
      <!-- lib target.  Compiles the library classes only -->
  
      <target name="lib" depends="prepare">
          <javac srcdir="${build.src}"
              destdir="${build.dest}"
              excludes="examples/**,tools/**"
              debug="${debug}"
              deprecation="${deprecation}"
              optimize="${optimize}"/>
      </target>
  
      <!-- examples target.  Compiles the example classes. -->
  
      <target name="examples" depends="prepare,lib">
          <javac srcdir="${build.src}/examples"
  	    excludes="awk/**"
              destdir="${build.dest}"
              debug="${debug}"
              deprecation="${deprecation}"
              optimize="${optimize}"/>
      </target>
  
      <!-- awk-examples target.  Compiles the example classes. -->
  
      <target name="examples-awk" depends="prepare,lib">
          <javac srcdir="${build.src}/examples/awk"
              destdir="${build.dest}"
              debug="${debug}"
              deprecation="${deprecation}"
              optimize="${optimize}"/>
      </target>
  
      <!-- tools target.  Compiles the tool classes. -->
  
      <target name="tools" depends="prepare,lib">
          <javac srcdir="${build.src}/tools"
              destdir="${build.dest}"
              debug="${debug}"
              deprecation="${deprecation}"
              optimize="${optimize}"/>
      </target>
      
  
      <!-- jar target.  Compiles the source directory and creates a .jar file -->
  
      <target name="jar" depends="lib">
          <jar jarfile="../${final.name}.jar"
              basedir="${build.dest}"
              includes="org/**"
              excludes="**/package.html,**/overview.html"/>
      </target>
  
      <!-- javadocs target.  Creates the API documentation -->
  
      <target name="javadocs" depends="prepare">
          <mkdir dir="${javadoc.destdir}"/>
          <javadoc packagenames="org.apache.oro.io,org.apache.oro.text,org.apache.oro.text.regex,org.apache.oro.text.awk,org.apache.oro.text.perl,org.apache.oro.util"
              sourcepath="${build.src}"
              destdir="${javadoc.destdir}"
              overview="${build.src}/org/apache/oro/overview.html"
              author="true"
              version="true"
              windowtitle="${Name} ${version} API"
              doctitle="${Name} ${version} API"
              bottom="Copyright &#169; ${year} Apache Software Foundation. All Rights Reserved."
          />
      </target>
  
  
     <!-- docs target.  Creates project web pages and documentation. -->
     <target name="docs" depends="prepare-error"
      if="AnakiaTask.present">
       <taskdef name="anakia" classname="org.apache.velocity.anakia.AnakiaTask"/>
       <anakia basedir="${docs.src}" destdir="${docs.dest}/"
        extension=".html" style="./site.vsl"
        projectFile="stylesheets/project.xml"
        excludes="**/stylesheets/** empty.xml"
        includes="**/*.xml"
        lastModifiedCheck="true"
        templatePath="${jakarta-site2.dir}/xdocs/stylesheets">
       </anakia>
  
       <!-- Uncomment if images are added
       <copy todir="${docs.dest}/images" filtering="no">
         <fileset dir="${docs.src}/images">
           <include name="**/*.gif"/>
           <include name="**/*.jpeg"/>
           <include name="**/*.jpg"/>
         </fileset>
       </copy>
       -->
     </target>
  
      
      <!-- package target -->
  
      <target name="package" depends="jar,javadocs">
          <mkdir dir="${final.dir}"/>
          <mkdir dir="${final.dir}/src"/>
          <copydir src="${code.src}/" dest="${final.dir}/src"/>
          <copydir src="../doc" dest="${final.dir}/doc"
              excludes="**/dist/**"/>
          <copydir src="../build" dest="${final.dir}/build"/>
          <copyfile src="../LICENSE" dest="${final.dir}/LICENSE"/>
          <copyfile src="../BUGS" dest="${final.dir}/BUGS"/>
          <copyfile src="../CHANGES" dest="${final.dir}/CHANGES"/>
          <copyfile src="../README" dest="${final.dir}/README"/>
          <copyfile src="../STYLE" dest="${final.dir}/STYLE"/>
          <copyfile src="../TODO" dest="${final.dir}/TODO"/>
          <copyfile src="../${final.name}.jar" dest="${final.dir}/${final.name}.jar"/>
      </target>
    
  
      <!-- package-zip target.  Packages the distribution with ZIP -->
  
      <target name="package-zip" depends="package">
          <zip zipfile="../${project}-${version}.zip" basedir="../" includes="**/${final.name}/**"/>
      </target>
      
      <!-- Packages the distribution with TAR-GZIP -->
  
      <target name="package-tgz" depends="package">
          <tar tarfile="../${project}-${version}.tar" basedir="../" includes="**/${final.name}/**"/>
          <gzip zipfile="../${project}-${version}.tar.gz" src="../${project}-${version}.tar"/>
      </target>
      
      <!-- Packages the distribution with ZIP and TAG-GZIP -->
  
      <target name="package-all" depends="package-zip, package-tgz">
      </target>
  
      <!-- Makes an attempt to clean up a little. -->
  
      <target name="clean">
          <delete dir="${build.dest}"/>
          <delete dir="${javadoc.destdir}"/>
          <delete dir="${final.dir}"/>
  	<delete file="../${final.name}.jar"/>
  	<delete file="../${final.name}.tar"/>
  	<delete file="../${final.name}.tar.gz"/>
  	<delete file="../${final.name}.zip"/>
      </target>
  
  </project>