I am writing an sbt plugin to abstract some of the patterns associated with a few common plugins that I use. In this quest, one of the plugins that I am trying to configure has a value of requires for noTrigger , for which you need to explicitly enable the plugin in the project settings.
With SBT AutoPlugin, if I set requires = BuildInfoPlugin and trigger = allRequirements , then the settings will automatically load if I explicitly enable the base plugin, or if I set trigger = noTrigger as above, then explicitly adding the plugin to which I work on also imports the base plugin.
object BuildInformation extends AutoPlugin { override def requires = BuildInfoPlugin override def trigger = allRequirements }
.
object BuildInformation extends AutoPlugin { override def requires = BuildInfoPlugin }
Is there a way for a derivative plugin to explicitly import the underlying plugin without requiring it to be explicitly added to the derived plugin? (For example, the PlayScala plugin from PlayFramework downloads sbt-native-packager and download it, but PlayScala must be explicitly enabled)
One thing that I was thinking about is simply extending the base plugin, and overriding this method launches the allRequirements method, but it was interesting to see if there is a cleaner / more preferable method.
scala sbt
Lykathia
source share