summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build.xml2
-rw-r--r--src/library/scala/Dynamic.scala2
-rw-r--r--src/library/scala/util/Random.scala20
-rw-r--r--tools/get-scala-commit-date.bat33
-rw-r--r--tools/get-scala-commit-sha.bat30
5 files changed, 32 insertions, 55 deletions
diff --git a/build.xml b/build.xml
index 6f3e4a8d19..6a3bc1d4c7 100644
--- a/build.xml
+++ b/build.xml
@@ -283,7 +283,9 @@ INITIALISATION
</condition>
<exec osfamily="unix" executable="tools/get-scala-commit-sha" outputproperty="git.commit.sha" failifexecutionfails="false" />
+ <exec osfamily="windows" executable="tools/get-scala-commit-sha.bat" outputproperty="git.commit.sha" failifexecutionfails="false" />
<exec osfamily="unix" executable="tools/get-scala-commit-date" outputproperty="git.commit.date" failifexecutionfails="false" />
+ <exec osfamily="windows" executable="tools/get-scala-commit-date.bat" outputproperty="git.commit.date" failifexecutionfails="false" />
<!-- some default in case something went wrong getting the revision -->
<property name="git.commit.sha" value="unknown"/>
<property name="git.commit.date" value="unknown"/>
diff --git a/src/library/scala/Dynamic.scala b/src/library/scala/Dynamic.scala
index 32b57ee88f..dcf7599742 100644
--- a/src/library/scala/Dynamic.scala
+++ b/src/library/scala/Dynamic.scala
@@ -11,7 +11,7 @@ package scala
/** A marker trait that enables dynamic invocations. Instances `x` of this
* trait allow calls `x.meth(args)` for arbitrary method names `meth` and
* argument lists `args`. If a call is not natively supported by `x`, it
- * is rewritten to `x.applyDynamic("meth", args)`.
+ * is rewritten to `x.applyDynamic("meth")(args)`.
*
* As of scala 2.9, `scalac` must receive the `-Xexperimental` option for
* `Dynamic` to receive this treatment.
diff --git a/src/library/scala/util/Random.scala b/src/library/scala/util/Random.scala
index 791582c9ec..62cba1fc5b 100644
--- a/src/library/scala/util/Random.scala
+++ b/src/library/scala/util/Random.scala
@@ -120,15 +120,6 @@ class Random(val self: java.util.Random) {
bf(xs) ++= buf result
}
-}
-
-/** The object `Random` offers a default implementation
- * of scala.util.Random and random-related convenience methods.
- *
- * @since 2.8
- */
-object Random extends Random {
-
/** Returns a Stream of pseudorandomly chosen alphanumeric characters,
* equally chosen from A-Z, a-z, and 0-9.
*
@@ -141,3 +132,14 @@ object Random extends Random {
}
}
+
+/** The object `Random` offers a default implementation
+ * of scala.util.Random and random-related convenience methods.
+ *
+ * @since 2.8
+ */
+object Random extends Random {
+
+ implicit def javaRandomToRandom(r: java.util.Random): Random = new Random(r)
+
+}
diff --git a/tools/get-scala-commit-date.bat b/tools/get-scala-commit-date.bat
index a07155533f..2a75073633 100644
--- a/tools/get-scala-commit-date.bat
+++ b/tools/get-scala-commit-date.bat
@@ -1,24 +1,9 @@
-@echo off
-rem
-rem Usage: get-scala-revison.bat [dir]
-rem Figures out current scala commit date of a git clone.
-rem
-rem If no dir is given, current working dir is used.
-
-@setlocal
-set _DIR=
-if "%*"=="" (
- for /f "delims=;" %%i in ('cd') do set "_DIR=%%i"
-) else (
- set "_DIR=%~1"
-)
-cd %_DIR%
-
-rem TODO - Check with a real windows user that this works!
-if exist .git\NUL (
- for /f "tokens=1delims= " in ('git log --format="%ci" -1') do set commitdate=%%a
- echo %commitdate%
-)
-
-:end
-@endlocal
+@echo off
+for %%X in (bash.exe) do (set FOUND=%%~$PATH:X)
+if defined FOUND (
+ bash "%~dp0\get-scala-commit-date"
+) else (
+ rem echo this script does not work with cmd.exe. please, install bash
+ echo unknown
+ exit 1
+) \ No newline at end of file
diff --git a/tools/get-scala-commit-sha.bat b/tools/get-scala-commit-sha.bat
index 7a5afa11b1..390e2d99d0 100644
--- a/tools/get-scala-commit-sha.bat
+++ b/tools/get-scala-commit-sha.bat
@@ -1,21 +1,9 @@
-@echo off
-rem
-rem Usage: get-scala-commit-drift.bat [dir]
-rem Figures out current scala commit drift, of a clone.
-rem
-rem If no dir is given, current working dir is used.
-
-@setlocal
-set _DIR=
-if "%*"=="" (
- for /f "delims=;" %%i in ('cd') do set "_DIR=%%i"
-) else (
- set "_DIR=%~1"
-)
-cd %_DIR%
-
-rem TODO - truncate chars.
-git log -1 --format="%H
-
-:end
-@endlocal
+@echo off
+for %%X in (bash.exe) do (set FOUND=%%~$PATH:X)
+if defined FOUND (
+ bash "%~dp0\get-scala-commit-sha"
+) else (
+ rem echo this script does not work with cmd.exe. please, install bash
+ echo unknown
+ exit 1
+) \ No newline at end of file