Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.x] csrMavenDependencyOverride + Update lm-coursier to 2.1.7 + Zinc 1.10.7 #7970

Merged
merged 1 commit into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions main/src/main/scala/sbt/Defaults.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
1 change: 1 addition & 0 deletions main/src/main/scala/sbt/Keys.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
61 changes: 61 additions & 0 deletions main/src/main/scala/sbt/coursierint/LMCoursier.scala
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ object LMCoursier {
depsOverrides,
None,
Nil,
None,
log
)

Expand Down Expand Up @@ -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
)

Expand All @@ -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
Expand Down Expand Up @@ -252,6 +308,7 @@ object LMCoursier {
.withForceVersions(userForceVersions.toVector)
.withMissingOk(missingOk)
.withSameVersions(sameVersions)
.withEnableDependencyOverrides(enableDependencyOverrides)
}

def coursierConfigurationTask: Def.Initialize[Task[CoursierConfiguration]] = Def.task {
Expand Down Expand Up @@ -279,6 +336,7 @@ object LMCoursier {
dependencyOverrides.value,
Some(updateConfiguration.value),
csrSameVersions.value,
Some(csrMavenDependencyOverride.value),
streams.value.log
)
}
Expand Down Expand Up @@ -308,6 +366,7 @@ object LMCoursier {
dependencyOverrides.value,
Some(updateConfiguration.value),
csrSameVersions.value,
Some(csrMavenDependencyOverride.value),
streams.value.log
)
}
Expand Down Expand Up @@ -337,6 +396,7 @@ object LMCoursier {
dependencyOverrides.value,
Some(updateConfiguration.value),
csrSameVersions.value,
Some(csrMavenDependencyOverride.value),
streams.value.log
)
}
Expand Down Expand Up @@ -366,6 +426,7 @@ object LMCoursier {
dependencyOverrides.value,
Some(updateConfiguration.value),
csrSameVersions.value,
Some(csrMavenDependencyOverride.value),
streams.value.log
)
}
Expand Down
6 changes: 3 additions & 3 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading