diff options
author | Gilles Dubochet <gilles.dubochet@epfl.ch> | 2006-01-09 13:07:02 +0000 |
---|---|---|
committer | Gilles Dubochet <gilles.dubochet@epfl.ch> | 2006-01-09 13:07:02 +0000 |
commit | ee5a600ff41d39cf96fc224accd82b245394d814 (patch) | |
tree | c65732611822d944138cb451ae467c129283193a /src/compiler/scala/tools/ant/templates/tool-unix.tmpl | |
parent | 5d4d8b21cec21fe23490e66182a9b4890e15a9d1 (diff) | |
download | scala-ee5a600ff41d39cf96fc224accd82b245394d814.tar.gz scala-ee5a600ff41d39cf96fc224accd82b245394d814.tar.bz2 scala-ee5a600ff41d39cf96fc224accd82b245394d814.zip |
Updated the Ant build system:
1. Minor aesthetic changes to Scalac.
2. Added Ant task ScalaTool that automatically constructs wrappers for a tool. Wrapper templates are in ant/templates.
3. Modified build.xml to use ScalaTool.
4. Removed nsc/ant/NSC which is now obsolete (replaced by ant/Scalac).
5. Added a antlib.xml file that allows to load all ant tasks in one operation in an ant script.
Diffstat (limited to 'src/compiler/scala/tools/ant/templates/tool-unix.tmpl')
-rw-r--r-- | src/compiler/scala/tools/ant/templates/tool-unix.tmpl | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/ant/templates/tool-unix.tmpl b/src/compiler/scala/tools/ant/templates/tool-unix.tmpl new file mode 100644 index 0000000000..081b0219da --- /dev/null +++ b/src/compiler/scala/tools/ant/templates/tool-unix.tmpl @@ -0,0 +1,59 @@ +#!/bin/bash + +############################################################################## +# @name@ @version@ +############################################################################## +# @copyright@ +# This is free software; see the distribution for copying conditions. +# There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. +############################################################################## + +cygwin=false; +darwin=false; +case "`uname`" in + CYGWIN*) cygwin=true ;; + Darwin*) darwin=true ;; +esac + +SOURCE=$0; +SCRIPT=`basename "$SOURCE"`; +while [ -h "$SOURCE" ]; do + SCRIPT=`basename "$SOURCE"`; + LOOKUP=`ls -ld "$SOURCE"`; + TARGET=`expr "$LOOKUP" : '.*-> \(.*\)$'`; + if expr "${TARGET:-.}/" : '/.*/$' > /dev/null; then + SOURCE=${TARGET:-.}; + else + SOURCE=`dirname "$SOURCE"`/${TARGET:-.}; + fi; +done; +PREFIX=`dirname "$SOURCE"`/..; +prefix=$PREFIX; +PREFIX=`cd "$PREFIX"; pwd`; + +CP=@classpath@ +if [ "$CP" == "" ] ; then + for jar in `ls $PREFIX/lib/*.jar` ; do + CP=$CP:$jar + done + CP=${CP:1} +fi + +if $cygwin; then + if [ "$OS" = "Windows_NT" ] && cygpath -m .>/dev/null 2>/dev/null ; then + format=mixed + else + format=windows + fi + CP=`cygpath --path --$format "$CP"` +fi + +for flag in "$@@" ; do + if [ $flag == '-version' ] ; then + echo "@name@ version @version@" + exit 0 + fi +done + +${JAVACMD:=java} @javaflags@ -Dscala.home="$PREFIX" -Dscala.tool.name="@name@" -Dscala.tool.version="@version@" @properties@ -cp "$CP" @class@ @toolflags@ "$@@"
\ No newline at end of file |