mirror of https://github.com/sbt/sbt.git
Merge pull request #1858 from sbt/fix/inline-configuration
Adds an hook treating InlineConfigurationWithExcludes structurally
This commit is contained in:
commit
dba47afd9e
31
.travis.yml
31
.travis.yml
|
|
@ -1,3 +1,20 @@
|
||||||
|
# Use Docker-based container (instead of OpenVZ)
|
||||||
|
sudo: false
|
||||||
|
|
||||||
|
cache:
|
||||||
|
directories:
|
||||||
|
- $HOME/.ivy2/cache
|
||||||
|
|
||||||
|
# At the moment, sbt 0.13.5 is preinstalled in Travis VM image,
|
||||||
|
# which fortunately corresponds to current scalaz settings.
|
||||||
|
# The line below can be used to cache a given sbt version.
|
||||||
|
# - $HOME/.sbt/launchers/0.13.x
|
||||||
|
|
||||||
|
# The line below is used to cache the scala version used by the build
|
||||||
|
# job, as these versions might be replaced after a Travis CI build
|
||||||
|
# environment upgrade (e.g. scala 2.11.2 could be replaced by scala 2.11.4).
|
||||||
|
- $HOME/.sbt/boot/scala-$TRAVIS_SCALA_VERSION
|
||||||
|
|
||||||
language: scala
|
language: scala
|
||||||
|
|
||||||
# TODO - we'd like to actually test everything, but the process library has a deadlock right now
|
# TODO - we'd like to actually test everything, but the process library has a deadlock right now
|
||||||
|
|
@ -5,8 +22,6 @@ jdk:
|
||||||
- openjdk6
|
- openjdk6
|
||||||
# - oraclejdk7
|
# - oraclejdk7
|
||||||
|
|
||||||
sudo: false
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
- JVM_OPTS="-Xms1024m -Xmx1024m -XX:ReservedCodeCacheSize=128m -XX:MaxPermSize=256m"
|
- JVM_OPTS="-Xms1024m -Xmx1024m -XX:ReservedCodeCacheSize=128m -XX:MaxPermSize=256m"
|
||||||
|
|
@ -32,10 +47,14 @@ env:
|
||||||
- SCRIPTED_TEST="safeUnitTests"
|
- SCRIPTED_TEST="safeUnitTests"
|
||||||
- SCRIPTED_TEST="checkBuildScala211"
|
- SCRIPTED_TEST="checkBuildScala211"
|
||||||
|
|
||||||
|
notifications:
|
||||||
|
email:
|
||||||
|
- eugene.yokota@typesafe.com
|
||||||
|
- joshua.suereth@typesafe.com
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- sbt "$SCRIPTED_TEST"
|
- sbt "$SCRIPTED_TEST"
|
||||||
|
|
||||||
notifications:
|
# Tricks to avoid unnecessary cache updates
|
||||||
email:
|
- find $HOME/.sbt -name "*.lock" | xargs rm
|
||||||
- qbranch@typesafe.com
|
- find $HOME/.ivy2 -name "ivydata-*.properties" | xargs rm
|
||||||
|
|
||||||
|
|
|
||||||
76
build.sbt
76
build.sbt
|
|
@ -333,18 +333,9 @@ lazy val compileInterfaceProj = (project in compilePath / "interface").
|
||||||
artifact in (Compile, packageSrc) := Artifact(srcID).copy(configurations = Compile :: Nil).extra("e:component" -> srcID)
|
artifact in (Compile, packageSrc) := Artifact(srcID).copy(configurations = Compile :: Nil).extra("e:component" -> srcID)
|
||||||
)
|
)
|
||||||
|
|
||||||
def precompiledSettings = Seq(
|
lazy val precompiled282 = precompiled(scala282)
|
||||||
artifact in packageBin <<= (appConfiguration, scalaVersion) { (app, sv) =>
|
lazy val precompiled292 = precompiled(scala292)
|
||||||
val launcher = app.provider.scalaProvider.launcher
|
lazy val precompiled293 = precompiled(scala293)
|
||||||
val bincID = binID + "_" + ScalaInstance(sv, launcher).actualVersion
|
|
||||||
Artifact(binID) extra ("e:component" -> bincID)
|
|
||||||
},
|
|
||||||
target <<= (target, scalaVersion) { (base, sv) => base / ("precompiled_" + sv) },
|
|
||||||
scalacOptions := Nil,
|
|
||||||
ivyScala ~= { _.map(_.copy(checkExplicit = false, overrideScalaVersion = false)) },
|
|
||||||
exportedProducts in Compile := Nil,
|
|
||||||
libraryDependencies += scalaCompiler.value % "provided"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Implements the core functionality of detecting and propagating changes incrementally.
|
// Implements the core functionality of detecting and propagating changes incrementally.
|
||||||
// Defines the data structures for representing file fingerprints and relationships and the overall source analysis
|
// Defines the data structures for representing file fingerprints and relationships and the overall source analysis
|
||||||
|
|
@ -452,7 +443,7 @@ lazy val mainProj = (project in mainPath).
|
||||||
// technically, we need a dependency on all of mainProj's dependencies, but we don't do that since this is strictly an integration project
|
// technically, we need a dependency on all of mainProj's dependencies, but we don't do that since this is strictly an integration project
|
||||||
// with the sole purpose of providing certain identifiers without qualification (with a package object)
|
// with the sole purpose of providing certain identifiers without qualification (with a package object)
|
||||||
lazy val sbtProj = (project in sbtPath).
|
lazy val sbtProj = (project in sbtPath).
|
||||||
dependsOn(mainProj, compileInterfaceProj, scriptedSbtProj % "test->test").
|
dependsOn(mainProj, compileInterfaceProj, precompiled282, precompiled292, precompiled293, scriptedSbtProj % "test->test").
|
||||||
settings(baseSettings: _*).
|
settings(baseSettings: _*).
|
||||||
settings(
|
settings(
|
||||||
name := "sbt",
|
name := "sbt",
|
||||||
|
|
@ -522,7 +513,7 @@ def otherRootSettings = Seq(
|
||||||
}
|
}
|
||||||
))
|
))
|
||||||
lazy val docProjects: ScopeFilter = ScopeFilter(
|
lazy val docProjects: ScopeFilter = ScopeFilter(
|
||||||
inAnyProject -- inProjects(root, sbtProj, scriptedBaseProj, scriptedSbtProj, scriptedPluginProj),
|
inAnyProject -- inProjects(root, sbtProj, scriptedBaseProj, scriptedSbtProj, scriptedPluginProj, precompiled282, precompiled292, precompiled293),
|
||||||
inConfigurations(Compile)
|
inConfigurations(Compile)
|
||||||
)
|
)
|
||||||
def fullDocSettings = Util.baseScalacOptions ++ Docs.settings ++ Sxr.settings ++ Seq(
|
def fullDocSettings = Util.baseScalacOptions ++ Docs.settings ++ Sxr.settings ++ Seq(
|
||||||
|
|
@ -549,6 +540,35 @@ def utilPath = file("util")
|
||||||
def compilePath = file("compile")
|
def compilePath = file("compile")
|
||||||
def mainPath = file("main")
|
def mainPath = file("main")
|
||||||
|
|
||||||
|
def precompiledSettings = Seq(
|
||||||
|
artifact in packageBin <<= (appConfiguration, scalaVersion) { (app, sv) =>
|
||||||
|
val launcher = app.provider.scalaProvider.launcher
|
||||||
|
val bincID = binID + "_" + ScalaInstance(sv, launcher).actualVersion
|
||||||
|
Artifact(binID) extra ("e:component" -> bincID)
|
||||||
|
},
|
||||||
|
target <<= (target, scalaVersion) { (base, sv) => base / ("precompiled_" + sv) },
|
||||||
|
scalacOptions := Nil,
|
||||||
|
ivyScala ~= { _.map(_.copy(checkExplicit = false, overrideScalaVersion = false)) },
|
||||||
|
exportedProducts in Compile := Nil,
|
||||||
|
libraryDependencies += scalaCompiler.value % "provided"
|
||||||
|
)
|
||||||
|
|
||||||
|
def precompiled(scalav: String): Project = Project(id = normalize("Precompiled " + scalav.replace('.', '_')), base = compilePath / "interface").
|
||||||
|
dependsOn(interfaceProj).
|
||||||
|
settings(baseSettings ++ precompiledSettings: _*).
|
||||||
|
settings(
|
||||||
|
name := "Precompiled " + scalav.replace('.', '_'),
|
||||||
|
scalaHome := None,
|
||||||
|
scalaVersion <<= (scalaVersion in ThisBuild) { sbtScalaV =>
|
||||||
|
assert(sbtScalaV != scalav, "Precompiled compiler interface cannot have the same Scala version (" + scalav + ") as sbt.")
|
||||||
|
scalav
|
||||||
|
},
|
||||||
|
crossScalaVersions := Seq(scalav),
|
||||||
|
// we disable compiling and running tests in precompiled Projprojects of compiler interface
|
||||||
|
// so we do not need to worry about cross-versioning testing dependencies
|
||||||
|
sources in Test := Nil
|
||||||
|
)
|
||||||
|
|
||||||
lazy val safeUnitTests = taskKey[Unit]("Known working tests (for both 2.10 and 2.11)")
|
lazy val safeUnitTests = taskKey[Unit]("Known working tests (for both 2.10 and 2.11)")
|
||||||
lazy val safeProjects: ScopeFilter = ScopeFilter(
|
lazy val safeProjects: ScopeFilter = ScopeFilter(
|
||||||
inProjects(launchProj, mainSettingsProj, mainProj, ivyProj, completeProj,
|
inProjects(launchProj, mainSettingsProj, mainProj, ivyProj, completeProj,
|
||||||
|
|
@ -576,18 +596,46 @@ def customCommands: Seq[Setting[_]] = Seq(
|
||||||
},
|
},
|
||||||
commands += Command.command("release-sbt-local") { state =>
|
commands += Command.command("release-sbt-local") { state =>
|
||||||
"clean" ::
|
"clean" ::
|
||||||
|
"precompiled-2_8_2/compile" ::
|
||||||
|
"precompiled-2_9_2/compile" ::
|
||||||
|
"precompiled-2_9_3/compile" ::
|
||||||
"so compile" ::
|
"so compile" ::
|
||||||
|
"precompiled-2_8_2/publishLocal" ::
|
||||||
|
"precompiled-2_9_2/publishLocal" ::
|
||||||
|
"precompiled-2_9_3/publishLocal" ::
|
||||||
"so publishLocal" ::
|
"so publishLocal" ::
|
||||||
"reload" ::
|
"reload" ::
|
||||||
state
|
state
|
||||||
},
|
},
|
||||||
|
/** There are several complications with sbt's build.
|
||||||
|
* First is the fact that interface project is a Java-only project
|
||||||
|
* that uses source generator from datatype subproject in Scala 2.10.4,
|
||||||
|
* which is depended on by Scala 2.8.2, Scala 2.9.2, and Scala 2.9.3 precompiled project.
|
||||||
|
*
|
||||||
|
* Second is the fact that sbt project (currently using Scala 2.10.4) depends on
|
||||||
|
* the precompiled projects (that uses Scala 2.8.2 etc.)
|
||||||
|
*
|
||||||
|
* Finally, there's the fact that all subprojects are released with crossPaths
|
||||||
|
* turned off for the sbt's Scala version 2.10.4, but some of them are also
|
||||||
|
* cross published against 2.11.1 with crossPaths turned on.
|
||||||
|
*
|
||||||
|
* Because of the way ++ (and its improved version wow) is implemented
|
||||||
|
* precompiled compiler briges are handled outside of doge aggregation on root.
|
||||||
|
* `so compile` handles 2.10.x/2.11.x cross building.
|
||||||
|
*/
|
||||||
commands += Command.command("release-sbt") { state =>
|
commands += Command.command("release-sbt") { state =>
|
||||||
// TODO - Any sort of validation
|
// TODO - Any sort of validation
|
||||||
"clean" ::
|
"clean" ::
|
||||||
"checkCredentials" ::
|
"checkCredentials" ::
|
||||||
"conscript-configs" ::
|
"conscript-configs" ::
|
||||||
|
"precompiled-2_8_2/compile" ::
|
||||||
|
"precompiled-2_9_2/compile" ::
|
||||||
|
"precompiled-2_9_3/compile" ::
|
||||||
"so compile" ::
|
"so compile" ::
|
||||||
"so publishSigned" ::
|
"so publishSigned" ::
|
||||||
|
"precompiled-2_8_2/publishSigned" ::
|
||||||
|
"precompiled-2_9_2/publishSigned" ::
|
||||||
|
"precompiled-2_9_3/publishSigned" ::
|
||||||
"publishLauncher" ::
|
"publishLauncher" ::
|
||||||
state
|
state
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -121,6 +121,8 @@ final case class InlineConfiguration(module: ModuleID, moduleInfo: ModuleInfo, d
|
||||||
def withExcludes: InlineConfigurationWithExcludes =
|
def withExcludes: InlineConfigurationWithExcludes =
|
||||||
InlineConfigurationWithExcludes(this.module, this.moduleInfo, this.dependencies, this.overrides, Nil, this.ivyXML,
|
InlineConfigurationWithExcludes(this.module, this.moduleInfo, this.dependencies, this.overrides, Nil, this.ivyXML,
|
||||||
this.configurations, this.defaultConfiguration, this.ivyScala, this.validate, this.conflictManager)
|
this.configurations, this.defaultConfiguration, this.ivyScala, this.validate, this.conflictManager)
|
||||||
|
def withOverrides(overrides: Set[ModuleID]): ModuleSettings =
|
||||||
|
copy(overrides = overrides)
|
||||||
}
|
}
|
||||||
object InlineConfiguration {
|
object InlineConfiguration {
|
||||||
@deprecated("Use InlineConfigurationWithExcludes.explicitConfigurations.", "0.13.8")
|
@deprecated("Use InlineConfigurationWithExcludes.explicitConfigurations.", "0.13.8")
|
||||||
|
|
@ -148,6 +150,8 @@ final class InlineConfigurationWithExcludes private[sbt] (val module: ModuleID,
|
||||||
val conflictManager: ConflictManager) extends ModuleSettings {
|
val conflictManager: ConflictManager) extends ModuleSettings {
|
||||||
def withConfigurations(configurations: Seq[Configuration]) = copy(configurations = configurations)
|
def withConfigurations(configurations: Seq[Configuration]) = copy(configurations = configurations)
|
||||||
def noScala = copy(ivyScala = None)
|
def noScala = copy(ivyScala = None)
|
||||||
|
def withOverrides(overrides: Set[ModuleID]): ModuleSettings =
|
||||||
|
copy(overrides = overrides)
|
||||||
|
|
||||||
private[sbt] def copy(module: ModuleID = this.module,
|
private[sbt] def copy(module: ModuleID = this.module,
|
||||||
moduleInfo: ModuleInfo = this.moduleInfo,
|
moduleInfo: ModuleInfo = this.moduleInfo,
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,9 @@ import sbt._
|
||||||
import Keys._
|
import Keys._
|
||||||
|
|
||||||
object Dependencies {
|
object Dependencies {
|
||||||
|
lazy val scala282 = "2.8.2"
|
||||||
|
lazy val scala292 = "2.9.2"
|
||||||
|
lazy val scala293 = "2.9.3"
|
||||||
lazy val scala210 = "2.10.4"
|
lazy val scala210 = "2.10.4"
|
||||||
lazy val scala211 = "2.11.1"
|
lazy val scala211 = "2.11.1"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
lazy val specs = Def.setting {
|
|
||||||
"org.scala-tools.testing" %% "specs" % (scalaVersion.value match {
|
|
||||||
case "2.8.1" | "2.8.2" | "2.9.0" => "1.6.8"
|
|
||||||
case "2.9.3" => "1.6.9"
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
lazy val root = (project in file(".")).
|
|
||||||
settings(
|
|
||||||
scalaVersion := "2.8.1",
|
|
||||||
libraryDependencies += specs.value % Test,
|
|
||||||
libraryDependencies <+= scalaVersion("org.scala-lang" % "scala-compiler" % _)
|
|
||||||
)
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
> ++2.8.1
|
|
||||||
> test:test
|
|
||||||
> ++2.9.0
|
|
||||||
> test:test
|
|
||||||
> ++2.9.3
|
|
||||||
> test:test
|
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
scalaVersion := "2.8.1"
|
||||||
|
|
||||||
|
libraryDependencies += "org.scala-tools.testing" %% "specs" % "1.6.7.2" % "test"
|
||||||
|
|
||||||
|
libraryDependencies <+= scalaVersion("org.scala-lang" % "scala-compiler" % _)
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
> test:test
|
||||||
Loading…
Reference in New Issue