Files
kotlin-fork/compiler/cli/bin/kotlinc.bat
T
2011-10-17 18:15:53 +02:00

52 lines
1.4 KiB
Batchfile

rem based on scalac.bat from the Scala distribution
rem ##########################################################################
rem # Copyright 2002-2011, LAMP/EPFL
rem # Copyright 2011, JetBrains
rem #
rem # This is free software; see the distribution for copying conditions.
rem # There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
rem # PARTICULAR PURPOSE.
rem ##########################################################################
@echo off
@setlocal
call :set_home
if not "%JAVA_HOME%"=="" (
if exist "%JAVA_HOME%\bin\java.exe" set "_JAVACMD=%JAVA_HOME%\bin\java.exe"
)
if "%_JAVACMD%"=="" set _JAVACMD=java
rem We use the value of the JAVA_OPTS environment variable if defined
set _JAVA_OPTS=-Xmx256M -Xms32M
set _TOOL_CLASSPATH=
if "%_TOOL_CLASSPATH%"=="" (
for %%f in ("%_KOTLIN_HOME%\lib\*") do call :add_cpath "%%f"
for /d %%f in ("%_KOTLIN_HOME%\lib\*") do call :add_cpath "%%f"
)
"%_JAVACMD%" %_JAVA_OPTS% -cp "%_TOOL_CLASSPATH%" org.jetbrains.jet.cli.KotlinCompiler %*
goto end
rem ##########################################################################
rem # subroutines
:add_cpath
if "%_TOOL_CLASSPATH%"=="" (
set _TOOL_CLASSPATH=%~1
) else (
set _TOOL_CLASSPATH=%_TOOL_CLASSPATH%;%~1
)
goto :eof
:set_home
set _BIN_DIR=
for %%i in (%~sf0) do set _BIN_DIR=%_BIN_DIR%%%~dpsi
set _KOTLIN_HOME=%_BIN_DIR%..
goto :eof
:end
@endlocal