Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Complete update to sbt 0.13.8, and use latest scalaz
  • Loading branch information
davidsoergel committed Mar 22, 2015
1 parent 761462b commit f248f64
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 30 deletions.
Binary file removed build/sbt-0.13.5/bin/sbt-launch.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion build/sbt-0.13.5/bin/sbt → build/sbt-0.13.8/bin/sbt
Expand Up @@ -131,7 +131,7 @@ process_my_args () {
}

loadConfigFile() {
for line in $(cat "$1" | sed '/^\#/d'); do
cat "$1" | sed '/^\#/d' | while read line; do
eval echo $line
done
}
Expand Down
Expand Up @@ -6,12 +6,6 @@

# TODO - Should we merge the main SBT script with this library?

if test -z "$HOME"; then
declare -r script_dir="$(dirname $script_path)"
else
declare -r script_dir="$HOME/.sbt"
fi

declare -a residual_args
declare -a java_args
declare -a scalac_args
Expand Down Expand Up @@ -75,13 +69,13 @@ addResidual () {
residual_args=( "${residual_args[@]}" "$1" )
}
addDebugger () {
addJava "-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=$1"
addJava "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=$1"
}

get_mem_opts () {
# if we detect any of these settings in ${java_opts} we need to NOT output our settings.
# 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
if [[ "${JAVA_OPTS}" == *-Xmx* ]] || [[ "${JAVA_OPTS}" == *-Xms* ]] || [[ "${JAVA_OPTS}" == *-XX:MaxPermSize* ]] || [[ "${JAVA_OPTS}" == *-XX:MaxMetaspaceSize* ]] || [[ "${JAVA_OPTS}" == *-XX:ReservedCodeCacheSize* ]]; then
echo ""
else
# a ham-fisted attempt to move some memory settings in concert
Expand All @@ -90,14 +84,10 @@ get_mem_opts () {
local codecache=$(( $mem / 8 ))
(( $codecache > 128 )) || codecache=128
(( $codecache < 512 )) || codecache=512
local class_metadata_size=$(( $codecache * 2 ))
local class_metadata_opt=$([[ "$java_version" < "1.8" ]] && echo "MaxPermSize" || echo "MaxMetaspaceSize")

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
echo "-Xms${mem}m -Xmx${mem}m -XX:ReservedCodeCacheSize=${codecache}m -XX:${class_metadata_opt}=${class_metadata_size}m"
fi
}

Expand Down Expand Up @@ -143,7 +133,7 @@ process_args () {
process_my_args "${myargs[@]}"
}

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

Expand Down Expand Up @@ -198,7 +188,7 @@ run() {
execRunner "$java_cmd" \
${SBT_OPTS:-$default_sbt_opts} \
$(get_mem_opts $sbt_mem) \
${java_opts} \
${JAVA_OPTS} \
${java_args[@]} \
-jar "$sbt_jar" \
"${sbt_commands[@]}" \
Expand All @@ -212,10 +202,3 @@ run() {
fi
exit $exit_code
}

runAlternateBoot() {
local bootpropsfile="$1"
shift
addJava "-Dsbt.boot.properties=$bootpropsfile"
run $@
}
Binary file added build/sbt-0.13.8/bin/sbt-launch.jar
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion sbt
6 changes: 3 additions & 3 deletions src/main/scala/com/davidsoergel/sbtbase/Dependencies.scala
Expand Up @@ -168,11 +168,11 @@ class Dependencies(globalModuleFilter: ModuleID => ModuleID = (m:ModuleID)=>m) {

def scalateCore(v: String = "latest.release") = "org.fusesource.scalate" % "scalate-core" % v applyGlobal()

def scalazCore(v: String = "7.0.5") = "org.scalaz" %% "scalaz-core" % v applyGlobal()
def scalazCore(v: String = "latest.release") = "org.scalaz" %% "scalaz-core" % v applyGlobal()

def scalazConcurrent(v: String = "7.0.5") = "org.scalaz" %% "scalaz-concurrent" % v applyGlobal()
def scalazConcurrent(v: String = "latest.release") = "org.scalaz" %% "scalaz-concurrent" % v applyGlobal()

def scalazTypelevel(v: String = "7.0.5") = "org.scalaz" %% "scalaz-typelevel" % v applyGlobal()
def scalazTypelevel(v: String = "latest.release") = "org.scalaz" %% "scalaz-typelevel" % v applyGlobal()

def scalaQuery(v: String = "latest.release") = "org.scalaquery" %% "scalaquery" % v applyGlobal()

Expand Down

0 comments on commit f248f64

Please sign in to comment.