mirror of https://github.com/sbt/sbt.git
Merge branch 'sbt-0.13'
This commit is contained in:
commit
71f8f3a53a
13
build.sbt
13
build.sbt
|
|
@ -1,7 +1,16 @@
|
|||
seq(lsSettings :_*)
|
||||
|
||||
CrossBuilding.crossSbtVersions := Seq("0.11.1", "0.11.2", "0.11.3", "0.12")
|
||||
crossBuildingSettings
|
||||
|
||||
CrossBuilding.crossSbtVersions := Seq("0.11.1", "0.11.2", "0.11.3", "0.12", "0.13")
|
||||
|
||||
CrossBuilding.scriptedSettings
|
||||
|
||||
libraryDependencies += "com.github.mdr" %% "ascii-graphs" % "0.0.2"
|
||||
libraryDependencies += "com.github.mdr" %% "ascii-graphs" % "0.0.3"
|
||||
|
||||
libraryDependencies <++= scalaVersion { version =>
|
||||
if (version startsWith "2.1") Seq("org.scala-lang" % "scala-reflect" % version % "provided")
|
||||
else Nil
|
||||
}
|
||||
|
||||
scalacOptions ++= Seq("-deprecation", "-unchecked")
|
||||
|
|
|
|||
|
|
@ -4,4 +4,4 @@ addSbtPlugin("me.lessis" % "ls-sbt" % "0.1.2")
|
|||
|
||||
resolvers += "Coda Hale's Repo" at "http://repo.codahale.com"
|
||||
|
||||
addSbtPlugin("net.virtual-void" % "sbt-cross-building" % "0.7.0")
|
||||
addSbtPlugin("net.virtual-void" % "sbt-cross-building" % "0.8.0-RC1")
|
||||
|
|
|
|||
|
|
@ -9,11 +9,10 @@ object SbtDependencyGraphCompat {
|
|||
* to ignore missing artifacts.
|
||||
*/
|
||||
def ignoreMissingUpdateT =
|
||||
ignoreMissingUpdate <<= (ivyModule, thisProjectRef, updateConfiguration, cacheDirectory, scalaInstance, transitiveUpdate, streams) map { (module, ref, config, cacheDirectory, si, reports, s) =>
|
||||
ignoreMissingUpdate <<= (ivyModule, thisProjectRef, updateConfiguration in ignoreMissingUpdate, cacheDirectory, scalaInstance, transitiveUpdate, streams) map { (module, ref, config, cacheDirectory, si, reports, s) =>
|
||||
val depsUpdated = reports.exists(!_.stats.cached)
|
||||
val missingOkConfig = new UpdateConfiguration(config.retrieve, true, config.logging)
|
||||
|
||||
Classpaths.cachedUpdate(cacheDirectory / "update", Project.display(ref), module, missingOkConfig, Some(si), depsUpdated, s.log)
|
||||
Classpaths.cachedUpdate(cacheDirectory / "update", Project.display(ref), module, config, Some(si), depsUpdated, s.log)
|
||||
}
|
||||
|
||||
import complete.DefaultParsers._
|
||||
|
|
|
|||
|
|
@ -9,13 +9,12 @@ object SbtDependencyGraphCompat {
|
|||
* to ignore missing artifacts.
|
||||
*/
|
||||
def ignoreMissingUpdateT =
|
||||
ignoreMissingUpdate <<= (ivyModule, thisProjectRef, updateConfiguration, cacheDirectory, scalaInstance, transitiveUpdate, executionRoots, resolvedScoped, skip in update, streams) map {
|
||||
ignoreMissingUpdate <<= (ivyModule, thisProjectRef, updateConfiguration in ignoreMissingUpdate, cacheDirectory, scalaInstance, transitiveUpdate, executionRoots, resolvedScoped, skip in update, streams) map {
|
||||
(module, ref, config, cacheDirectory, si, reports, roots, resolved, skip, s) =>
|
||||
val depsUpdated = reports.exists(!_.stats.cached)
|
||||
val isRoot = roots contains resolved
|
||||
val missingOkConfig = new UpdateConfiguration(config.retrieve, true, config.logging)
|
||||
|
||||
Classpaths.cachedUpdate(cacheDirectory / "update", Project.display(ref), module, missingOkConfig, Some(si), skip = skip, force = isRoot, depsUpdated = depsUpdated, log = s.log)
|
||||
Classpaths.cachedUpdate(cacheDirectory / "update", Project.display(ref), module, config, Some(si), skip = skip, force = isRoot, depsUpdated = depsUpdated, log = s.log)
|
||||
} tag(Tags.Update, Tags.Network)
|
||||
|
||||
def getTerminalWidth: Int = JLine.usingTerminal(_.getTerminalWidth)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,39 @@
|
|||
package sbt
|
||||
|
||||
import net.virtualvoid.sbt.graph.Plugin._
|
||||
import Keys._
|
||||
import CrossVersion._
|
||||
|
||||
object SbtDependencyGraphCompat {
|
||||
/**
|
||||
* This is copied directly from sbt/main/Defaults.java and then changed to update the UpdateConfiguration
|
||||
* to ignore missing artifacts.
|
||||
*/
|
||||
def ignoreMissingUpdateT =
|
||||
ignoreMissingUpdate <<= Def.task {
|
||||
val depsUpdated = transitiveUpdate.value.exists(!_.stats.cached)
|
||||
val isRoot = executionRoots.value contains resolvedScoped.value
|
||||
val s = streams.value
|
||||
val scalaProvider = appConfiguration.value.provider.scalaProvider
|
||||
|
||||
// Only substitute unmanaged jars for managed jars when the major.minor parts of the versions the same for:
|
||||
// the resolved Scala version and the scalaHome version: compatible (weakly- no qualifier checked)
|
||||
// the resolved Scala version and the declared scalaVersion: assume the user intended scalaHome to override anything with scalaVersion
|
||||
def subUnmanaged(subVersion: String, jars: Seq[File]) = (sv: String) =>
|
||||
(partialVersion(sv), partialVersion(subVersion), partialVersion(scalaVersion.value)) match {
|
||||
case (Some(res), Some(sh), _) if res == sh => jars
|
||||
case (Some(res), _, Some(decl)) if res == decl => jars
|
||||
case _ => Nil
|
||||
}
|
||||
val subScalaJars: String => Seq[File] = Defaults.unmanagedScalaInstanceOnly.value match {
|
||||
case Some(si) => subUnmanaged(si.version, si.jars)
|
||||
case None => sv => if(scalaProvider.version == sv) scalaProvider.jars else Nil
|
||||
}
|
||||
val transform: UpdateReport => UpdateReport = r => Classpaths.substituteScalaFiles(scalaOrganization.value, r)(subScalaJars)
|
||||
|
||||
val show = Reference.display(thisProjectRef.value)
|
||||
Classpaths.cachedUpdate(s.cacheDirectory, show, ivyModule.value, (updateConfiguration in ignoreMissingUpdate).value, transform, skip = (skip in update).value, force = isRoot, depsUpdated = depsUpdated, log = s.log)
|
||||
}
|
||||
|
||||
def getTerminalWidth: Int = JLine.usingTerminal(_.getWidth)
|
||||
}
|
||||
|
|
@ -79,6 +79,7 @@ object Plugin extends sbt.Plugin {
|
|||
(c: String) => file("%s/cache/%s-%s-%s.xml" format (home, projectID.organization, crossName(ivyModule), c))
|
||||
}
|
||||
},
|
||||
updateConfiguration in ignoreMissingUpdate <<= updateConfiguration(config => new UpdateConfiguration(config.retrieve, true, config.logging)),
|
||||
SbtDependencyGraphCompat.ignoreMissingUpdateT,
|
||||
filterScalaLibrary in Global := true
|
||||
) ++ Seq(Compile, Test, Runtime, Provided, Optional).flatMap(ivyReportForConfig)
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import net.virtualvoid.sbt.graph.Plugin._
|
|||
|
||||
graphSettings
|
||||
|
||||
scalaVersion := "2.9.2"
|
||||
scalaVersion := "2.9.1"
|
||||
|
||||
libraryDependencies ++= Seq(
|
||||
"com.codahale" % "jerkson_2.9.1" % "0.5.0"
|
||||
|
|
@ -13,9 +13,9 @@ TaskKey[Unit]("check") <<= (ivyReport in Test, asciiTree in Test) map { (report,
|
|||
val expectedGraph =
|
||||
"""default:default-dbc48d_2.9.2:0.1-SNAPSHOT [S]
|
||||
| +-com.codahale:jerkson_2.9.1:0.5.0 [S]
|
||||
| +-org.codehaus.jackson:jackson-core-asl:1.9.12
|
||||
| +-org.codehaus.jackson:jackson-mapper-asl:1.9.12
|
||||
| +-org.codehaus.jackson:jackson-core-asl:1.9.12
|
||||
| +-org.codehaus.jackson:jackson-core-asl:1.9.13
|
||||
| +-org.codehaus.jackson:jackson-mapper-asl:1.9.13
|
||||
| +-org.codehaus.jackson:jackson-core-asl:1.9.13
|
||||
| """.stripMargin
|
||||
IO.writeLines(file("/tmp/blib"), sanitize(graph).split("\n"))
|
||||
IO.writeLines(file("/tmp/blub"), sanitize(expectedGraph).split("\n"))
|
||||
|
|
|
|||
|
|
@ -10,20 +10,20 @@ object Build extends sbt.Build {
|
|||
seq(scalaVersion := "2.9.2")
|
||||
|
||||
lazy val justATransiviteDependencyEndpointProject =
|
||||
Project("just-a-transitive-dependency-endpoint", file("."))
|
||||
Project("just-a-transitive-dependency-endpoint", file("a"))
|
||||
.settings(defaultSettings: _*)
|
||||
|
||||
lazy val justATransitiveDependencyProject =
|
||||
Project("just-a-transitive-dependency", file("."))
|
||||
Project("just-a-transitive-dependency", file("b"))
|
||||
.settings(defaultSettings: _*)
|
||||
.dependsOn(justATransiviteDependencyEndpointProject)
|
||||
|
||||
lazy val justADependencyProject =
|
||||
Project("just-a-dependency", file("."))
|
||||
Project("just-a-dependency", file("c"))
|
||||
.settings(defaultSettings: _*)
|
||||
|
||||
lazy val test_project =
|
||||
Project("test-dot-file-generation", file("."))
|
||||
Project("test-dot-file-generation", file("d"))
|
||||
.settings(graphSettings: _*)
|
||||
.settings(defaultSettings: _*)
|
||||
.settings(
|
||||
|
|
|
|||
Loading…
Reference in New Issue