Skip to content

Commit

Permalink
update to sbt 0.13.5
Browse files Browse the repository at this point in the history
  • Loading branch information
davidsoergel committed Jul 6, 2014
1 parent 23aec1c commit 18ba444
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 18 deletions.
2 changes: 0 additions & 2 deletions build/sbt-0.13.1/bin/sbt → build/sbt-0.13.5/bin/sbt
Expand Up @@ -56,8 +56,6 @@ cygwinpath() {
fi
}


echo "Loading $(dirname "$(realpath "$0")")/sbt-launch-lib.bash"
. "$(dirname "$(realpath "$0")")/sbt-launch-lib.bash"


Expand Down
Expand Up @@ -17,6 +17,7 @@ declare -a java_args
declare -a scalac_args
declare -a sbt_commands
declare java_cmd=java
declare java_version
declare -r sbt_bin_dir="$(dirname "$(realpath "$0")")"
declare -r sbt_home="$(dirname "$sbt_bin_dir")"

Expand Down Expand Up @@ -77,16 +78,27 @@ addDebugger () {
addJava "-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=$1"
}

# a ham-fisted attempt to move some memory settings in concert
# so they need not be dorked around with individually.
get_mem_opts () {
local mem=${1:-1024}
local perm=$(( $mem / 4 ))
(( $perm > 256 )) || perm=256
(( $perm < 1024 )) || perm=1024
local codecache=$(( $perm / 2 ))

echo "-Xms${mem}m -Xmx${mem}m -XX:MaxPermSize=${perm}m -XX:ReservedCodeCacheSize=${codecache}m"
# if we detect any of these settings in ${java_opts} we need to NOT output our settings.
# The reason is the Xms/Xmx, if they don't line up, cause errors.
if [[ "${java_opts}" == *-Xmx* ]] || [[ "${java_opts}" == *-Xms* ]] || [[ "${java_opts}" == *-XX:MaxPermSize* ]] || [[ "${java_opts}" == *-XX:ReservedCodeCacheSize* ]]; then
echo ""
else
# a ham-fisted attempt to move some memory settings in concert
# so they need not be messed around with individually.
local mem=${1:-1024}
local codecache=$(( $mem / 8 ))
(( $codecache > 128 )) || codecache=128
(( $codecache < 512 )) || codecache=512

local common_opts="-Xms${mem}m -Xmx${mem}m -XX:ReservedCodeCacheSize=${codecache}m"
if [[ "$java_version" < "1.8" ]]; then
local perm=$(( $codecache * 2 ))
echo "$common_opts -XX:MaxPermSize=${perm}m"
else
echo "$common_opts"
fi
fi
}

require_arg () {
Expand Down Expand Up @@ -130,13 +142,15 @@ process_args () {
residual_args=()
process_my_args "${myargs[@]}"
}

java_version=$("$java_cmd" -version 2>&1 | awk -F '"' '/version/ {print $2}')
vlog "[process_args] java_version = '$java_version'"
}

# Detect that we have java installed.
checkJava() {
local required_version="$1"
# Now check to see if it's a good enough version
declare -r java_version=$("$java_cmd" -version 2>&1 | awk -F '"' '/version/ {print $2}')
if [[ "$java_version" == "" ]]; then
echo
echo No java installations was detected.
Expand Down
Binary file renamed build/sbt-0.13.1/bin/sbt-launch.jar → build/sbt-0.13.5/bin/sbt-launch.jar 100644 → 100755
Binary file not shown.
9 changes: 4 additions & 5 deletions build/sbt-0.13.1/bin/sbt.bat → build/sbt-0.13.5/bin/sbt.bat 100644 → 100755
Expand Up @@ -11,7 +11,6 @@

@echo off
set SBT_HOME=%~dp0
set ERROR_CODE=0

rem FIRST we load the config file of extra options.
set FN=%SBT_HOME%\..\conf\sbtconfig.txt
Expand Down Expand Up @@ -45,10 +44,10 @@ if ERRORLEVEL 1 goto error
goto end

:error
set ERROR_CODE=1
@endlocal
exit /B 1

:end

:end
@endlocal

exit /B %ERROR_CODE%
exit /B 0
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion sbt

0 comments on commit 18ba444

Please sign in to comment.