From 6a0c5c6a3e989b470f83148627f48fdf6888e6c1 Mon Sep 17 00:00:00 2001 From: eugene yokota Date: Sun, 24 Apr 2016 13:28:28 -0400 Subject: [PATCH] Fixes #2573 (#2574) Fixes dependency-management /cached-resolution-configurations Ref #2513, #2435 --- .../build.sbt | 38 +++++++++++-------- 1 file changed, 22 insertions(+), 16 deletions(-) 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 index 3665d3634..10453a7ed 100644 --- a/sbt/src/sbt-test/dependency-management/cached-resolution-configurations/build.sbt +++ b/sbt/src/sbt-test/dependency-management/cached-resolution-configurations/build.sbt @@ -1,22 +1,28 @@ -def myResolver = resolvers += Resolver.file("buggy", file("repo"))( - Patterns( - ivyPatterns = Seq("[organization]/[module]/[revision]/ivy.xml"), - artifactPatterns = Seq("[organization]/[module]/[revision]/[artifact]"), - isMavenCompatible = false, - descriptorOptional = true, - skipConsistencyCheck = true - ) -) +def commonSettings: Seq[Def.Setting[_]] = + Seq( + organization := "com.example", + ivyPaths := new 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 = Seq("[organization]/[module]/[revision]/ivy.xml"), + artifactPatterns = Seq("[organization]/[module]/[revision]/[artifact]"), + isMavenCompatible = false, + descriptorOptional = true, + skipConsistencyCheck = true + ) + ) + ) lazy val a = project settings( - myResolver, - 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" + 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( - myResolver, - updateOptions := updateOptions.value.withCachedResolution(true), //comment this line to make ws compile - libraryDependencies += "a" % "b" % "1.0.1" % "compile->runtime" + commonSettings, + updateOptions := updateOptions.value.withCachedResolution(true), //comment this line to make ws compile + libraryDependencies += "a" % "b" % "1.0.1" % "compile->runtime" )