Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No need for -- when using withDebug command #5737

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions project/WithDebugCommand.scala
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,28 @@ object WithDebugCommand {
val runCommandName = "run"
val testOnlyCommandName = "testOnly"

private def isDebugFlag(f : String): Boolean = f match {
case `dumpGraphsOption` => true
case `showCompilationsOptions` => true
case `printAssemblyOption` => true
case `debuggerOption` => true
case `benchOnlyCommandName` => true
case `runCommandName` => true
case `testOnlyCommandName` => true
case _ => false
}

/** The main logic for parsing and transforming the debug flags into JVM level flags */
def withDebug: Command =
Command.args(commandName, "<arguments>") { (state, args) =>
val (debugFlags, prefixedRunArgs) = args.span(_ != argSeparator)
val runArgs = " " + prefixedRunArgs.drop(1).mkString(" ")
var (debugFlags, prefixedRunArgs) = args.span(isDebugFlag(_))
System.err.println(prefixedRunArgs)
if (prefixedRunArgs(0) == argSeparator) {
prefixedRunArgs = prefixedRunArgs.drop(1)
}
System.err.println(debugFlags)
val runArgs = " " + prefixedRunArgs.mkString(" ")
System.err.println(runArgs)

val taskKey =
if (debugFlags.contains(benchOnlyCommandName)) BenchTasks.benchOnly
Expand Down