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.

build.sh 1.7 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #!/bin/sh
  2. if test ! -f build\classes\org\apache\tools\ant\Main.class ; then
  3. ./bootstrap.sh $*
  4. fi
  5. # Cygwin support. $cygwin _must_ be set to either true or false.
  6. case "`uname`" in
  7. CYGWIN*) cygwin=true ;;
  8. *) cygwin=false ;;
  9. esac
  10. # For Cygwin, ensure paths are in UNIX format before anything is touched
  11. if $cygwin; then
  12. [ -n "$JAVA_HOME" ] &&
  13. JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
  14. [ -n "$CLASSPATH" ] &&
  15. CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
  16. fi
  17. LOCALCLASSPATH=`echo lib/*.jar | tr ' ' ':'`
  18. LOCALCLASSPATH=$LOCALCLASSPATH:build/classes:lib/optional/junit.jar
  19. if [ "$CLASSPATH" != "" ] ; then
  20. LOCALCLASSPATH=$CLASSPATH:$LOCALCLASSPATH
  21. fi
  22. if [ "$JAVA_HOME" != "" ] ; then
  23. if test -f $JAVA_HOME/lib/tools.jar ; then
  24. LOCALCLASSPATH=$LOCALCLASSPATH:$JAVA_HOME/lib/tools.jar
  25. fi
  26. if test -f $JAVA_HOME/lib/classes.zip ; then
  27. LOCALCLASSPATH=$LOCALCLASSPATH:$JAVA_HOME/lib/classes.zip
  28. fi
  29. else
  30. echo "Warning: JAVA_HOME environment variable is not set."
  31. echo " If build fails because sun.* classes could not be found"
  32. echo " you will need to set the JAVA_HOME environment variable"
  33. echo " to the installation directory of java."
  34. fi
  35. if [ ! -x "$JAVA_HOME/bin/java" ] ; then
  36. echo "Error: JAVA_HOME is not defined correctly."
  37. echo " We cannot execute JAVA_HOME/bin/java"
  38. exit
  39. fi
  40. # For Cygwin, switch paths to Windows format before running javac
  41. if $cygwin; then
  42. LOCALCLASSPATH=`cygpath --path --windows "$LOCALCLASSPATH"`
  43. fi
  44. NEW_ANT_HOME=$ANT_HOME
  45. if [ "$NEW_ANT_HOME" == "" ] ; then
  46. NEW_ANT_HOME=dist
  47. fi
  48. ${JAVA_HOME}/bin/java -classpath $LOCALCLASSPATH org.apache.tools.ant.Main -Dant.home=$NEW_ANT_HOME -logger org.apache.tools.ant.NoBannerLogger -emacs $*