diff --git a/sbt-version-policy/src/main/scala/sbtversionpolicy/SbtVersionPolicySettings.scala b/sbt-version-policy/src/main/scala/sbtversionpolicy/SbtVersionPolicySettings.scala index b231762..22d6929 100644 --- a/sbt-version-policy/src/main/scala/sbtversionpolicy/SbtVersionPolicySettings.scala +++ b/sbt-version-policy/src/main/scala/sbtversionpolicy/SbtVersionPolicySettings.scala @@ -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 @@ -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 := { diff --git a/sbt-version-policy/src/sbt-test/sbt-version-policy/run-mima/build.sbt b/sbt-version-policy/src/sbt-test/sbt-version-policy/run-mima/build.sbt index e4cd099..aa7d8f8 100644 --- a/sbt-version-policy/src/sbt-test/sbt-version-policy/run-mima/build.sbt +++ b/sbt-version-policy/src/sbt-test/sbt-version-policy/run-mima/build.sbt @@ -9,5 +9,6 @@ lazy val core = project libraryDependencies ++= Seq( "com.chuusai" %% "shapeless" % "2.3.3", "io.argonaut" %% "argonaut" % "6.1a" - ) + ), + versionPolicyIntention := Compatibility.BinaryCompatible ) diff --git a/sbt-version-policy/src/sbt-test/sbt-version-policy/simple/build.sbt b/sbt-version-policy/src/sbt-test/sbt-version-policy/simple/build.sbt index 96eb07a..000218a 100644 --- a/sbt-version-policy/src/sbt-test/sbt-version-policy/simple/build.sbt +++ b/sbt-version-policy/src/sbt-test/sbt-version-policy/simple/build.sbt @@ -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", diff --git a/sbt-version-policy/src/sbt-test/sbt-version-policy/simple/test b/sbt-version-policy/src/sbt-test/sbt-version-policy/simple/test index 38ec11d..efcb933 100644 --- a/sbt-version-policy/src/sbt-test/sbt-version-policy/simple/test +++ b/sbt-version-policy/src/sbt-test/sbt-version-policy/simple/test @@ -7,3 +7,6 @@ > e/versionPolicyReportDependencyIssues -> f/versionPolicyReportDependencyIssues > g/versionPolicyReportDependencyIssues +-> h/versionPolicyReportDependencyIssues +> set h/versionPolicyIntention := Compatibility.None +> h/versionPolicyReportDependencyIssues