More plugins conflict test

This commit is contained in:
Eugene Yokota 2014-03-21 22:45:32 -04:00
parent e95935a7db
commit d692191c24
3 changed files with 66 additions and 0 deletions

View File

@ -0,0 +1,7 @@
// with S selected, Q is loaded automatically, which in turn selects R
lazy val projA = project.addPlugins(S)
// S and T have direct conflicts of dependent plugins.
lazy val projB = project.addPlugins(S, T)
check := ()

View File

@ -0,0 +1,58 @@
import sbt._
object AI extends AutoImport
{
trait EmptyAutoPlugin extends AutoPlugin {
def requires = empty
def trigger = noTrigger
}
object A extends EmptyAutoPlugin {
val a = settingKey[String]("")
override def projectSettings = Seq(a := "a")
}
object B extends EmptyAutoPlugin {
val b = settingKey[String]("")
override def projectSettings = Seq(b := "b")
}
lazy val check = settingKey[Unit]("Verifies settings are as they should be.")
}
import AI._
object Q extends AutoPlugin
{
def requires: Plugins = A && B
def trigger = allRequirements
val q = settingKey[String]("")
override def projectSettings = Seq(q := "q")
}
object R extends AutoPlugin
{
def requires = Q
def trigger = allRequirements
val r = settingKey[String]("")
override def projectSettings = Seq(r := "r")
}
// This is an opt-in plugin with a requirement
// Unless explicitly loaded by the build user, this will not be activated.
object S extends AutoPlugin
{
def requires = Q && !R
def trigger = noTrigger
val s = settingKey[String]("")
override def projectSettings = Seq(s := "s")
}
// This is an opt-in plugin with a requirement
// Unless explicitly loaded by the build user, this will not be activated.
object T extends AutoPlugin
{
def requires = A && !Q
def trigger = noTrigger
val t = settingKey[String]("")
override def projectSettings = Seq(t := "T")
}

View File

@ -0,0 +1 @@
-> check