mirror of https://github.com/sbt/sbt.git
Add exclusion/optional merging test
Would not expect this to pass before 524ed3320b
This commit is contained in:
parent
474a4a01f6
commit
dddc750df3
|
|
@ -123,7 +123,21 @@ object ResolverTests extends TestSuite {
|
||||||
properties = Map("special" -> "true"),
|
properties = Map("special" -> "true"),
|
||||||
profiles = Seq(
|
profiles = Seq(
|
||||||
Profile("default", activation = Profile.Activation(properties = Seq("special" -> Some("!false"))), dependencies = Seq(
|
Profile("default", activation = Profile.Activation(properties = Seq("special" -> Some("!false"))), dependencies = Seq(
|
||||||
Dependency(Module("org.escalier", "librairie-standard"), "2.11.6")))))
|
Dependency(Module("org.escalier", "librairie-standard"), "2.11.6"))))),
|
||||||
|
|
||||||
|
Project(Module("an-org", "a-name"), "1.0"),
|
||||||
|
|
||||||
|
Project(Module("an-org", "a-lib"), "1.0",
|
||||||
|
Seq(Dependency(Module("an-org", "a-name"), "1.0"))),
|
||||||
|
|
||||||
|
Project(Module("an-org", "another-lib"), "1.0",
|
||||||
|
Seq(Dependency(Module("an-org", "a-name"), "1.0"))),
|
||||||
|
|
||||||
|
// Must bring transitively an-org:a-name, as an optional dependency
|
||||||
|
Project(Module("an-org", "an-app"), "1.0",
|
||||||
|
Seq(
|
||||||
|
Dependency(Module("an-org", "a-lib"), "1.0", exclusions = Set(("an-org", "a-name"))),
|
||||||
|
Dependency(Module("an-org", "another-lib"), "1.0", optional = true)))
|
||||||
)
|
)
|
||||||
|
|
||||||
val projectsMap = projects.map(p => p.moduleVersion -> p).toMap
|
val projectsMap = projects.map(p => p.moduleVersion -> p).toMap
|
||||||
|
|
@ -433,6 +447,28 @@ object ResolverTests extends TestSuite {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
'exclusionsAndOptionalShouldGoAlong{
|
||||||
|
async {
|
||||||
|
val dep = Dependency(Module("an-org", "an-app"), "1.0")
|
||||||
|
val trDeps = Seq(
|
||||||
|
Dependency(Module("an-org", "a-lib"), "1.0", exclusions = Set(("an-org", "a-name"))),
|
||||||
|
Dependency(Module("an-org", "another-lib"), "1.0", optional = true),
|
||||||
|
Dependency(Module("an-org", "a-name"), "1.0", optional = true))
|
||||||
|
val res = await(resolve(
|
||||||
|
Set(dep),
|
||||||
|
fetchFrom(repositories),
|
||||||
|
filter = Some(_.scope == Scope.Compile)
|
||||||
|
).runF).copy(filter = None, projectsCache = Map.empty, errors = Map.empty)
|
||||||
|
|
||||||
|
val expected = Resolution(
|
||||||
|
rootDependencies = Set(dep.withCompileScope),
|
||||||
|
dependencies = Set(dep.withCompileScope) ++ trDeps.map(_.withCompileScope)
|
||||||
|
)
|
||||||
|
|
||||||
|
assert(res == expected)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
'parts{
|
'parts{
|
||||||
'propertySubstitution{
|
'propertySubstitution{
|
||||||
val res =
|
val res =
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue