Skip to content

Instantly share code, notes, and snippets.

@joost-de-vries
Forked from xuwei-k/scalap.sbt
Last active August 29, 2015 14:15
Show Gist options
  • Save joost-de-vries/952a1a8769e587c35ded to your computer and use it in GitHub Desktop.
Save joost-de-vries/952a1a8769e587c35ded to your computer and use it in GitHub Desktop.
run scalap for your project from sbt
scalaVersion := "2.11.4"
libraryDependencies += "org.scala-lang" % "scalap" % scalaVersion.value
InputKey[Unit]("scalap") := {
import complete.DefaultParsers._
val classes = spaceDelimited("<class names>").parsed
val pathSeparator = java.lang.System.getProperty("path.separator")
val classpath = "-classpath" :: (fullClasspath in Compile).value.map(_.data).mkString(pathSeparator) :: Nil
val args = "-verbose" :: classpath ::: classes.toList
scala.tools.scalap.Main main args.toArray
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment