make the preloader's required profiler argument (time|notime) an optional switch: -pp
fixes for broken Windows batch files
This commit is contained in:
committed by
Natalia.Ukhorskaya
parent
ef819cce5a
commit
0bfa5cd954
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
# Copyright 2002-2011, LAMP/EPFL
|
# Copyright 2002-2011, LAMP/EPFL
|
||||||
# Copyright 2011, JetBrains
|
# Copyright 2011-2013, JetBrains
|
||||||
#
|
#
|
||||||
# This is free software; see the distribution for copying conditions.
|
# This is free software; see the distribution for copying conditions.
|
||||||
# There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
|
# There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
|
||||||
@@ -45,6 +45,7 @@ fi
|
|||||||
# -D options will be available as system properties.
|
# -D options will be available as system properties.
|
||||||
declare -a java_args
|
declare -a java_args
|
||||||
declare -a kotlin_args
|
declare -a kotlin_args
|
||||||
|
profile_preloader="notime"
|
||||||
|
|
||||||
while [ $# -gt 0 ]; do
|
while [ $# -gt 0 ]; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
@@ -62,6 +63,10 @@ while [ $# -gt 0 ]; do
|
|||||||
kotlin_args=("${kotlin_args[@]}" "$1")
|
kotlin_args=("${kotlin_args[@]}" "$1")
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
-pp)
|
||||||
|
profile_preloader="time"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
kotlin_args=("${kotlin_args[@]}" "$1")
|
kotlin_args=("${kotlin_args[@]}" "$1")
|
||||||
shift
|
shift
|
||||||
@@ -82,4 +87,4 @@ CPSELECT="-cp "
|
|||||||
$JAVA_OPTS \
|
$JAVA_OPTS \
|
||||||
"${java_args[@]}" \
|
"${java_args[@]}" \
|
||||||
${CPSELECT}"${KOTLIN_HOME}/lib/kotlin-preloader.jar" \
|
${CPSELECT}"${KOTLIN_HOME}/lib/kotlin-preloader.jar" \
|
||||||
org.jetbrains.jet.preloading.Preloader "${KOTLIN_HOME}/lib/kotlin-compiler.jar" org.jetbrains.jet.cli.js.K2JSCompiler 4096 "$@"
|
org.jetbrains.jet.preloading.Preloader "${KOTLIN_HOME}/lib/kotlin-compiler.jar" org.jetbrains.jet.cli.js.K2JSCompiler 4096 $profile_preloader "$@"
|
||||||
|
|||||||
@@ -2,13 +2,17 @@
|
|||||||
rem based on scalac.bat from the Scala distribution
|
rem based on scalac.bat from the Scala distribution
|
||||||
rem ##########################################################################
|
rem ##########################################################################
|
||||||
rem # Copyright 2002-2011, LAMP/EPFL
|
rem # Copyright 2002-2011, LAMP/EPFL
|
||||||
rem # Copyright 2011, JetBrains
|
rem # Copyright 2011-2013, JetBrains
|
||||||
rem #
|
rem #
|
||||||
rem # This is free software; see the distribution for copying conditions.
|
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 # There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
|
||||||
rem # PARTICULAR PURPOSE.
|
rem # PARTICULAR PURPOSE.
|
||||||
rem ##########################################################################
|
rem ##########################################################################
|
||||||
|
|
||||||
|
rem We adopt the following conventions:
|
||||||
|
rem - System/user environment variables start with a letter
|
||||||
|
rem - Local batch variables start with an underscore ('_')
|
||||||
|
|
||||||
@setlocal
|
@setlocal
|
||||||
call :set_home
|
call :set_home
|
||||||
|
|
||||||
@@ -18,12 +22,26 @@ if not "%JAVA_HOME%"=="" (
|
|||||||
|
|
||||||
if "%_JAVACMD%"=="" set _JAVACMD=java
|
if "%_JAVACMD%"=="" set _JAVACMD=java
|
||||||
|
|
||||||
|
set _PROFILE_PRELOADER=notime
|
||||||
|
rem re: E%1 &c., see http://www.riedquat.de/blog/2011-11-27-01#w9aab1c45
|
||||||
|
if E%1==E-pp (
|
||||||
|
shift
|
||||||
|
set _PROFILE_PRELOADER=time
|
||||||
|
)
|
||||||
|
|
||||||
rem We use the value of the JAVA_OPTS environment variable if defined
|
rem We use the value of the JAVA_OPTS environment variable if defined
|
||||||
set _JAVA_OPTS=-Xmx256M -Xms32M -noverify
|
set _JAVA_OPTS=-Xmx256M -Xms32M -noverify
|
||||||
|
|
||||||
"%_JAVACMD%" %_JAVA_OPTS% -cp "%_KOTLIN_HOME%\lib\kotlin-preloader.jar" ^
|
rem re: %1 %2 &c., see http://www.riedquat.de/blog/2011-11-27-01#w9aab1c60
|
||||||
org.jetbrains.jet.preloading.Preloader "${KOTLIN_HOME}/lib/kotlin-compiler.jar" ^
|
if "%_PROFILE_PRELOADER%"=="time" (
|
||||||
org.jetbrains.jet.cli.jvm.K2JVMCompiler 4096 org.jetbrains.jet.cli.js.K2JSCompiler %*
|
"%_JAVACMD%" %_JAVA_OPTS% -cp "%_KOTLIN_HOME%\lib\kotlin-preloader.jar" ^
|
||||||
|
org.jetbrains.jet.preloading.Preloader "%_KOTLIN_HOME%\lib\kotlin-compiler.jar" ^
|
||||||
|
org.jetbrains.jet.cli.js.K2JSCompiler 4096 %_PROFILE_PRELOADER% %1 %2 %3 %4 %5 %6 %7 %8 %9
|
||||||
|
) else (
|
||||||
|
"%_JAVACMD%" %_JAVA_OPTS% -cp "%_KOTLIN_HOME%\lib\kotlin-preloader.jar" ^
|
||||||
|
org.jetbrains.jet.preloading.Preloader "%_KOTLIN_HOME%\lib\kotlin-compiler.jar" ^
|
||||||
|
org.jetbrains.jet.cli.js.K2JSCompiler 4096 %_PROFILE_PRELOADER% %*
|
||||||
|
)
|
||||||
goto end
|
goto end
|
||||||
|
|
||||||
rem ##########################################################################
|
rem ##########################################################################
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
# Copyright 2002-2011, LAMP/EPFL
|
# Copyright 2002-2011, LAMP/EPFL
|
||||||
# Copyright 2011, JetBrains
|
# Copyright 2011-2013, JetBrains
|
||||||
#
|
#
|
||||||
# This is free software; see the distribution for copying conditions.
|
# This is free software; see the distribution for copying conditions.
|
||||||
# There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
|
# There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
|
||||||
@@ -45,6 +45,7 @@ fi
|
|||||||
# -D options will be available as system properties.
|
# -D options will be available as system properties.
|
||||||
declare -a java_args
|
declare -a java_args
|
||||||
declare -a kotlin_args
|
declare -a kotlin_args
|
||||||
|
profile_preloader="notime"
|
||||||
|
|
||||||
while [ $# -gt 0 ]; do
|
while [ $# -gt 0 ]; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
@@ -62,6 +63,10 @@ while [ $# -gt 0 ]; do
|
|||||||
kotlin_args=("${kotlin_args[@]}" "$1")
|
kotlin_args=("${kotlin_args[@]}" "$1")
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
-pp)
|
||||||
|
profile_preloader="time"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
kotlin_args=("${kotlin_args[@]}" "$1")
|
kotlin_args=("${kotlin_args[@]}" "$1")
|
||||||
shift
|
shift
|
||||||
@@ -82,4 +87,4 @@ CPSELECT="-cp "
|
|||||||
$JAVA_OPTS \
|
$JAVA_OPTS \
|
||||||
"${java_args[@]}" \
|
"${java_args[@]}" \
|
||||||
${CPSELECT}"${KOTLIN_HOME}/lib/kotlin-preloader.jar" \
|
${CPSELECT}"${KOTLIN_HOME}/lib/kotlin-preloader.jar" \
|
||||||
org.jetbrains.jet.preloading.Preloader "${KOTLIN_HOME}/lib/kotlin-compiler.jar" org.jetbrains.jet.cli.jvm.K2JVMCompiler 4096 "$@"
|
org.jetbrains.jet.preloading.Preloader "${KOTLIN_HOME}/lib/kotlin-compiler.jar" org.jetbrains.jet.cli.jvm.K2JVMCompiler 4096 $profile_preloader "$@"
|
||||||
|
|||||||
@@ -2,13 +2,17 @@
|
|||||||
rem based on scalac.bat from the Scala distribution
|
rem based on scalac.bat from the Scala distribution
|
||||||
rem ##########################################################################
|
rem ##########################################################################
|
||||||
rem # Copyright 2002-2011, LAMP/EPFL
|
rem # Copyright 2002-2011, LAMP/EPFL
|
||||||
rem # Copyright 2011, JetBrains
|
rem # Copyright 2011-2013, JetBrains
|
||||||
rem #
|
rem #
|
||||||
rem # This is free software; see the distribution for copying conditions.
|
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 # There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
|
||||||
rem # PARTICULAR PURPOSE.
|
rem # PARTICULAR PURPOSE.
|
||||||
rem ##########################################################################
|
rem ##########################################################################
|
||||||
|
|
||||||
|
rem We adopt the following conventions:
|
||||||
|
rem - System/user environment variables start with a letter
|
||||||
|
rem - Local batch variables start with an underscore ('_')
|
||||||
|
|
||||||
@setlocal
|
@setlocal
|
||||||
call :set_home
|
call :set_home
|
||||||
|
|
||||||
@@ -18,12 +22,26 @@ if not "%JAVA_HOME%"=="" (
|
|||||||
|
|
||||||
if "%_JAVACMD%"=="" set _JAVACMD=java
|
if "%_JAVACMD%"=="" set _JAVACMD=java
|
||||||
|
|
||||||
|
set _PROFILE_PRELOADER=notime
|
||||||
|
rem re: E%1 &c., see http://www.riedquat.de/blog/2011-11-27-01#w9aab1c45
|
||||||
|
if E%1==E-pp (
|
||||||
|
shift
|
||||||
|
set _PROFILE_PRELOADER=time
|
||||||
|
)
|
||||||
|
|
||||||
rem We use the value of the JAVA_OPTS environment variable if defined
|
rem We use the value of the JAVA_OPTS environment variable if defined
|
||||||
set _JAVA_OPTS=-Xmx256M -Xms32M -noverify
|
set _JAVA_OPTS=-Xmx256M -Xms32M -noverify
|
||||||
|
|
||||||
"%_JAVACMD%" %_JAVA_OPTS% -cp "%_KOTLIN_HOME%\lib\kotlin-preloader.jar" ^
|
rem re: %1 %2 &c., see http://www.riedquat.de/blog/2011-11-27-01#w9aab1c60
|
||||||
org.jetbrains.jet.preloading.Preloader "${KOTLIN_HOME}/lib/kotlin-compiler.jar" ^
|
if "%_PROFILE_PRELOADER%"=="time" (
|
||||||
org.jetbrains.jet.cli.jvm.K2JVMCompiler 4096 org.jetbrains.jet.cli.jvm.K2JVMCompiler %*
|
"%_JAVACMD%" %_JAVA_OPTS% -cp "%_KOTLIN_HOME%\lib\kotlin-preloader.jar" ^
|
||||||
|
org.jetbrains.jet.preloading.Preloader "%_KOTLIN_HOME%\lib\kotlin-compiler.jar" ^
|
||||||
|
org.jetbrains.jet.cli.jvm.K2JVMCompiler 4096 %_PROFILE_PRELOADER% %1 %2 %3 %4 %5 %6 %7 %8 %9
|
||||||
|
) else (
|
||||||
|
"%_JAVACMD%" %_JAVA_OPTS% -cp "%_KOTLIN_HOME%\lib\kotlin-preloader.jar" ^
|
||||||
|
org.jetbrains.jet.preloading.Preloader "%_KOTLIN_HOME%\lib\kotlin-compiler.jar" ^
|
||||||
|
org.jetbrains.jet.cli.jvm.K2JVMCompiler 4096 %_PROFILE_PRELOADER% %*
|
||||||
|
)
|
||||||
goto end
|
goto end
|
||||||
|
|
||||||
rem ##########################################################################
|
rem ##########################################################################
|
||||||
|
|||||||
Reference in New Issue
Block a user