summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/binary-repo-lib.sh30
-rwxr-xr-xtools/epfl-publish4
-rwxr-xr-xtools/get-scala-revision52
-rw-r--r--tools/get-scala-revision.bat2
-rwxr-xr-xtools/locker_scala8
-rwxr-xr-xtools/locker_scalac8
-rwxr-xr-xtools/quick_scala6
-rwxr-xr-xtools/quick_scalac6
-rwxr-xr-xtools/starr_scala6
-rwxr-xr-xtools/starr_scalac6
10 files changed, 95 insertions, 33 deletions
diff --git a/tools/binary-repo-lib.sh b/tools/binary-repo-lib.sh
index 4221e3205c..4c5497e803 100755
--- a/tools/binary-repo-lib.sh
+++ b/tools/binary-repo-lib.sh
@@ -7,6 +7,9 @@ remote_urlbase="http://typesafe.artifactoryonline.com/typesafe/scala-sha-bootstr
libraryJar="$(pwd)/lib/scala-library.jar"
desired_ext=".desired.sha1"
push_jar="$(pwd)/tools/push.jar"
+if [[ "$OSTYPE" == *Cygwin* || "$OSTYPE" == *cygwin* ]]; then push_jar="$(cygpath -m "$push_jar")"; fi
+# Cache dir has .sbt in it to line up with SBT build.
+cache_dir="${HOME}/.sbt/cache/scala"
# Checks whether or not curl is installed and issues a warning on failure.
checkCurl() {
@@ -48,7 +51,7 @@ curlDownload() {
checkCurl
local jar=$1
local url=$2
- if [[ "$OSTYPE" == *Cygwin* ]]; then
+ if [[ "$OSTYPE" == *Cygwin* || "$OSTYPE" == *cygwin* ]]; then
jar=$(cygpath -m $1)
fi
http_code=$(curl --write-out '%{http_code}' --silent --fail --output "$jar" "$url")
@@ -126,6 +129,25 @@ pushJarFiles() {
else
echo "Binary changes have been pushed. You may now submit the new *${desired_ext} files to git."
fi
+}
+
+# Pulls a single binary artifact from a remote repository.
+# Argument 1 - The uri to the file that should be downloaded.
+# Argument 2 - SHA of the file...
+# Returns: Cache location.
+pullJarFileToCache() {
+ local uri=$1
+ local sha=$2
+ local cache_loc=$cache_dir/$uri
+ local cdir=$(dirname $cache_loc)
+ if [[ ! -d $cdir ]]; then
+ mkdir -p $cdir
+ fi
+ # TODO - Check SHA of local cache is accurate.
+ if [[ ! -f $cache_loc ]]; then
+ curlDownload $cache_loc ${remote_urlbase}/${uri}
+ fi
+ echo "$cache_loc"
}
# Pulls a single binary artifact from a remote repository.
@@ -139,8 +161,9 @@ pullJarFile() {
local jar_name=${jar#$jar_dir/}
local version=${sha1% ?$jar_name}
local remote_uri=${version}/${jar#$basedir/}
- echo "Downloading from ${remote_urlbase}/${remote_uri}"
- curlDownload $jar ${remote_urlbase}/${remote_uri}
+ echo "Resolving [${remote_uri}]"
+ local cached_file=$(pullJarFileToCache $remote_uri $version)
+ cp $cached_file $jar
}
# Pulls binary artifacts from the remote repository.
@@ -152,7 +175,6 @@ pullJarFiles() {
jar=${sha%$desired_ext}
local valid=$(isJarFileValid $jar)
if [[ "$valid" != "OK" ]]; then
- echo "Obtaining [$jar] from binary repository..."
pullJarFile $jar $basedir
fi
done
diff --git a/tools/epfl-publish b/tools/epfl-publish
index 4982f930bb..de5e17b13f 100755
--- a/tools/epfl-publish
+++ b/tools/epfl-publish
@@ -25,8 +25,8 @@ else
echo "Publishing nightly build to $publish_to"
# Archive Scala nightly distribution
rsync -az dists/archives/ "$publish_to/distributions"
- # don't publish docs in 2.8.x
- [[ $version == "2.8.x" ]] || rsync -az build/scaladoc/ "$publish_to/docs"
+ # only publish scaladoc nightly for trunk
+ [[ $version == "master" ]] && rsync -az build/scaladoc/ "$publish_to/docs"
# sbaz
[[ -d dists/sbaz ]] && rsync -az dists/sbaz/ "$publish_to/sbaz"
fi
diff --git a/tools/get-scala-revision b/tools/get-scala-revision
index b27b6ddc82..4d97ec58ad 100755
--- a/tools/get-scala-revision
+++ b/tools/get-scala-revision
@@ -2,23 +2,43 @@
#
# Usage: get-scala-revision [dir]
# Figures out current scala revision of a git clone.
-#
# If no dir is given, current working dir is used.
+#
+# Example build version string:
+# v2.10.0-M1-0098-g6f1c486d0b-2012-02-01
+#
+
+[[ $# -eq 0 ]] || cd "$1"
+
+ensure_tag () {
+ sha=$1
+ rev=$2
+
+ [[ -n $(git tag -l $rev) ]] || {
+ git tag -a -m "generated by get-scala-revision" $rev $sha
+ }
+}
+
+# Ensure some baseline tags are present so if this repository's
+# tags are screwed up or stale, we should still have a reference
+# point for a build string.
+ensure_tag 58cb15c40d v2.10.0-M1
+ensure_tag 29f3eace1e v2.9.1
+ensure_tag b0d78f6b9c v2.8.2
+
+# the closest tag, obtained separately because we have to
+# reconstruct the string around the padded distance.
+tag=$(git describe --tags --match 'v2*' --abbrev=0)
-# not like releases come out so often that we are duty-bound
-# to recalculate this every time.
-# git merge-base v2.8.2 v2.9.1 master
-devbase="df13e31bbb"
+# printf %016s is not portable for 0-padding, has to be a digit.
+# so we're stuck disassembling it.
+described=$(git describe --tags --match 'v2*' --abbrev=10)
+suffix="${described##${tag}-}"
+counter=$(echo $suffix | cut -d - -f 1)
+hash=$(echo $suffix | cut -d - -f 2)
-# reimplementing git describe hopefully in a way which works
-# without any particular tags, branches, or recent versions of git.
-# this is supposed to generate
-# dev-NNNN-g<sha>
-# where NNNN is the number of commits since devbase, which
-# is the merge-base of the most recent release and master.
-# Presently hardcoded to reduce uncertainty, v2.8.2/v2.9.1/master.
-commits=$(git --no-pager log --pretty=oneline $devbase..HEAD | wc -l)
-sha=$(git rev-list -n 1 HEAD)
-datestr=$(date "+%Y-%m-%d")
+# remove any alphabetic characters before the version number
+tag=$(echo $tag | sed "s/\([a-z_A-Z]*\)\(.*\)/\2/")
-printf "rdev-%s-%s-g%s\n" $commits $datestr ${sha:0:7}
+# 2.10.0-M1-0098-g6f1c486d0b-2012-02-01
+printf "%s-%04d-%s-%s\n" "$tag" "$counter" "$hash" $(date "+%Y-%m-%d")
diff --git a/tools/get-scala-revision.bat b/tools/get-scala-revision.bat
index f4dc24b71f..48c7cbd94f 100644
--- a/tools/get-scala-revision.bat
+++ b/tools/get-scala-revision.bat
@@ -15,7 +15,7 @@ if "%*"=="" (
cd %_DIR%
if exist .git\NUL (
- git describe HEAD --abbrev=7 --match dev
+ git describe --abbrev=10 --always --tags
)
:end
diff --git a/tools/locker_scala b/tools/locker_scala
index 4434c94bf3..02d2efcdd8 100755
--- a/tools/locker_scala
+++ b/tools/locker_scala
@@ -1,8 +1,6 @@
-#!/bin/bash
+#!/bin/sh
#
-THISDIR=`dirname $0`
-CP=`$THISDIR/lockercp`
-CLASS="scala.tools.nsc.MainGenericRunner"
+CP=$($(dirname $BASH_SOURCE)/lockercp)
-java -classpath "$CP" $CLASS -usejavacp "$@"
+java $JAVA_OPTS -classpath "$CP" scala.tools.nsc.MainGenericRunner -usejavacp "$@"
diff --git a/tools/locker_scalac b/tools/locker_scalac
index 2ad153e929..c4b28b7bc0 100755
--- a/tools/locker_scalac
+++ b/tools/locker_scalac
@@ -1,8 +1,6 @@
-#!/bin/bash
+#!/bin/sh
#
-THISDIR=`dirname $0`
-CP=`$THISDIR/lockercp`
-CLASS="scala.tools.nsc.Main"
+CP=$($(dirname $BASH_SOURCE)/lockercp)
-java -classpath "$CP" $CLASS -usejavacp "$@"
+java $JAVA_OPTS -classpath "$CP" scala.tools.nsc.Main -usejavacp "$@"
diff --git a/tools/quick_scala b/tools/quick_scala
new file mode 100755
index 0000000000..16938ddba4
--- /dev/null
+++ b/tools/quick_scala
@@ -0,0 +1,6 @@
+#!/bin/sh
+#
+
+CP=$($(dirname $BASH_SOURCE)/quickcp)
+
+java $JAVA_OPTS -classpath "$CP" scala.tools.nsc.MainGenericRunner -usejavacp "$@"
diff --git a/tools/quick_scalac b/tools/quick_scalac
new file mode 100755
index 0000000000..1b9a036c18
--- /dev/null
+++ b/tools/quick_scalac
@@ -0,0 +1,6 @@
+#!/bin/sh
+#
+
+CP=$($(dirname $BASH_SOURCE)/quickcp)
+
+java $JAVA_OPTS -classpath "$CP" scala.tools.nsc.Main -usejavacp "$@"
diff --git a/tools/starr_scala b/tools/starr_scala
new file mode 100755
index 0000000000..9b0fb60cf7
--- /dev/null
+++ b/tools/starr_scala
@@ -0,0 +1,6 @@
+#!/bin/sh
+#
+
+CP=$($(dirname $BASH_SOURCE)/starrcp)
+
+java $JAVA_OPTS -classpath "$CP" scala.tools.nsc.MainGenericRunner -usejavacp "$@"
diff --git a/tools/starr_scalac b/tools/starr_scalac
new file mode 100755
index 0000000000..972eeaff2b
--- /dev/null
+++ b/tools/starr_scalac
@@ -0,0 +1,6 @@
+#!/bin/sh
+#
+
+CP=$($(dirname $BASH_SOURCE)/starrcp)
+
+java $JAVA_OPTS -classpath "$CP" scala.tools.nsc.Main -usejavacp "$@"