diff options
author | Peter Donald <donaldp@apache.org> | 2001-01-23 05:10:39 +0000 |
---|---|---|
committer | Peter Donald <donaldp@apache.org> | 2001-01-23 05:10:39 +0000 |
commit | 27491607d839c109edcf80acba9984df452a4065 (patch) | |
tree | 13ea5e744084749a2818f8f70adaba8558144c75 /bootstrap.sh | |
parent | 746290bbea7d8062bfd117c8ef9a401e578be8c7 (diff) | |
download | ant-27491607d839c109edcf80acba9984df452a4065.tar.gz |
Checked in alpha version of new build system.
May not fully build on *nix platforms yet.
git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@268504 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'bootstrap.sh')
-rwxr-xr-x | bootstrap.sh | 98 |
1 files changed, 41 insertions, 57 deletions
diff --git a/bootstrap.sh b/bootstrap.sh index b4614abdb..c4b27bbde 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -1,17 +1,35 @@ #!/bin/sh -# You will need to specify JAVA_HOME if compiling with 1.2 or later. +# Cygwin support. $cygwin _must_ be set to either true or false. +case "`uname`" in + CYGWIN*) cygwin=true ;; + *) cygwin=false ;; +esac + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin; then + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --unix "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --unix "$CLASSPATH"` +fi + +LOCALCLASSPATH=lib/parser.jar:lib/jaxp.jar + +if [ "$CLASSPATH" != "" ] ; then + LOCALCLASSPATH=$CLASSPATH:$LOCALCLASSPATH +fi if [ "$JAVA_HOME" != "" ] ; then - if [ -f $JAVA_HOME/lib/tools.jar ] ; then - CLASSPATH=$CLASSPATH:$JAVA_HOME/lib/tools.jar + if test -f $JAVA_HOME/lib/tools.jar ; then + LOCALCLASSPATH=$LOCALCLASSPATH:$JAVA_HOME/lib/tools.jar fi - - if [ -f "$JAVA_HOME/lib/classes.zip" ] ; then - CLASSPATH=$CLASSPATH:$JAVA_HOME/lib/classes.zip + + if test -f $JAVA_HOME/lib/classes.zip ; then + LOCALCLASSPATH=$LOCALCLASSPATH:$JAVA_HOME/lib/classes.zip fi else - echo "Warning: JAVA_HOME environment variable not set." + echo "Warning: JAVA_HOME environment variable is not set." echo " If build fails because sun.* classes could not be found" echo " you will need to set the JAVA_HOME environment variable" echo " to the installation directory of java." @@ -23,63 +41,29 @@ if [ ! -x "$JAVA_HOME/bin/java" ] ; then exit fi -# More Cygwin support -if [ "$OSTYPE" = "cygwin32" ] || [ "$OSTYPE" = "cygwin" ] ; then - CLASSPATH=`cygpath --path --unix "$CLASSPATH"` -fi - -ANT_HOME=. -export ANT_HOME - if [ -z "$JAVAC" ] ; then JAVAC=${JAVA_HOME}/bin/javac; fi echo ... Bootstrapping Ant Distribution -if [ -f "lib/ant.jar" ] ; then - rm lib/ant.jar -fi -if [ -f "lib/optional.jar" ] ; then - rm lib/optional.jar -fi - -# add in the dependency .jar files -DIRLIBS=${ANT_HOME}/lib/*.jar -for i in ${DIRLIBS} -do - # if the directory is empty, then it will return the input string - # this is stupid, so case for it - if [ "$i" != "${DIRLIBS}" ] ; then - CLASSPATH=$CLASSPATH:"$i" - fi -done -DIRCORELIBS=${ANT_HOME}/lib/core/*.jar -for i in ${DIRCORELIBS} -do - # if the directory is empty, then it will return the input string - # this is stupid, so case for it - if [ "$i" != "${DIRCORELIBS}" ] ; then - CLASSPATH=$CLASSPATH:"$i" - fi -done +rm -rf build TOOLS=src/main/org/apache/tools -CLASSDIR=classes - -CLASSPATH=${CLASSDIR}:src/main:${CLASSPATH} - -# convert the unix path to windows -if [ "$OSTYPE" = "cygwin32" ] || [ "$OSTYPE" = "cygwin" ] ; then - CLASSPATH=`cygpath --path --windows "$CLASSPATH"` -fi - -export CLASSPATH +CLASSDIR=build\classes +mkdir -p build mkdir -p ${CLASSDIR} echo ... Compiling Ant Classes +export CLASSPATH=$LOCALCLASSPATH:src/main + +# For Cygwin, switch paths to Windows format before running javac +if $cygwin; then + CLASSPATH=`cygpath --path --windows "$CLASSPATH"` +fi + ${JAVAC} -d ${CLASSDIR} ${TOOLS}/tar/*.java \ ${TOOLS}/ant/util/regexp/RegexpMatcher.java \ ${TOOLS}/ant/util/regexp/RegexpMatcherFactory.java \ @@ -95,13 +79,13 @@ cp src/main/org/apache/tools/ant/types/defaults.properties \ echo ... Building Ant Distribution -${JAVA_HOME}/bin/java -classpath ${CLASSPATH} org.apache.tools.ant.Main \ - -buildfile build.xml clean main bootstrap +export CLASSPATH=$LOCALCLASSPATH:build/classes -echo ... Cleaning Up Build Directories - -chmod +x bin/ant bin/antRun +# For Cygwin, switch paths to Windows format before running javac +if $cygwin; then + CLASSPATH=`cygpath --path --windows "$CLASSPATH"` +fi -rm -rf ${CLASSDIR} +${JAVA_HOME}/bin/java -classpath ${CLASSPATH} org.apache.tools.ant.Main echo ... Done Bootstrapping Ant Distribution |