summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormichelou <michelou@epfl.ch>2006-03-15 16:59:10 +0000
committermichelou <michelou@epfl.ch>2006-03-15 16:59:10 +0000
commit15433cf43817a7e0cd8a22222ef776f9030ecf57 (patch)
tree38505009b8d74e1a7a39da432535c27d4ae180ca
parent91ff3e0a6d3a690696fe2d29c616d83f4abc69e8 (diff)
downloadscala-15433cf43817a7e0cd8a22222ef776f9030ecf57.tar.gz
scala-15433cf43817a7e0cd8a22222ef776f9030ecf57.tar.bz2
scala-15433cf43817a7e0cd8a22222ef776f9030ecf57.zip
added license and readme files to the doc
corrected classpath handling in tool-unix.tmpl
-rw-r--r--build.xml3
-rw-r--r--src/compiler/scala/tools/ant/templates/tool-unix.tmpl54
2 files changed, 49 insertions, 8 deletions
diff --git a/build.xml b/build.xml
index 68e6e280c1..2609e5af12 100644
--- a/build.xml
+++ b/build.xml
@@ -983,6 +983,9 @@ GENERATES A DISTRIBUTION
perm="ugo+rx"
/>
<!-- Copy the API, examples and man -->
+ <copy todir="${dist.current.dir}/doc/${dist.name}">
+ <fileset dir="${docs.dir}" includes="README,LICENSE"/>
+ </copy>
<copy todir="${dist.current.dir}/doc/${dist.name}/api">
<fileset dir="${api.lib.dir}"/>
</copy>
diff --git a/src/compiler/scala/tools/ant/templates/tool-unix.tmpl b/src/compiler/scala/tools/ant/templates/tool-unix.tmpl
index 1449866288..eb565f0e1a 100644
--- a/src/compiler/scala/tools/ant/templates/tool-unix.tmpl
+++ b/src/compiler/scala/tools/ant/templates/tool-unix.tmpl
@@ -31,12 +31,50 @@ done;
SCALA_HOME=`dirname "$SOURCE"`/..;
SCALA_HOME=`cd "$SCALA_HOME"; pwd`;
-CLASSPATH=@classpath@
-if [ "$CLASSPATH" == "" ] ; then
- for jar in `ls $SCALA_HOME/lib/*.jar` ; do
- CLASSPATH=$CLASSPATH:$jar
- done
- CLASSPATH=${CLASSPATH:1}
+## buraq: previous version of this script computed the MYCLASSPATH and
+## then appended it to the bootclasspath. Unfortunately, this
+## won't work for library code that uses reflection to obtain
+## a class living on the classpath. For this reason, we have
+## to merge everything in the -cp classpath. This requires
+## intercepting the user's -cp, if any, or the user's $CLASSPATH,
+## if set, appending our libs to it and passing the whole thing by -cp
+
+MYCLASSPATH=@classpath@
+if [ "$MYCLASSPATH" == "" ] ; then
+ for jar in `ls $SCALA_HOME/lib/*.jar` ; do
+ MYCLASSPATH="$MYCLASSPATH:$jar"
+ done
+ MYCLASSPATH=${MYCLASSPATH:1}
+fi
+
+QQ_USERCLASSPATH="."
+QQ_USERARGS=""
+QQ_NEXT=0
+for i in $@@ ; do
+ if [ $QQ_NEXT -eq 1 ] ; then
+ QQ_USERCLASSPATH=$i
+ QQ_NEXT=0
+ else
+ if [[ $i = "-cp" || $i = "-classpath" ]] ; then
+ QQ_NEXT=1
+ else
+ QQ_USERARGS="$QQ_USERARGS $i"
+ QQ_NEXT=0
+ fi
+ fi
+done
+
+## Lex suggested the user classpath comes before
+## the Scala libraries, since it gets preferred.
+
+if [ "$QQ_USERCLASSPATH" != "." ] ; then
+ MYCLASSPATH="$QQ_USERCLASSPATH:$MYCLASSPATH"
+else
+ if [ "$CLASSPATH" != "" ] ; then
+ MYCLASSPATH="$CLASSPATH:$MYCLASSPATH"
+ else
+ MYCLASSPATH=".:$MYCLASSPATH"
+ fi
fi
if $cygwin; then
@@ -45,7 +83,7 @@ if $cygwin; then
else
format=windows
fi
- CLASSPATH=`cygpath --path --$format "$CLASSPATH"`
+ MYCLASSPATH=`cygpath --path --$format "$MYCLASSPATH"`
fi
for flag in "$@@" ; do
@@ -55,4 +93,4 @@ for flag in "$@@" ; do
fi
done
-${JAVACMD:=java} @javaflags@ -Dscala.home="$SCALA_HOME" -Dscala.tool.name="@name@" -Dscala.tool.version="@version@" @properties@ -cp "$CLASSPATH" @class@ @toolflags@ "$@@"
+${JAVACMD:=java} @javaflags@ -Dscala.home="$SCALA_HOME" -Dscala.tool.name="@name@" -Dscala.tool.version="@version@" @properties@ -cp $MYCLASSPATH @class@ @toolflags@ $QQ_USERARGS