Skip to content

Commit

Permalink
Merge pull request #14 from alexarchambault/develop
Browse files Browse the repository at this point in the history
Tweaking
  • Loading branch information
alexarchambault authored Jun 8, 2020
2 parents 56c7531 + 6668862 commit 54b53e0
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 2 deletions.
14 changes: 13 additions & 1 deletion src/main/scala/sbtcompatibility/SbtCompatibilityPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,25 @@ object SbtCompatibilityPlugin extends AutoPlugin {
override def trigger = allRequirements
override def requires = MimaPlugin

private def mimaIgnoreVersion(version: String): Seq[Def.Setting[_]] =
Def.settings(
MimaPlugin.autoImport.mimaPreviousArtifacts := {
val value = MimaPlugin.autoImport.mimaPreviousArtifacts.value
value.filter(_.revision != version)
}
)

object autoImport extends SbtCompatibilityKeys {
val VersionCompatibility = coursier.version.VersionCompatibility
def compatibilityIgnoreVersion(version: String): Seq[Def.Setting[_]] =
SbtCompatibilityPlugin.mimaIgnoreVersion(version)
}

override def buildSettings =
SbtCompatibilitySettings.reconciliationBuildSettings

override def projectSettings =
SbtCompatibilitySettings.updateSettings ++
SbtCompatibilitySettings.reconciliationSettings ++
SbtCompatibilitySettings.previousArtifactsSettings ++
SbtCompatibilitySettings.findIssuesSettings
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ object SbtCompatibilitySettings {
compatibilityScalaModuleInfo := scalaModuleInfo.value
)

def reconciliationSettings = Def.settings(
def reconciliationBuildSettings = Def.settings(
compatibilityCheckDirection := Direction.backward,
compatibilityIgnoreSbtDefaultReconciliations := true,
compatibilityUseCsrConfigReconciliations := true,
Expand Down
24 changes: 24 additions & 0 deletions src/sbt-test/sbt-compatibility/in-this-build/build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
lazy val a = project
.settings(
name := "simple-test",
libraryDependencies ++= Seq(
"org.scala-lang.modules" %% "scala-xml" % "1.0.6"
),
version := "0.1.0"
)

lazy val b = project
.settings(
name := "simple-test",
libraryDependencies ++= Seq(
"org.scala-lang.modules" %% "scala-xml" % "1.2.0"
),
version := "0.1.1"
)

inThisBuild(List(
scalaVersion := "2.12.11",
organization := "io.github.alexarchambault.sbtcompatibility.test2",
compatibilityReconciliations += "org.scala-lang.modules" %% "scala-xml" % "semver"
))

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
addSbtPlugin("io.github.alexarchambault.sbt" % "sbt-compatibility" % sys.props("plugin.version"))
2 changes: 2 additions & 0 deletions src/sbt-test/sbt-compatibility/in-this-build/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
> a/publishLocal
> b/compatibilityReportDependencyIssues

0 comments on commit 54b53e0

Please sign in to comment.