Skip to content

Instantly share code, notes, and snippets.

@xuwei-k
Created September 20, 2019 08:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xuwei-k/6b97b8e4a93f7a74fab270c0cb1ed4df to your computer and use it in GitHub Desktop.
Save xuwei-k/6b97b8e4a93f7a74fab270c0cb1ed4df to your computer and use it in GitHub Desktop.
val runAll = taskKey[Unit]("run all main")
runAllIn(Compile)
def runAllIn(config: Configuration) = {
runAll in config := {
val r = (runner in run).value
val classpath = (fullClasspath in config).value
val log = streams.value.log
(discoveredMainClasses in config).value.foreach(c =>
r.run(c, classpath.map(_.data), Nil, log)
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment