Merge pull request #7970 from eed3si9n/wip/lm-coursier

[1.x] csrMavenDependencyOverride + Update lm-coursier to 2.1.7 + Zinc 1.10.7
This commit is contained in:
eugene yokota 2024-12-22 20:12:54 -05:00 committed by GitHub
commit 03dc7172a7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 67 additions and 3 deletions

View File

@ -265,6 +265,7 @@ object Defaults extends BuildCommon {
csrLogger := LMCoursier.coursierLoggerTask.value,
csrMavenProfiles :== Set.empty,
csrReconciliations :== LMCoursier.relaxedForAllModules,
csrMavenDependencyOverride :== false,
csrSameVersions := Seq(
ScalaArtifacts.Artifacts.map(a => InclExclRule(scalaOrganization.value, a)).toSet
)

View File

@ -454,6 +454,7 @@ object Keys {
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 csrMavenDependencyOverride = settingKey[Boolean]("Enables Maven dependency override (bill of materials) support")
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)

View File

@ -121,6 +121,7 @@ object LMCoursier {
depsOverrides,
None,
Nil,
None,
log
)
@ -172,6 +173,60 @@ object LMCoursier {
depsOverrides,
updateConfig,
Nil,
None,
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],
sameVersions: Seq[Set[InclExclRule]],
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,
sameVersions,
None,
log
)
@ -198,6 +253,7 @@ object LMCoursier {
depsOverrides: Seq[ModuleID],
updateConfig: Option[UpdateConfiguration],
sameVersions: Seq[Set[InclExclRule]],
enableDependencyOverrides: Option[Boolean],
log: Logger
): CoursierConfiguration = {
val coursierExcludeDeps = Inputs
@ -252,6 +308,7 @@ object LMCoursier {
.withForceVersions(userForceVersions.toVector)
.withMissingOk(missingOk)
.withSameVersions(sameVersions)
.withEnableDependencyOverrides(enableDependencyOverrides)
}
def coursierConfigurationTask: Def.Initialize[Task[CoursierConfiguration]] = Def.task {
@ -279,6 +336,7 @@ object LMCoursier {
dependencyOverrides.value,
Some(updateConfiguration.value),
csrSameVersions.value,
Some(csrMavenDependencyOverride.value),
streams.value.log
)
}
@ -308,6 +366,7 @@ object LMCoursier {
dependencyOverrides.value,
Some(updateConfiguration.value),
csrSameVersions.value,
Some(csrMavenDependencyOverride.value),
streams.value.log
)
}
@ -337,6 +396,7 @@ object LMCoursier {
dependencyOverrides.value,
Some(updateConfiguration.value),
csrSameVersions.value,
Some(csrMavenDependencyOverride.value),
streams.value.log
)
}
@ -366,6 +426,7 @@ object LMCoursier {
dependencyOverrides.value,
Some(updateConfiguration.value),
csrSameVersions.value,
Some(csrMavenDependencyOverride.value),
streams.value.log
)
}

View File

@ -12,10 +12,10 @@ object Dependencies {
sys.env.get("BUILD_VERSION") orElse sys.props.get("sbt.build.version")
// sbt modules
private val ioVersion = nightlyVersion.getOrElse("1.10.2")
private val ioVersion = nightlyVersion.getOrElse("1.10.3")
private val lmVersion =
sys.props.get("sbt.build.lm.version").orElse(nightlyVersion).getOrElse("1.10.3")
val zincVersion = nightlyVersion.getOrElse("1.10.5")
val zincVersion = nightlyVersion.getOrElse("1.10.7")
private val sbtIO = "org.scala-sbt" %% "io" % ioVersion
@ -77,7 +77,7 @@ object Dependencies {
def addSbtZincCompile = addSbtModule(sbtZincPath, "zincCompile", zincCompile)
def addSbtZincCompileCore = addSbtModule(sbtZincPath, "zincCompileCore", zincCompileCore)
val lmCoursierShaded = "io.get-coursier" %% "lm-coursier-shaded" % "2.1.6"
val lmCoursierShaded = "io.get-coursier" %% "lm-coursier-shaded" % "2.1.7"
def sjsonNew(n: String) =
Def.setting("com.eed3si9n" %% n % "0.10.1") // contrabandSjsonNewVersion.value

View File

@ -4,6 +4,7 @@ libraryDependencies ++= Seq(
"org.slf4j" % "slf4j-api" % "1.7.2",
"ch.qos.logback" % "logback-classic" % "1.0.7"
)
csrMavenDependencyOverride := false
TaskKey[Unit]("check") := {
val report = updateFull.value