Skip to content

Instantly share code, notes, and snippets.

@ogrodnek
Created August 4, 2016 04:12
Show Gist options
  • Save ogrodnek/374063c97f44d2970e84b29357d61b63 to your computer and use it in GitHub Desktop.
Save ogrodnek/374063c97f44d2970e84b29357d61b63 to your computer and use it in GitHub Desktop.
#!/bin/bash -e
set -x
SBT_HOME=/tmp/sbt
if ! [ -d $SBT_HOME ]; then
mkdir -p $SBT_HOME/bin
curl -L https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt-launch/0.13.12/sbt-launch.jar -o $SBT_HOME/bin/sbt-launch.jar
cat << "EOF" > $SBT_HOME/bin/sbt
#!/bin/bash
SBT_OPTS="-Xms512M -Xmx1536M -Xss1M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256M"
java $SBT_OPTS -jar `dirname $0`/sbt-launch.jar "$@"
EOF
fi
chmod u+x $SBT_HOME/bin/sbt
export PATH=$SBT_HOME/bin:$PATH
@ogrodnek
Copy link
Author

Hello @hayd yes, ok to license under MIT -- i'd also be fine with public domain -- whatever is easiest.

It's been working ok. The sbt/ivy dependency resolution takes a long time and in some cases brings be dangerously close to the 5 minute mark :). I'm hoping support for caching will help there -- lambci/lambci#38

The one other thing is I have this script copy/pasted to a few projects. Would be cool if there was some kind of plugin support in lamb...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment