Skip to content

Instantly share code, notes, and snippets.

@ashawley
Created May 25, 2016 17:47
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 ashawley/eaff3996a648d9339edb15b036870be3 to your computer and use it in GitHub Desktop.
Save ashawley/eaff3996a648d9339edb15b036870be3 to your computer and use it in GitHub Desktop.
runMany: repeat runMain task in SBT
lazy val runMany = inputKey[Unit]("Run a main class X times.")
// > runMany 8 my.Benchmark args ...
runMany in Compile := {
import complete.DefaultParsers._
val x = token(Space ~> IntBasic, "times to run").parsed
val runAgain = (runMain in Compile).parsed
for {
i <- 1 to x
} yield {
runAgain.value
}
}
build.sbt:15: error: Illegal dynamic reference: runAgain
runAgain.value
^
package proj
object Main extends App
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment