Port dependency-management/ivy-settings-c

This commit is contained in:
Eugene Yokota 2016-03-29 00:23:13 -04:00
parent 7520bd99a5
commit e244cd695c
2 changed files with 32 additions and 33 deletions

View File

@ -0,0 +1,32 @@
lazy val commonSettings = Seq(
autoScalaLibrary := false,
ivyScala := None,
unmanagedJars in Compile <++= scalaInstance map (_.allJars.toSeq),
publishArtifact in packageSrc := false,
publishArtifact in packageDoc := false,
publishMavenStyle := false
)
lazy val dep = project.
settings(
commonSettings,
organization := "org.example",
version := "1.0",
publishTo <<= baseDirectory in ThisBuild apply { base =>
Some(Resolver.file("file", base / "repo")(Resolver.ivyStylePatterns))
}
)
lazy val use = project.
settings(
commonSettings,
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)
}
)

View File

@ -1,33 +0,0 @@
import sbt._
import Import._
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,
ivyScala := None,
unmanagedJars in Compile <++= scalaInstance map (_.allJars.toSeq),
publishArtifact in packageSrc := false,
publishArtifact in packageDoc := false,
publishMavenStyle := false
)
}