Created
February 19, 2013 22:52
-
-
Save gseitz/4990968 to your computer and use it in GitHub Desktop.
SBT task for running all main classes
This file contains 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
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