Merge pull request #54 from dwijnand/reunite

Add props to define source dependencies on io & util
This commit is contained in:
Dale Wijnand 2016-11-15 17:16:06 +00:00 committed by GitHub
commit 52c1826366
2 changed files with 36 additions and 8 deletions

View File

@ -47,11 +47,11 @@ lazy val lm = (project in file("librarymanagement")).
commonSettings,
name := "librarymanagement",
libraryDependencies ++= Seq(
utilLogging, sbtIO, utilTesting % Test,
utilCollection, utilCompletion, ivy, jsch, sbtSerialization, scalaReflect.value, launcherInterface),
ivy, jsch, sbtSerialization, scalaReflect.value, launcherInterface),
resourceGenerators in Compile <+= (version, resourceManaged, streams, compile in Compile) map Util.generateVersionFile,
binaryIssueFilters ++= Seq()
)
).
configure(addSbtIO, addSbtUtilLogging, addSbtUtilTesting, addSbtUtilCollection, addSbtUtilCompletion)
def customCommands: Seq[Setting[_]] = Seq(
commands += Command.command("release") { state =>

View File

@ -6,11 +6,39 @@ object Dependencies {
val ioVersion = "1.0.0-M6"
val utilVersion = "0.1.0-M13"
lazy val sbtIO = "org.scala-sbt" %% "io" % ioVersion
lazy val utilCollection = "org.scala-sbt" %% "util-collection" % utilVersion
lazy val utilLogging = "org.scala-sbt" %% "util-logging" % utilVersion
lazy val utilTesting = "org.scala-sbt" %% "util-testing" % utilVersion
lazy val utilCompletion = "org.scala-sbt" %% "util-completion" % utilVersion
private lazy val sbtIO = "org.scala-sbt" %% "io" % ioVersion
private lazy val utilCollection = "org.scala-sbt" %% "util-collection" % utilVersion
private lazy val utilLogging = "org.scala-sbt" %% "util-logging" % utilVersion
private lazy val utilTesting = "org.scala-sbt" %% "util-testing" % utilVersion
private lazy val utilCompletion = "org.scala-sbt" %% "util-completion" % utilVersion
private lazy val utilCache = "org.scala-sbt" %% "util-cache" % utilVersion
def getSbtModulePath(key: String, name: String) = {
val localProps = new java.util.Properties()
IO.load(localProps, file("project/local.properties"))
val path = Option(localProps getProperty key) orElse (sys.props get key)
path foreach (f => println(s"Using $name from $f"))
path
}
lazy val sbtIoPath = getSbtModulePath("sbtio.path", "sbt/io")
lazy val sbtUtilPath = getSbtModulePath("sbtutil.path", "sbt/util")
def addSbtModule(p: Project, path: Option[String], projectName: String, m: ModuleID, c: Option[Configuration] = None) =
path match {
case Some(f) => p dependsOn c.fold[ClasspathDependency](ProjectRef(file(f), projectName))(ProjectRef(file(f), projectName) % _)
case None => p settings (libraryDependencies += c.fold(m)(m % _))
}
def addSbtIO(p: Project): Project = addSbtModule(p, sbtIoPath, "io", sbtIO)
def addSbtUtilCollection(p: Project): Project = addSbtModule(p, sbtUtilPath, "utilCollection", utilCollection)
def addSbtUtilLogging(p: Project): Project = addSbtModule(p, sbtUtilPath, "utilLogging", utilLogging)
def addSbtUtilTesting(p: Project): Project = addSbtModule(p, sbtUtilPath, "utilTesting", utilTesting, Some(Test))
def addSbtUtilCompletion(p: Project): Project = addSbtModule(p, sbtUtilPath, "utilComplete", utilCompletion)
def addSbtUtilCache(p: Project): Project = addSbtModule(p, sbtUtilPath, "utilCache", utilCache)
lazy val launcherInterface = "org.scala-sbt" % "launcher-interface" % "1.0.0"
lazy val ivy = "org.scala-sbt.ivy" % "ivy" % "2.3.0-sbt-2cc8d2761242b072cedb0a04cb39435c4fa24f9a"