Skip to content

Commit

Permalink
Merge pull request #5 from adRise/do-dependency-resolution-with-runti…
Browse files Browse the repository at this point in the history
…me-configuration

fix runtime dependency resolution issue
  • Loading branch information
huajiang-tubi authored Jun 29, 2024
2 parents 24b2f6f + 8d7bd67 commit cd35b01
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ object SbtVersionPolicySettings {
val sv = scalaVersion.value
val sbv = scalaBinaryVersion.value

val compileReport = update.value.configuration(Compile).getOrElse {
val compileReport = update.value.configuration(Runtime).getOrElse {
sys.error("Compile configuration not found in update report")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ package sbtversionpolicy.internal

import coursier.version.{ModuleMatchers, VersionCompatibility}
import sbt.Compile
import sbt.librarymanagement.{ConfigurationReport, CrossVersion, ModuleID}
import sbt.librarymanagement.{ConfigurationReport, CrossVersion, DependencyResolution, ModuleID, ScalaModuleInfo, UnresolvedWarningConfiguration, UpdateConfiguration, syntax}
import sbt.util.Logger
import sbt.librarymanagement.{DependencyResolution, ScalaModuleInfo, UnresolvedWarningConfiguration, UpdateConfiguration}
import sbtversionpolicy.DependencyCheckReport

object DependencyCheck {
Expand Down Expand Up @@ -66,7 +65,7 @@ object DependencyCheck {

val previousReport = depRes.update(mod, updateConfig, warningConfig, log)
.fold(thing => throw thing.resolveException, identity)
val previousCompileReport = previousReport.configuration(Compile).getOrElse {
val previousCompileReport = previousReport.configuration(syntax.Runtime).getOrElse {
sys.error(s"Compile configuration not found in previous update report $previousReport")
}
val previousDependencies = DependencyCheck.modulesOf(previousCompileReport, excludedModules, sv, sbv, moduleToVersion, log)
Expand Down

0 comments on commit cd35b01

Please sign in to comment.