mirror of https://github.com/sbt/sbt.git
Merge pull request #4618 from dwijnand/Resolve-compilation-warnings-in-test/Delegates
Resolve compilation warnings in test/Delegates
This commit is contained in:
commit
cd7d42db76
|
|
@ -67,19 +67,21 @@ object Delegates extends Properties("delegates") {
|
||||||
allDelegates(keys) { (key, ds) =>
|
allDelegates(keys) { (key, ds) =>
|
||||||
key.project match {
|
key.project match {
|
||||||
case Zero => true // filtering out of testing
|
case Zero => true // filtering out of testing
|
||||||
case Select(ProjectRef(uri, _)) =>
|
case Select(rr: ResolvedReference) =>
|
||||||
val buildScoped = key.copy(project = Select(BuildRef(uri)))
|
rr match {
|
||||||
val idxKey = ds.indexOf(key)
|
case BuildRef(_) => ds.indexOf(key) < ds.indexOf(key.copy(project = Zero))
|
||||||
val idxB = ds.indexOf(buildScoped)
|
case ProjectRef(uri, _) =>
|
||||||
val z = key.copy(project = Zero)
|
val buildScoped = key.copy(project = Select(BuildRef(uri)))
|
||||||
val idxZ = ds.indexOf(z)
|
val idxKey = ds.indexOf(key)
|
||||||
if (z == Scope.GlobalScope) true
|
val idxB = ds.indexOf(buildScoped)
|
||||||
else {
|
val z = key.copy(project = Zero)
|
||||||
(s"idxKey = $idxKey; idxB = $idxB; idxZ = $idxZ") |:
|
val idxZ = ds.indexOf(z)
|
||||||
(idxKey < idxB) && (idxB < idxZ)
|
if (z == Scope.GlobalScope) true
|
||||||
|
else
|
||||||
|
(s"idxKey = $idxKey; idxB = $idxB; idxZ = $idxZ") |: (idxKey < idxB) && (idxB < idxZ)
|
||||||
}
|
}
|
||||||
case Select(BuildRef(_)) =>
|
case Select(_) | This =>
|
||||||
ds.indexOf(key) < ds.indexOf(key.copy(project = Zero))
|
throw new AssertionError(s"Scope's reference should be resolved, but was ${key.project}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -91,17 +93,11 @@ object Delegates extends Properties("delegates") {
|
||||||
case Select(config) if key.project.isSelect =>
|
case Select(config) if key.project.isSelect =>
|
||||||
val p = key.project.toOption.get
|
val p = key.project.toOption.get
|
||||||
val r = keys.env.resolve(p)
|
val r = keys.env.resolve(p)
|
||||||
val proj = keys.env.projectFor(r)
|
keys.env.inheritConfig(r, config).headOption.fold(Prop(true)) { parent =>
|
||||||
val inh: Vector[ConfigKey] = keys.env.inheritConfig(r, config)
|
|
||||||
val conf = proj.confMap(config.name)
|
|
||||||
if (inh.isEmpty) true
|
|
||||||
else {
|
|
||||||
val idxKey = ds.indexOf(key)
|
val idxKey = ds.indexOf(key)
|
||||||
val parent = inh.head
|
|
||||||
val a = key.copy(config = Select(parent))
|
val a = key.copy(config = Select(parent))
|
||||||
val idxA = ds.indexOf(a)
|
val idxA = ds.indexOf(a)
|
||||||
(s"idxKey = $idxKey; a = $a; idxA = $idxA") |:
|
(s"idxKey = $idxKey; a = $a; idxA = $idxA") |: idxKey < idxA
|
||||||
idxKey < idxA
|
|
||||||
}
|
}
|
||||||
case _ => true
|
case _ => true
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue