mirror of https://github.com/sbt/sbt.git
test to ensure correctness of local resolver+useOrigin in ivysettings.xml
This commit is contained in:
parent
febe7e56e1
commit
1471081c0d
|
|
@ -12,11 +12,11 @@ object Append
|
|||
def appendValue(a: A, b: B): A
|
||||
}
|
||||
@implicitNotFound(msg = "No implicit for Append.Values[${A}, ${B}] found,\n so ${B} cannot be appended to ${A}")
|
||||
sealed trait Values[A,B]
|
||||
sealed trait Values[A,-B]
|
||||
{
|
||||
def appendValues(a: A, b: B): A
|
||||
}
|
||||
sealed trait Sequence[A,B,T] extends Value[A,T] with Values[A,B]
|
||||
sealed trait Sequence[A,-B,T] extends Value[A,T] with Values[A,B]
|
||||
|
||||
implicit def appendSeq[T, V <: T]: Sequence[Seq[T], Seq[V], V] = new Sequence[Seq[T], Seq[V], V] {
|
||||
def appendValues(a: Seq[T], b: Seq[V]): Seq[T] = a ++ b
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
object D {
|
||||
val x = 3
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
import sbt._
|
||||
import Keys._
|
||||
|
||||
object B extends Build
|
||||
{
|
||||
lazy val dep = Project("dep", file("dep")) settings( baseSettings : _*) settings(
|
||||
organization := "org.example",
|
||||
version := "1.0",
|
||||
publishTo <<= baseDirectory in ThisBuild apply { base =>
|
||||
Some(Resolver.file("file", base / "repo")(Resolver.ivyStylePatterns))
|
||||
}
|
||||
)
|
||||
lazy val use = Project("use", file("use")) settings(baseSettings : _*) settings(
|
||||
libraryDependencies += "org.example" %% "dep" % "1.0",
|
||||
externalIvySettings(),
|
||||
publishTo <<= baseDirectory { base =>
|
||||
Some(Resolver.file("file", base / "repo")(Resolver.ivyStylePatterns))
|
||||
},
|
||||
TaskKey[Unit]("check") <<= baseDirectory map {base =>
|
||||
val inCache = ( (base / "target" / "use-cache") ** "*.jar").get
|
||||
assert(inCache.isEmpty, "Cache contained jars: " + inCache)
|
||||
}
|
||||
)
|
||||
lazy val baseSettings = Seq(
|
||||
autoScalaLibrary := false,
|
||||
unmanagedJars in Compile <++= scalaInstance map (_.jars),
|
||||
publishArtifact in packageSrc := false,
|
||||
publishArtifact in packageDoc := false,
|
||||
publishMavenStyle := false
|
||||
)
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
> dep/publish
|
||||
> use/update
|
||||
> use/check
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
object U {
|
||||
val x = D.x
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
<ivysettings>
|
||||
<caches defaultCacheDir="${ivy.settings.dir}/target/use-cache" useOrigin="true"/>
|
||||
<settings defaultResolver="file"/>
|
||||
<resolvers>
|
||||
<filesystem name="file" checkconsistency="false" descriptor="required" local="true">
|
||||
<ivy pattern="${ivy.settings.dir}/../repo/[organisation]/[module]/[revision]/ivys/ivy.xml"/>
|
||||
<artifact pattern="${ivy.settings.dir}/../repo/[organisation]/[module]/[revision]/[type]s/[artifact].[ext]"/>
|
||||
</filesystem>
|
||||
</resolvers>
|
||||
</ivysettings>
|
||||
Loading…
Reference in New Issue