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