Created
May 25, 2016 17:47
-
-
Save ashawley/eaff3996a648d9339edb15b036870be3 to your computer and use it in GitHub Desktop.
runMany: repeat runMain task in SBT
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
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 | |
} | |
} |
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
build.sbt:15: error: Illegal dynamic reference: runAgain | |
runAgain.value | |
^ |
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
package proj | |
object Main extends App |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment