I am trying to temporarily skip the compilation task when starting the package
task from the quick-install
command (defined in the sbt plugin that I am writing). I can skip all compilations by putting the skip
parameter in the compile
task, but this will skip
all compile
tasks:
object MyPlugin extends Plugin { override lazy val settings = Seq( (skip in compile) := true ) ... }
I only need to skip compile
when running my quick-install
command. Is there a way to temporarily change a setting or include it only in my quick install command?
I tried converting settings (based on https://github.com/harrah/xsbt/wiki/Advanced-Command-Example ), which should replace all instances of skip := false
with skip := true
, but it doesnโt have which any effect (i.e. compilation still occurs after conversion):
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
Any idea what I am missing and / or the best way to do this?
Edit:
The value of the omissions is a task, therefore an easy fix:
object SbtQuickInstallPlugin extends Plugin { private lazy val installCommand = Command.args("quick-install", "quick install that skips compile step")(doCommand(Configurations.Compile)) private var shouldSkipCompile = false
I'm not sure if this is the most reliable solution, but it works for what I need.
source share