Last active
August 28, 2016 19:00
-
-
Save paulp/5fed2db283ec28442cfee0a465dcf437 to your computer and use it in GitHub Desktop.
A script for running typelevel scala.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # | |
| run () { echo >&2 "$@" && "$@"; } | |
| typelevel () { | |
| coursier fetch org.typelevel:scala-compiler:2.11.8 | paste -sd: - | |
| } | |
| ammonite () { | |
| coursier fetch com.lihaoyi:ammonite_2.11.8:0.7.2 | egrep -vw 'scala-lang' | paste -sd: - | |
| } | |
| CP="$(typelevel)" | |
| MAIN="scala.tools.nsc.Main" | |
| ARGS=( -usejavacp ) | |
| case "$1" in | |
| compile) shift ;; | |
| repl) shift && MAIN="scala.tools.nsc.MainGenericRunner" ;; | |
| amm) shift && MAIN="ammonite.Main" && CP="$CP:$(ammonite)" && ARGS=() ;; | |
| esac | |
| run java -cp "$CP" "$MAIN" "${ARGS[@]}" -Yliteral-types -Ypartial-unification "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment