我正试图package在quick-install命令中运行任务时暂时跳过编译任务(在我写的sbt插件中定义).我可以通过将skip设置放在compile任务上来跳过所有编译,但这会导致所有compile任务被跳过:
object MyPlugin extends Plugin {
override lazy val settings = Seq(
(skip in compile) := true
)
...
}
Run Code Online (Sandbox Code Playgroud)
我需要的是只compile在运行我的quick-install命令时跳过.有没有办法临时修改设置,或仅将其范围限定为我的快速安装命令?
我尝试过设置转换(基于https://github.com/harrah/xsbt/wiki/Advanced-Command-Example),它应该替换所有的skip := falsewith 实例skip := true,但它没有任何效果(即编译)转换后仍然发生):
object SbtQuickInstallPlugin extends Plugin {
private lazy val installCommand = Command.args("quick-install", "quick install that skips compile step")(doCommand(Configurations.Compile))
override lazy val settings = Seq(
commands ++= Seq(installCommand),
(Keys.skip in compile) := false // by …Run Code Online (Sandbox Code Playgroud) sbt ×1