mirror of https://github.com/sbt/sbt.git
Port dependency-management/cache-resolver
This commit is contained in:
parent
a1a1711106
commit
33c7db17c5
|
|
@ -2,9 +2,6 @@ ivyPaths in ThisBuild := {
|
||||||
val base = (baseDirectory in ThisBuild).value
|
val base = (baseDirectory in ThisBuild).value
|
||||||
new IvyPaths(base, Some(base / "ivy-cache"))
|
new IvyPaths(base, Some(base / "ivy-cache"))
|
||||||
}
|
}
|
||||||
|
|
||||||
managedScalaInstance in ThisBuild := false
|
managedScalaInstance in ThisBuild := false
|
||||||
|
|
||||||
autoScalaLibrary in ThisBuild := false
|
autoScalaLibrary in ThisBuild := false
|
||||||
|
|
||||||
crossPaths in ThisBuild := false
|
crossPaths in ThisBuild := false
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
lazy val root = (project in file(".")).
|
||||||
|
aggregate(a,b).
|
||||||
|
settings(
|
||||||
|
name := "use",
|
||||||
|
version := "1.0",
|
||||||
|
organization in ThisBuild := "org.example",
|
||||||
|
version in ThisBuild := "2.0-SNAPSHOT",
|
||||||
|
libraryDependencies += "org.example" % "b" % "2.0-SNAPSHOT",
|
||||||
|
ivyPaths := (ivyPaths in ThisBuild).value
|
||||||
|
)
|
||||||
|
|
||||||
|
lazy val a = project.
|
||||||
|
dependsOn(b).
|
||||||
|
settings(
|
||||||
|
name := "a",
|
||||||
|
ivyPaths := (ivyPaths in ThisBuild).value
|
||||||
|
)
|
||||||
|
|
||||||
|
lazy val b = project.
|
||||||
|
settings(
|
||||||
|
name := "b",
|
||||||
|
ivyPaths := (ivyPaths in ThisBuild).value
|
||||||
|
)
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
import sbt._
|
|
||||||
import Keys._
|
|
||||||
import Import._
|
|
||||||
|
|
||||||
object B extends Build {
|
|
||||||
|
|
||||||
override def settings = super.settings ++ Seq(
|
|
||||||
organization := "org.example",
|
|
||||||
version := "2.0-SNAPSHOT"
|
|
||||||
)
|
|
||||||
|
|
||||||
lazy val root = proj("root", ".") aggregate(a,b)
|
|
||||||
lazy val a = proj("a", "a") dependsOn(b)
|
|
||||||
lazy val b = proj("b", "b")
|
|
||||||
private[this] def proj(id: String, f: String): Project = Project(id, file(f)).settings( ivyPaths <<= ivyPaths in ThisBuild )
|
|
||||||
}
|
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
lazy val root = (project in file(".")).
|
||||||
|
aggregate(a,b).
|
||||||
|
settings(
|
||||||
|
organization in ThisBuild := "org.example",
|
||||||
|
version in ThisBuild := "2.0-SNAPSHOT",
|
||||||
|
ivyPaths := (ivyPaths in ThisBuild).value
|
||||||
|
)
|
||||||
|
|
||||||
|
lazy val a = project.
|
||||||
|
dependsOn(b).
|
||||||
|
settings(
|
||||||
|
name := "a",
|
||||||
|
ivyPaths := (ivyPaths in ThisBuild).value
|
||||||
|
)
|
||||||
|
|
||||||
|
lazy val b = project.
|
||||||
|
settings(
|
||||||
|
name := "b",
|
||||||
|
ivyPaths := (ivyPaths in ThisBuild).value
|
||||||
|
)
|
||||||
|
|
@ -1,9 +1,8 @@
|
||||||
name := "use"
|
lazy val root = (project in file(".")).
|
||||||
|
settings(
|
||||||
organization := "org.example"
|
name := "use",
|
||||||
|
organization := "org.example",
|
||||||
version := "1.0"
|
version := "1.0",
|
||||||
|
libraryDependencies += "org.example" % "b" % "2.0-SNAPSHOT",
|
||||||
libraryDependencies += "org.example" % "b" % "2.0-SNAPSHOT"
|
ivyPaths := (ivyPaths in ThisBuild).value
|
||||||
|
)
|
||||||
ivyPaths <<= ivyPaths in ThisBuild
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# Publish the def/{a,b} projects to the local repository
|
# Publish the def/{a,b} projects to the local repository
|
||||||
|
|
||||||
$ copy-file changes/def/Build.scala project/Build.scala
|
$ copy-file changes/def/build.sbt build.sbt
|
||||||
$ copy-file changes/def/Def.java b/Def.java
|
$ copy-file changes/def/Def.java b/Def.java
|
||||||
> reload
|
> reload
|
||||||
> publish-local
|
> publish-local
|
||||||
|
|
@ -11,7 +11,7 @@ $ copy-file changes/def/Def.java b/Def.java
|
||||||
# The resolver will be marked as local in the cache
|
# The resolver will be marked as local in the cache
|
||||||
# The dependency on def/b will be properly resolved
|
# The dependency on def/b will be properly resolved
|
||||||
|
|
||||||
$ delete project/Build.scala
|
$ delete build.sbt
|
||||||
$ delete b/Def.java
|
$ delete b/Def.java
|
||||||
$ copy-file changes/use/build.sbt build.sbt
|
$ copy-file changes/use/build.sbt build.sbt
|
||||||
$ copy-file changes/use/Use.java Use.java
|
$ copy-file changes/use/Use.java Use.java
|
||||||
|
|
@ -23,7 +23,8 @@ $ copy-file changes/use/Use.java Use.java
|
||||||
# Publish the def/{a,b} projects to the local repository again
|
# Publish the def/{a,b} projects to the local repository again
|
||||||
# This will change the resolver in the cache to be inter-project
|
# This will change the resolver in the cache to be inter-project
|
||||||
|
|
||||||
$ copy-file changes/def/Build.scala project/Build.scala
|
$ delete build.sbt
|
||||||
|
$ copy-file changes/both/build.sbt build.sbt
|
||||||
$ copy-file changes/def/Def.java b/Def.java
|
$ copy-file changes/def/Def.java b/Def.java
|
||||||
> reload
|
> reload
|
||||||
> publish-local
|
> publish-local
|
||||||
|
|
@ -33,7 +34,7 @@ $ copy-file changes/def/Def.java b/Def.java
|
||||||
# Resolve from local again. This will succeed, but the jars
|
# Resolve from local again. This will succeed, but the jars
|
||||||
# won't be on the classpath if the resolver isn't ignoredy.
|
# won't be on the classpath if the resolver isn't ignoredy.
|
||||||
|
|
||||||
$ delete project/Build.scala
|
$ delete build.sbt
|
||||||
$ delete b/Def.java
|
$ delete b/Def.java
|
||||||
$ copy-file changes/use/build.sbt build.sbt
|
$ copy-file changes/use/build.sbt build.sbt
|
||||||
$ copy-file changes/use/Use.java Use.java
|
$ copy-file changes/use/Use.java Use.java
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue