Skip to content

Instantly share code, notes, and snippets.

@gseitz
Created February 19, 2013 22:52
Show Gist options
  • Save gseitz/4990968 to your computer and use it in GitHub Desktop.
Save gseitz/4990968 to your computer and use it in GitHub Desktop.
SBT task for running all main classes
import sbt._
import Keys._
import Build.data
object build extends Build {
lazy val runAll = TaskKey[Unit]("run-all")
lazy val standardSettings = Seq(
runAllIn(Compile)
)
def runAllIn(config: Configuration) = {
runAll in config <<= (discoveredMainClasses in config, runner in run, fullClasspath in config, streams) map {
(classes, runner, cp, s) => classes.foreach(c => runner.run(c, data(cp), Seq(), s.log))
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment