You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

bootstrap.sh 2.6 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. #!/bin/sh
  2. # You will need to specify JAVA_HOME if compiling with 1.2 or later.
  3. if [ "$JAVA_HOME" != "" ] ; then
  4. if [ -f $JAVA_HOME/lib/tools.jar ] ; then
  5. CLASSPATH=$CLASSPATH:$JAVA_HOME/lib/tools.jar
  6. fi
  7. if [ -f "$JAVA_HOME/lib/classes.zip" ] ; then
  8. CLASSPATH=$CLASSPATH:$JAVA_HOME/lib/classes.zip
  9. fi
  10. else
  11. echo "Warning: JAVA_HOME environment variable not set."
  12. echo " If build fails because sun.* classes could not be found"
  13. echo " you will need to set the JAVA_HOME environment variable"
  14. echo " to the installation directory of java."
  15. fi
  16. # More Cygwin support
  17. if [ "$OSTYPE" = "cygwin32" ] || [ "$OSTYPE" = "cygwin" ] ; then
  18. CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
  19. fi
  20. ANT_HOME=.
  21. export ANT_HOME
  22. if [ -z "$JAVAC" ] ; then
  23. JAVAC=javac;
  24. fi
  25. echo ... Bootstrapping Ant Distribution
  26. if [ -f "lib/ant.jar" ] ; then
  27. rm lib/ant.jar
  28. fi
  29. # add in the dependency .jar files
  30. DIRLIBS=${ANT_HOME}/lib/*.jar
  31. for i in ${DIRLIBS}
  32. do
  33. # if the directory is empty, then it will return the input string
  34. # this is stupid, so case for it
  35. if [ "$i" != "${DIRLIBS}" ] ; then
  36. CLASSPATH=$CLASSPATH:"$i"
  37. fi
  38. done
  39. DIRCORELIBS=${ANT_HOME}/lib/core/*.jar
  40. for i in ${DIRCORELIBS}
  41. do
  42. # if the directory is empty, then it will return the input string
  43. # this is stupid, so case for it
  44. if [ "$i" != "${DIRCORELIBS}" ] ; then
  45. CLASSPATH=$CLASSPATH:"$i"
  46. fi
  47. done
  48. TOOLS=src/main/org/apache/tools
  49. CLASSDIR=classes
  50. CLASSPATH=${CLASSDIR}:src/main:${CLASSPATH}
  51. # convert the unix path to windows
  52. if [ "$OSTYPE" = "cygwin32" ] || [ "$OSTYPE" = "cygwin" ] ; then
  53. CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
  54. fi
  55. export CLASSPATH
  56. mkdir -p ${CLASSDIR}
  57. echo ... Compiling Ant Classes
  58. ${JAVAC} -d ${CLASSDIR} ${TOOLS}/tar/*.java
  59. ${JAVAC} -d ${CLASSDIR} ${TOOLS}/ant/util/regexp/RegexpMatcher.java ${TOOLS}/ant/util/regexp/RegexpMatcherFactory.java
  60. ${JAVAC} -d ${CLASSDIR} ${TOOLS}/ant/util/*.java
  61. ${JAVAC} -d ${CLASSDIR} ${TOOLS}/ant/types/*.java
  62. ${JAVAC} -d ${CLASSDIR} ${TOOLS}/ant/*.java
  63. ${JAVAC} -d ${CLASSDIR} ${TOOLS}/ant/taskdefs/*.java
  64. echo ... Copying Required Files
  65. cp src/main/org/apache/tools/ant/taskdefs/defaults.properties ${CLASSDIR}/org/apache/tools/ant/taskdefs
  66. cp src/main/org/apache/tools/ant/types/defaults.properties ${CLASSDIR}/org/apache/tools/ant/types
  67. echo ... Building Ant Distribution
  68. ${JAVA_HOME}/bin/java -classpath ${CLASSPATH} org.apache.tools.ant.Main \
  69. -buildfile build.xml clean main bootstrap
  70. echo ... Cleaning Up Build Directories
  71. chmod +x bin/ant bin/antRun
  72. rm -rf ${CLASSDIR}
  73. echo ... Done Bootstrapping Ant Distribution