diff options
author | Dominik Gruntz <dominik.gruntz@fhnw.ch> | 2012-04-12 09:11:47 +0200 |
---|---|---|
committer | Dominik Gruntz <dominik.gruntz@fhnw.ch> | 2012-04-12 09:11:47 +0200 |
commit | 9a7aa3aad8b178c41d82d42d0c382d806319af33 (patch) | |
tree | fffc906a908e51c6ada019289f8010d825f0191f | |
parent | d4d8f15ad121edfc0b924deaeb9c30a9d9b71e84 (diff) | |
parent | db3056f11730da19e4e56f09f12e300bda62f57c (diff) | |
download | scala-9a7aa3aad8b178c41d82d42d0c382d806319af33.tar.gz scala-9a7aa3aad8b178c41d82d42d0c382d806319af33.tar.bz2 scala-9a7aa3aad8b178c41d82d42d0c382d806319af33.zip |
Merge branch 'master' of https://github.com/scala/scala
-rw-r--r-- | build.xml | 2 | ||||
-rw-r--r-- | tools/get-scala-commit-date.bat | 33 | ||||
-rw-r--r-- | tools/get-scala-commit-sha.bat | 30 |
3 files changed, 20 insertions, 45 deletions
@@ -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/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 |