mirror of https://github.com/sbt/sbt.git
Merge pull request #1713 from sbt/fix/1710
Fixes cached resolution mutual eviction (drops slf4j)
This commit is contained in:
commit
c8f2f04dde
|
|
@ -321,7 +321,7 @@ private[sbt] trait CachedResolutionResolveEngine extends ResolveEngine {
|
||||||
val merged = (modules groupBy { m => (m.module.organization, m.module.name, m.module.revision) }).toSeq.toVector flatMap {
|
val merged = (modules groupBy { m => (m.module.organization, m.module.name, m.module.revision) }).toSeq.toVector flatMap {
|
||||||
case ((org, name, version), xs) =>
|
case ((org, name, version), xs) =>
|
||||||
if (xs.size < 2) xs
|
if (xs.size < 2) xs
|
||||||
else Vector(xs.head.copy(evicted = xs exists { _.evicted }, callers = xs flatMap { _.callers }))
|
else Vector(xs.head.copy(evicted = xs forall { _.evicted }, callers = xs flatMap { _.callers }))
|
||||||
}
|
}
|
||||||
val conflicts = merged filter { m => !m.evicted && m.problem.isEmpty }
|
val conflicts = merged filter { m => !m.evicted && m.problem.isEmpty }
|
||||||
if (conflicts.size < 2) merged
|
if (conflicts.size < 2) merged
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,62 @@
|
||||||
|
// https://github.com/sbt/sbt/issues/1710
|
||||||
|
lazy val check = taskKey[Unit]("Runs the check")
|
||||||
|
|
||||||
|
def commonSettings: Seq[Def.Setting[_]] =
|
||||||
|
Seq(
|
||||||
|
organization := "com.example",
|
||||||
|
version := "0.1.0",
|
||||||
|
ivyPaths := new IvyPaths( (baseDirectory in ThisBuild).value, Some((baseDirectory in LocalRootProject).value / "ivy-cache")),
|
||||||
|
dependencyCacheDirectory := (baseDirectory in LocalRootProject).value / "dependency",
|
||||||
|
scalaVersion := "2.10.4",
|
||||||
|
fullResolvers := fullResolvers.value.filterNot(_.name == "inter-project")
|
||||||
|
)
|
||||||
|
|
||||||
|
def cachedResolutionSettings: Seq[Def.Setting[_]] =
|
||||||
|
commonSettings ++ Seq(
|
||||||
|
updateOptions := updateOptions.value.withCachedResolution(true)
|
||||||
|
)
|
||||||
|
|
||||||
|
lazy val X1 = project.
|
||||||
|
settings(commonSettings: _*).
|
||||||
|
settings(
|
||||||
|
libraryDependencies ++= Seq(
|
||||||
|
"com.example" %% "y1" % "0.1.0" % "compile->compile;runtime->runtime",
|
||||||
|
"com.example" %% "y2" % "0.1.0" % "compile->compile;runtime->runtime")
|
||||||
|
)
|
||||||
|
|
||||||
|
lazy val Y1 = project.
|
||||||
|
settings(commonSettings: _*).
|
||||||
|
settings(
|
||||||
|
name := "y1",
|
||||||
|
libraryDependencies ++= Seq(
|
||||||
|
// this includes slf4j 1.7.5
|
||||||
|
"com.ning" % "async-http-client" % "1.8.14",
|
||||||
|
// this includes slf4j 1.6.6
|
||||||
|
"com.twitter" % "summingbird-core_2.10" % "0.5.0",
|
||||||
|
"org.slf4j" % "slf4j-api" % "1.6.6" force()
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
lazy val Y2 = project.
|
||||||
|
settings(commonSettings: _*).
|
||||||
|
settings(
|
||||||
|
name := "y2",
|
||||||
|
libraryDependencies ++= Seq(
|
||||||
|
// this includes slf4j 1.6.6
|
||||||
|
"com.twitter" % "summingbird-core_2.10" % "0.5.0",
|
||||||
|
// this includes slf4j 1.7.5
|
||||||
|
"com.ning" % "async-http-client" % "1.8.14")
|
||||||
|
)
|
||||||
|
|
||||||
|
lazy val root = (project in file(".")).
|
||||||
|
settings(
|
||||||
|
organization in ThisBuild := "org.example",
|
||||||
|
version in ThisBuild := "1.0",
|
||||||
|
check := {
|
||||||
|
val x1cp = (externalDependencyClasspath in Compile in X1).value.sortBy {_.data.getName}
|
||||||
|
// sys.error("slf4j-api is not found on X1" + x1cp)
|
||||||
|
if (!(x1cp exists {_.data.getName contains "slf4j-api"})) {
|
||||||
|
sys.error("slf4j-api is not found on X1" + x1cp)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
> debug
|
||||||
|
|
||||||
|
> Y1/publishLocal
|
||||||
|
|
||||||
|
> Y2/publishLocal
|
||||||
|
|
||||||
|
> check
|
||||||
Loading…
Reference in New Issue