Fix strict switch command so +task is fixed

This commit is contained in:
Eugene Yokota 2020-04-24 01:18:16 -04:00
parent 11a403251a
commit 0a5c2edddf
1 changed files with 11 additions and 8 deletions

View File

@ -203,7 +203,7 @@ object Cross {
case Seq(c) => Seq(s"$SwitchCommand $verbose $v $c") case Seq(c) => Seq(s"$SwitchCommand $verbose $v $c")
case Seq() => Nil // should be unreachable case Seq() => Nil // should be unreachable
case multi if fullArgs.isEmpty => case multi if fullArgs.isEmpty =>
Seq(s"$SwitchCommand $verbose $v! all ${multi.mkString(" ")}") Seq(s"$SwitchCommand $verbose $v all ${multi.mkString(" ")}")
case multi => Seq(s"$SwitchCommand $verbose $v") ++ multi case multi => Seq(s"$SwitchCommand $verbose $v") ++ multi
} }
} }
@ -247,15 +247,18 @@ object Cross {
if (args.version.force) { if (args.version.force) {
// The Scala version was forced on the whole build, run as is // The Scala version was forced on the whole build, run as is
args.command args.command
} else { } else
args.command.map { rawCmd => args.command.map { rawCmd =>
val (aggs, aggCommand) = parseSlashCommand(Project.extract(state))(rawCmd) // for now, treat `all` command specially
aggs if (rawCmd.startsWith("all ")) rawCmd
.intersect(affectedRefs) else {
.map({ case ProjectRef(_, proj) => s"$proj/$aggCommand" }) val (aggs, aggCommand) = parseSlashCommand(Project.extract(state))(rawCmd)
.mkString("all ", " ", "") aggs
.intersect(affectedRefs)
.map({ case ProjectRef(_, proj) => s"$proj/$aggCommand" })
.mkString("all ", " ", "")
}
} }
}
strictCmd.toList ::: switchedState strictCmd.toList ::: switchedState
} }