From 6b4ec33ea0e437e04933273e7b3d4c4e20ff08b8 Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Tue, 28 Oct 2014 16:27:55 -0400 Subject: [PATCH] modify test that test transitive force This test relies on force having effect transitively for cached resolution. --- .../cached-resolution2/multi.sbt | 67 ++++++++++++++----- 1 file changed, 49 insertions(+), 18 deletions(-) diff --git a/sbt/src/sbt-test/dependency-management/cached-resolution2/multi.sbt b/sbt/src/sbt-test/dependency-management/cached-resolution2/multi.sbt index a3c3d5a87..380e0cc65 100644 --- a/sbt/src/sbt-test/dependency-management/cached-resolution2/multi.sbt +++ b/sbt/src/sbt-test/dependency-management/cached-resolution2/multi.sbt @@ -4,12 +4,6 @@ def commonSettings: Seq[Def.Setting[_]] = Seq( ivyPaths := new IvyPaths( (baseDirectory in ThisBuild).value, Some((baseDirectory in LocalRootProject).value / "ivy-cache")), dependencyCacheDirectory := (baseDirectory in LocalRootProject).value / "dependency", - libraryDependencies := Seq( - "org.springframework" % "spring-core" % "3.2.2.RELEASE" force() exclude("org.springframework", "spring-asm"), - "org.springframework" % "spring-tx" % "3.1.2.RELEASE" force() exclude("org.springframework", "spring-asm"), - "org.springframework" % "spring-beans" % "3.2.2.RELEASE" force() exclude("org.springframework", "spring-asm"), - "org.springframework" % "spring-context" % "3.1.2.RELEASE" force() exclude("org.springframework", "spring-asm") - ), scalaVersion := "2.10.4", resolvers += Resolver.sonatypeRepo("snapshots") ) @@ -20,17 +14,44 @@ def cachedResolutionSettings: Seq[Def.Setting[_]] = ) lazy val a = project. - settings(cachedResolutionSettings: _*) + settings(cachedResolutionSettings: _*). + settings( + libraryDependencies := Seq( + "org.springframework" % "spring-core" % "3.2.2.RELEASE" force() exclude("org.springframework", "spring-asm"), + "org.springframework" % "spring-tx" % "3.1.2.RELEASE" force() exclude("org.springframework", "spring-asm"), + "org.springframework" % "spring-beans" % "3.2.2.RELEASE" force() exclude("org.springframework", "spring-asm"), + "org.springframework" % "spring-context" % "3.1.2.RELEASE" force() exclude("org.springframework", "spring-asm") + ) + ) lazy val b = project. - settings(commonSettings: _*) + settings(commonSettings: _*). + settings( + libraryDependencies := Seq( + "org.springframework" % "spring-core" % "3.2.2.RELEASE" force() exclude("org.springframework", "spring-asm"), + "org.springframework" % "spring-tx" % "3.1.2.RELEASE" force() exclude("org.springframework", "spring-asm"), + "org.springframework" % "spring-beans" % "3.2.2.RELEASE" force() exclude("org.springframework", "spring-asm"), + "org.springframework" % "spring-context" % "3.1.2.RELEASE" force() exclude("org.springframework", "spring-asm") + ) + ) lazy val c = project. dependsOn(a). settings(cachedResolutionSettings: _*). settings( libraryDependencies := Seq( - "org.springframework" % "spring-core" % "4.0.3.RELEASE" exclude("org.springframework", "spring-asm") + // transitive force seems to be broken in ivy + // "org.springframework" % "spring-core" % "4.0.3.RELEASE" exclude("org.springframework", "spring-asm") + ) + ) + +lazy val d = project. + dependsOn(b). + settings(commonSettings: _*). + settings( + libraryDependencies := Seq( + // transitive force seems to be broken in ivy + // "org.springframework" % "spring-core" % "4.0.3.RELEASE" exclude("org.springframework", "spring-asm") ) ) @@ -44,29 +65,39 @@ lazy val root = (project in file(".")). val acp = (externalDependencyClasspath in Compile in a).value.sortBy {_.data.getName} val bcp = (externalDependencyClasspath in Compile in b).value.sortBy {_.data.getName} val ccp = (externalDependencyClasspath in Compile in c).value.sortBy {_.data.getName} + val dcp = (externalDependencyClasspath in Compile in d).value.sortBy {_.data.getName} if (!(acp exists {_.data.getName contains "spring-core-3.2.2.RELEASE"})) { - sys.error("spring-core-3.2.2 is not found") + sys.error("spring-core-3.2.2 is not found on a") } if (!(bcp exists {_.data.getName contains "spring-core-3.2.2.RELEASE"})) { - sys.error("spring-core-3.2.2 is not found") + sys.error("spring-core-3.2.2 is not found on b") } if (!(ccp exists {_.data.getName contains "spring-core-3.2.2.RELEASE"})) { - sys.error("spring-core-3.2.2 is not found") + sys.error("spring-core-3.2.2 is not found on c") + } + if (!(dcp exists {_.data.getName contains "spring-core-3.2.2.RELEASE"})) { + sys.error("spring-core-3.2.2 is not found on d\n" + dcp.toString) } if (!(acp exists {_.data.getName contains "spring-tx-3.1.2.RELEASE"})) { - sys.error("spring-tx-3.1.2 is not found") + sys.error("spring-tx-3.1.2 is not found on a") } if (!(bcp exists {_.data.getName contains "spring-tx-3.1.2.RELEASE"})) { - sys.error("spring-tx-3.1.2 is not found") + sys.error("spring-tx-3.1.2 is not found on b") } if (!(ccp exists {_.data.getName contains "spring-tx-3.1.2.RELEASE"})) { - sys.error("spring-tx-3.1.2 is not found") + sys.error("spring-tx-3.1.2 is not found on c") } - if (acp == bcp && acp == ccp) () + if (!(dcp exists {_.data.getName contains "spring-tx-3.1.2.RELEASE"})) { + sys.error("spring-tx-3.1.2 is not found on d") + } + if (acp == bcp) () else sys.error("Different classpaths are found:" + "\n - a (consolidated) " + acp.toString + - "\n - b (plain) " + bcp.toString + - "\n - c (inter-project) " + ccp.toString) + "\n - b (plain) " + bcp.toString) + if (ccp == dcp) () + else sys.error("Different classpaths are found:" + + "\n - c (consolidated) " + ccp.toString + + "\n - d (plain) " + dcp.toString) } )