summaryrefslogtreecommitdiff
path: root/Chalice/chalice.bat
diff options
context:
space:
mode:
authorGravatar mschwerhoff <unknown>2011-09-16 10:55:00 +0200
committerGravatar mschwerhoff <unknown>2011-09-16 10:55:00 +0200
commit23a94e0bbd32c8c612cb79a6745b5bee4dd667dd (patch)
tree6351c2952b194307e57db2b743abbecdb52bfed2 /Chalice/chalice.bat
parent3dcb932f1442a9fa2b29f2b62d986aac2aec4d1a (diff)
Chalice: Modified chalice.bat s.t. it uses the Scala libraries downloaded but Sbt. This releaves the user from having to ensure that he/she has the same Scala version in the path as used by Sbt to build Chalice.
Diffstat (limited to 'Chalice/chalice.bat')
-rw-r--r--Chalice/chalice.bat34
1 files changed, 33 insertions, 1 deletions
diff --git a/Chalice/chalice.bat b/Chalice/chalice.bat
index 62fdb308..fcf7809e 100644
--- a/Chalice/chalice.bat
+++ b/Chalice/chalice.bat
@@ -1,5 +1,37 @@
@echo off
-call scala -cp "%~dp0\target\scala-2.8.1.final\classes" chalice.Chalice /boogieOpt:nologo %*
+set JAVA_EXE=java
+
+REM Attention: 'where' might not be available on all Windows versions
+call where %JAVA_EXE% > NUL
+if not %ERRORLEVEL%==0 (
+ echo Java could not be started.
+ goto :exit_with_error
+)
+
+REM Get the Scala version, or rather, a string such as "scala-2.8.1"
+for /f "delims=" %%a in ('dir /b project\boot\scala-*') do @set SCALA_DIR=%%a
+
+set CP=
+set CP=%CP%;project\boot\%SCALA_DIR%\lib\scala-library.jar
+set CP=%CP%;target\%SCALA_DIR%.final\classes
+
+set CHALICE_MAIN=chalice.Chalice
+
+set CHALICE_OPTS=
+set CHALICE_OPTS=%CHALICE_OPTS% /boogieOpt:nologo
+set CHALICE_OPTS=%CHALICE_OPTS% %*
+
+set CMD=%JAVA_EXE% -cp %CP% %CHALICE_MAIN% %CHALICE_OPTS%
+
+REM echo.
+REM echo %CMD%
+REM echo.
+
+call %CMD%
exit /B 0
+
+
+:exit_with_error
+exit /B 1 \ No newline at end of file