mirror of https://github.com/sbt/sbt.git
Add new `csrSameVersions` setting, use it for Scala artifacts
The `csrSameVersions` setting can be used to keep dependencies at the
same version.
By default it's used for Scala artifacts. They need to be kept at the
same version because the compiler / reflect are built with
cross-artifact inlining enabled.
`csrSameVersions := Seq(Set(scala-library, scala-reflect, scala-compiler, scalap))`
Users can make use of the new setting in the following way:
- `csrSameVersions += Set[InclExclRule]("com.corp" % "lib", "com.corp" % "lub")`
- `csrSameVersions += Set[InclExclRule]("com.corp" % "lib-family-*")`
This commit is contained in:
parent
4c74358707
commit
951d1c4ae4
|
|
@ -271,6 +271,9 @@ object Defaults extends BuildCommon {
|
|||
csrLogger := LMCoursier.coursierLoggerTask.value,
|
||||
csrMavenProfiles :== Set.empty,
|
||||
csrReconciliations :== LMCoursier.relaxedForAllModules,
|
||||
csrSameVersions := Seq(
|
||||
ScalaArtifacts.Artifacts.map(a => InclExclRule(scalaOrganization.value, a)).toSet
|
||||
)
|
||||
)
|
||||
|
||||
/** Core non-plugin settings for sbt builds. These *must* be on every build or the sbt engine will fail to run at all. */
|
||||
|
|
|
|||
|
|
@ -452,6 +452,7 @@ object Keys {
|
|||
val csrExtraCredentials = taskKey[Seq[lmcoursier.credentials.Credentials]]("")
|
||||
val csrPublications = taskKey[Seq[(lmcoursier.definitions.Configuration, lmcoursier.definitions.Publication)]]("")
|
||||
val csrReconciliations = settingKey[Seq[(ModuleMatchers, Reconciliation)]]("Strategy to reconcile version conflicts.")
|
||||
val csrSameVersions = settingKey[Seq[Set[InclExclRule]]]("Modules to keep at the same version.")
|
||||
|
||||
val internalConfigurationMap = settingKey[Configuration => Configuration]("Maps configurations to the actual configuration used to define the classpath.").withRank(CSetting)
|
||||
val classpathConfiguration = taskKey[Configuration]("The configuration used to define the classpath.").withRank(CTask)
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ object LMCoursier {
|
|||
def relaxedForAllModules: Seq[(ModuleMatchers, Reconciliation)] =
|
||||
Vector((ModuleMatchers.all, Reconciliation.Relaxed))
|
||||
|
||||
// For binary compatibility / MiMa
|
||||
def coursierConfiguration(
|
||||
rs: Seq[Resolver],
|
||||
interProjectDependencies: Seq[CProject],
|
||||
|
|
@ -119,6 +120,58 @@ object LMCoursier {
|
|||
strict,
|
||||
depsOverrides,
|
||||
None,
|
||||
Nil,
|
||||
log
|
||||
)
|
||||
|
||||
// For binary compatibility / MiMa
|
||||
def coursierConfiguration(
|
||||
rs: Seq[Resolver],
|
||||
interProjectDependencies: Seq[CProject],
|
||||
extraProjects: Seq[CProject],
|
||||
fallbackDeps: Seq[FallbackDependency],
|
||||
appConfig: AppConfiguration,
|
||||
classifiers: Option[Seq[Classifier]],
|
||||
profiles: Set[String],
|
||||
scalaOrg: String,
|
||||
scalaVer: String,
|
||||
scalaBinaryVer: String,
|
||||
autoScalaLib: Boolean,
|
||||
scalaModInfo: Option[ScalaModuleInfo],
|
||||
excludeDeps: Seq[InclExclRule],
|
||||
credentials: Seq[Credentials],
|
||||
createLogger: Option[CacheLogger],
|
||||
cacheDirectory: File,
|
||||
reconciliation: Seq[(ModuleMatchers, Reconciliation)],
|
||||
ivyHome: Option[File],
|
||||
strict: Option[CStrict],
|
||||
depsOverrides: Seq[ModuleID],
|
||||
updateConfig: Option[UpdateConfiguration],
|
||||
log: Logger
|
||||
): CoursierConfiguration =
|
||||
coursierConfiguration(
|
||||
rs,
|
||||
interProjectDependencies,
|
||||
extraProjects,
|
||||
fallbackDeps,
|
||||
appConfig,
|
||||
classifiers,
|
||||
profiles,
|
||||
scalaOrg,
|
||||
scalaVer,
|
||||
scalaBinaryVer,
|
||||
autoScalaLib,
|
||||
scalaModInfo,
|
||||
excludeDeps,
|
||||
credentials,
|
||||
createLogger,
|
||||
cacheDirectory,
|
||||
reconciliation,
|
||||
ivyHome,
|
||||
strict,
|
||||
depsOverrides,
|
||||
updateConfig,
|
||||
Nil,
|
||||
log
|
||||
)
|
||||
|
||||
|
|
@ -144,6 +197,7 @@ object LMCoursier {
|
|||
strict: Option[CStrict],
|
||||
depsOverrides: Seq[ModuleID],
|
||||
updateConfig: Option[UpdateConfiguration],
|
||||
sameVersions: Seq[Set[InclExclRule]],
|
||||
log: Logger
|
||||
): CoursierConfiguration = {
|
||||
val coursierExcludeDeps = Inputs
|
||||
|
|
@ -197,6 +251,7 @@ object LMCoursier {
|
|||
.withStrict(strict)
|
||||
.withForceVersions(userForceVersions.toVector)
|
||||
.withMissingOk(missingOk)
|
||||
.withSameVersions(sameVersions)
|
||||
}
|
||||
|
||||
def coursierConfigurationTask: Def.Initialize[Task[CoursierConfiguration]] = Def.task {
|
||||
|
|
@ -223,6 +278,7 @@ object LMCoursier {
|
|||
CoursierInputsTasks.strictTask.value,
|
||||
dependencyOverrides.value,
|
||||
Some(updateConfiguration.value),
|
||||
csrSameVersions.value,
|
||||
streams.value.log
|
||||
)
|
||||
}
|
||||
|
|
@ -251,6 +307,7 @@ object LMCoursier {
|
|||
CoursierInputsTasks.strictTask.value,
|
||||
dependencyOverrides.value,
|
||||
Some(updateConfiguration.value),
|
||||
csrSameVersions.value,
|
||||
streams.value.log
|
||||
)
|
||||
}
|
||||
|
|
@ -279,6 +336,7 @@ object LMCoursier {
|
|||
CoursierInputsTasks.strictTask.value,
|
||||
dependencyOverrides.value,
|
||||
Some(updateConfiguration.value),
|
||||
csrSameVersions.value,
|
||||
streams.value.log
|
||||
)
|
||||
}
|
||||
|
|
@ -307,6 +365,7 @@ object LMCoursier {
|
|||
CoursierInputsTasks.strictTask.value,
|
||||
dependencyOverrides.value,
|
||||
Some(updateConfiguration.value),
|
||||
csrSameVersions.value,
|
||||
streams.value.log
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue