Skip to content

Commit

Permalink
Merge pull request #54 from scalacenter/disable-dependency-check
Browse files Browse the repository at this point in the history
Disable dependency checks if no compatibility is intended
  • Loading branch information
julienrf authored Jan 8, 2021
2 parents 35e43e1 + 9a9ea2c commit a605d2e
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ object SbtVersionPolicySettings {
sys.error("Compile configuration not found in update report")
}

val maybeCompatibilityIntention = versionPolicyIntention.?.value
val depRes = versionPolicyDependencyResolution.value
val scalaModuleInf = versionPolicyScalaModuleInfo.value
val updateConfig = versionPolicyUpdateConfiguration.value
Expand Down Expand Up @@ -168,27 +169,31 @@ object SbtVersionPolicySettings {
ours ++ fromCsrConfig0 ++ fallback
}

val currentModules = DependencyCheck.modulesOf(compileReport, sv, sbv, log)

val previousModuleIds = versionPolicyPreviousArtifacts.value

previousModuleIds.map { previousModuleId =>
// Skip dependency check if no compatibility is intended
if (maybeCompatibilityIntention.contains(Compatibility.None)) Nil else {

val currentModules = DependencyCheck.modulesOf(compileReport, sv, sbv, log)

val report0 = DependencyCheck.report(
currentModules,
previousModuleId,
reconciliations,
VersionCompatibility.Strict,
sv,
sbv,
depRes,
scalaModuleInf,
updateConfig,
warningConfig,
log
)
previousModuleIds.map { previousModuleId =>

(previousModuleId, report0)
val report0 = DependencyCheck.report(
currentModules,
previousModuleId,
reconciliations,
VersionCompatibility.Strict,
sv,
sbv,
depRes,
scalaModuleInf,
updateConfig,
warningConfig,
log
)

(previousModuleId, report0)
}
}
},
versionPolicyReportDependencyIssues := {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ lazy val core = project
libraryDependencies ++= Seq(
"com.chuusai" %% "shapeless" % "2.3.3",
"io.argonaut" %% "argonaut" % "6.1a"
)
),
versionPolicyIntention := Compatibility.BinaryCompatible
)
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,17 @@ lazy val g = project
version := "0.1.1"
)

lazy val h = project
.settings(
shared,
name := "simple-test",
libraryDependencies ++= Seq(
"com.chuusai" %% "shapeless" % "2.3.3"
),
versionPolicyDependencyRules += "com.chuusai" %% "shapeless" % "strict",
version := "0.1.0+3-1234abcd" // Version number typically produced by sbt-dynver
)

inThisBuild(List(
scalaVersion := "2.12.11",
organization := "io.github.alexarchambault.sbtversionpolicy.test",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
> e/versionPolicyReportDependencyIssues
-> f/versionPolicyReportDependencyIssues
> g/versionPolicyReportDependencyIssues
-> h/versionPolicyReportDependencyIssues
> set h/versionPolicyIntention := Compatibility.None
> h/versionPolicyReportDependencyIssues

0 comments on commit a605d2e

Please sign in to comment.