diff --git a/sbt/src/sbt-test/dependency-management/cached-resolution-configurations/a/A.scala b/sbt/src/sbt-test/dependency-management/cached-resolution-configurations/a/A.scala new file mode 100644 index 000000000..4e33d90d9 --- /dev/null +++ b/sbt/src/sbt-test/dependency-management/cached-resolution-configurations/a/A.scala @@ -0,0 +1,5 @@ +package a + +object A { + romanowski.sbt.bug.MissingClass("A") +} diff --git a/sbt/src/sbt-test/dependency-management/cached-resolution-configurations/b/B.scala b/sbt/src/sbt-test/dependency-management/cached-resolution-configurations/b/B.scala new file mode 100644 index 000000000..acf3023b8 --- /dev/null +++ b/sbt/src/sbt-test/dependency-management/cached-resolution-configurations/b/B.scala @@ -0,0 +1,5 @@ +package b + +object B { + romanowski.sbt.bug.MissingClass("A") +} diff --git a/sbt/src/sbt-test/dependency-management/cached-resolution-configurations/build.sbt b/sbt/src/sbt-test/dependency-management/cached-resolution-configurations/build.sbt new file mode 100644 index 000000000..aac69610f --- /dev/null +++ b/sbt/src/sbt-test/dependency-management/cached-resolution-configurations/build.sbt @@ -0,0 +1,28 @@ +def commonSettings: Vector[Def.Setting[_]] = + Vector( + organization := "com.example", + ivyPaths := IvyPaths( (baseDirectory in ThisBuild).value, Some((baseDirectory in LocalRootProject).value / "ivy-cache")), + dependencyCacheDirectory := (baseDirectory in LocalRootProject).value / "dependency", + resolvers += Resolver.file("buggy", (baseDirectory in LocalRootProject).value / "repo")( + Patterns( + ivyPatterns = Vector("[organization]/[module]/[revision]/ivy.xml"), + artifactPatterns = Vector("[organization]/[module]/[revision]/[artifact]"), + isMavenCompatible = false, + descriptorOptional = true, + skipConsistencyCheck = true + ) + ) + ) + +lazy val a = project settings( + commonSettings, + updateOptions := updateOptions.value.withCachedResolution(true), //comment this line to make ws compile + libraryDependencies += "a" % "b" % "1.0.0" % "compile->runtime", + libraryDependencies += "a" % "b" % "1.0.0" % "compile->runtime2" +) + +lazy val b = project dependsOn(a) settings( + commonSettings, + updateOptions := updateOptions.value.withCachedResolution(true), //comment this line to make ws compile + libraryDependencies += "a" % "b" % "1.0.1" % "compile->runtime" +) diff --git a/sbt/src/sbt-test/dependency-management/cached-resolution-configurations/repo/a/b/1.0.0/b1.jar b/sbt/src/sbt-test/dependency-management/cached-resolution-configurations/repo/a/b/1.0.0/b1.jar new file mode 100644 index 000000000..619fa9368 Binary files /dev/null and b/sbt/src/sbt-test/dependency-management/cached-resolution-configurations/repo/a/b/1.0.0/b1.jar differ diff --git a/sbt/src/sbt-test/dependency-management/cached-resolution-configurations/repo/a/b/1.0.0/b2.jar b/sbt/src/sbt-test/dependency-management/cached-resolution-configurations/repo/a/b/1.0.0/b2.jar new file mode 100644 index 000000000..619fa9368 Binary files /dev/null and b/sbt/src/sbt-test/dependency-management/cached-resolution-configurations/repo/a/b/1.0.0/b2.jar differ diff --git a/sbt/src/sbt-test/dependency-management/cached-resolution-configurations/repo/a/b/1.0.0/b3.jar b/sbt/src/sbt-test/dependency-management/cached-resolution-configurations/repo/a/b/1.0.0/b3.jar new file mode 100644 index 000000000..1c3f8c4e1 Binary files /dev/null and b/sbt/src/sbt-test/dependency-management/cached-resolution-configurations/repo/a/b/1.0.0/b3.jar differ diff --git a/sbt/src/sbt-test/dependency-management/cached-resolution-configurations/repo/a/b/1.0.0/ivy.xml b/sbt/src/sbt-test/dependency-management/cached-resolution-configurations/repo/a/b/1.0.0/ivy.xml new file mode 100644 index 000000000..19fab2e82 --- /dev/null +++ b/sbt/src/sbt-test/dependency-management/cached-resolution-configurations/repo/a/b/1.0.0/ivy.xml @@ -0,0 +1,16 @@ + + + a + + + + + + + + + + + + + diff --git a/sbt/src/sbt-test/dependency-management/cached-resolution-configurations/repo/a/b/1.0.1/b1.jar b/sbt/src/sbt-test/dependency-management/cached-resolution-configurations/repo/a/b/1.0.1/b1.jar new file mode 100644 index 000000000..619fa9368 Binary files /dev/null and b/sbt/src/sbt-test/dependency-management/cached-resolution-configurations/repo/a/b/1.0.1/b1.jar differ diff --git a/sbt/src/sbt-test/dependency-management/cached-resolution-configurations/repo/a/b/1.0.1/b2.jar b/sbt/src/sbt-test/dependency-management/cached-resolution-configurations/repo/a/b/1.0.1/b2.jar new file mode 100644 index 000000000..619fa9368 Binary files /dev/null and b/sbt/src/sbt-test/dependency-management/cached-resolution-configurations/repo/a/b/1.0.1/b2.jar differ diff --git a/sbt/src/sbt-test/dependency-management/cached-resolution-configurations/repo/a/b/1.0.1/b3.jar b/sbt/src/sbt-test/dependency-management/cached-resolution-configurations/repo/a/b/1.0.1/b3.jar new file mode 100644 index 000000000..1c3f8c4e1 Binary files /dev/null and b/sbt/src/sbt-test/dependency-management/cached-resolution-configurations/repo/a/b/1.0.1/b3.jar differ diff --git a/sbt/src/sbt-test/dependency-management/cached-resolution-configurations/repo/a/b/1.0.1/ivy.xml b/sbt/src/sbt-test/dependency-management/cached-resolution-configurations/repo/a/b/1.0.1/ivy.xml new file mode 100644 index 000000000..a734f26d0 --- /dev/null +++ b/sbt/src/sbt-test/dependency-management/cached-resolution-configurations/repo/a/b/1.0.1/ivy.xml @@ -0,0 +1,16 @@ + + + a + + + + + + + + + + + + + diff --git a/sbt/src/sbt-test/dependency-management/cached-resolution-configurations/test b/sbt/src/sbt-test/dependency-management/cached-resolution-configurations/test new file mode 100644 index 000000000..6fdf810e0 --- /dev/null +++ b/sbt/src/sbt-test/dependency-management/cached-resolution-configurations/test @@ -0,0 +1,11 @@ +# In this test, we have a project `a`, on which a project `b` depends. +# project `a` has a library dependency on: +# - "a" % "b" % "1.0.0" % "compile->runtime" +# - "a" % "b" % "1.0.0" % "compile->runtime2" +# project "b" depends on: +# - project `a` +# - "b" % "b" % "1.0.1" % "compile->runtime" +# "a" % "b" % "1.0.0" will be evicted in favor of "a" % "b" % "1.0.1", but we +# have to keep the dependency on the two configurations "runtime" and "runtime2". +# This test makes sure that we actually do. +> compile