Add scripted for bspInternalDependencyConfigurations

This commit is contained in:
Adrien Piquerez 2021-03-23 16:20:18 +01:00
parent 54c27d575b
commit 6bfe741052
2 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,19 @@
lazy val a = project.in(file("a")).dependsOn(b % Test)
lazy val b = project.in(file("b")).dependsOn(c)
lazy val c = project.in(file("c"))
def getConfigs(key: SettingKey[Seq[(ProjectRef, Set[ConfigKey])]]):
Def.Initialize[Map[String, Set[String]]] =
Def.setting(key.value.map { case (p, c) => p.project -> c.map(_.name) }.toMap)
TaskKey[Unit]("check") := {
val testDeps = getConfigs(a / Test / bspInternalDependencyConfigurations).value
val expected = Map(
"a" -> Set("compile", "test"),
"b" -> Set("compile"),
"c" -> Set("compile")
)
assert(testDeps == expected)
}

View File

@ -0,0 +1 @@
> check