-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from alexarchambault/develop
Tweaking
- Loading branch information
Showing
10 changed files
with
146 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
src/main/scala/sbtcompatibility/SbtCompatibilityInternalKeys.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package sbtcompatibility | ||
|
||
import coursier.version.{ModuleMatchers, VersionCompatibility} | ||
import lmcoursier.CoursierConfiguration | ||
import sbt._ | ||
import sbt.librarymanagement.{DependencyResolution, ScalaModuleInfo, UpdateConfiguration, UnresolvedWarningConfiguration} | ||
|
||
trait SbtCompatibilityInternalKeys { | ||
final val compatibilityCsrConfiguration = taskKey[CoursierConfiguration]("CoursierConfiguration instance to use to fetch previous versions dependencies") | ||
final val compatibilityDependencyResolution = taskKey[DependencyResolution]("DependencyResolution instance to use to fetch previous versions dependencies") | ||
final val compatibilityUpdateConfiguration = taskKey[UpdateConfiguration]("") | ||
final val compatibilityUnresolvedWarningConfiguration = taskKey[UnresolvedWarningConfiguration]("") | ||
final val compatibilityScalaModuleInfo = taskKey[Option[ScalaModuleInfo]]("") | ||
|
||
final val compatibilityIgnoreSbtDefaultReconciliations = taskKey[Boolean]("") | ||
final val compatibilityUseCsrConfigReconciliations = taskKey[Boolean]("") | ||
|
||
final val compatibilityAutoPreviousArtifacts = taskKey[Seq[ModuleID]]("") | ||
final val compatibilityPreviousArtifactsFromMima = taskKey[Seq[ModuleID]]("") | ||
final val compatibilityPreviousVersions = taskKey[Seq[String]]("") | ||
|
||
final val compatibilityDetailedReconciliations = taskKey[Seq[(ModuleMatchers, VersionCompatibility)]]("") | ||
final val compatibilityFallbackReconciliations = taskKey[Seq[(ModuleMatchers, VersionCompatibility)]]("") | ||
} |
27 changes: 9 additions & 18 deletions
27
src/main/scala/sbtcompatibility/SbtCompatibilityKeys.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,25 @@ | ||
package sbtcompatibility | ||
|
||
import coursier.version.{ModuleMatchers, VersionCompatibility} | ||
import lmcoursier.CoursierConfiguration | ||
import coursier.version.VersionCompatibility | ||
import sbt._ | ||
import sbt.librarymanagement.{DependencyResolution, ScalaModuleInfo, UpdateConfiguration, UnresolvedWarningConfiguration} | ||
import sbt.librarymanagement.DependencyBuilders.OrganizationArtifactName | ||
|
||
trait SbtCompatibilityKeys { | ||
final val compatibilityPreviousArtifacts = taskKey[Seq[ModuleID]]("") | ||
final val compatibilityReportDependencyIssues = taskKey[Unit]("") | ||
final val compatibilityCheck = taskKey[Unit]("Runs both compatibilityReportDependencyIssues and mimaReportBinaryIssues") | ||
|
||
final val compatibilityReconciliations = taskKey[Seq[ModuleID]]("") | ||
final val compatibilityRules = taskKey[Seq[ModuleID]]("") | ||
@deprecated("Use compatibilityRules instead", "0.0.8") | ||
final def compatibilityReconciliations = compatibilityRules | ||
final val compatibilityIgnored = taskKey[Seq[OrganizationArtifactName]]("") | ||
final val compatibilityDetailedReconciliations = taskKey[Seq[(ModuleMatchers, VersionCompatibility)]]("") | ||
final val compatibilityCheckDirection = taskKey[Direction]("") | ||
|
||
final val compatibilityFindDependencyIssues = taskKey[Seq[(ModuleID, DependencyCheckReport)]]("") | ||
|
||
final val compatibilityCsrConfiguration = taskKey[CoursierConfiguration]("CoursierConfiguration instance to use to fetch previous versions dependencies") | ||
final val compatibilityDependencyResolution = taskKey[DependencyResolution]("DependencyResolution instance to use to fetch previous versions dependencies") | ||
final val compatibilityUpdateConfiguration = taskKey[UpdateConfiguration]("") | ||
final val compatibilityUnresolvedWarningConfiguration = taskKey[UnresolvedWarningConfiguration]("") | ||
final val compatibilityScalaModuleInfo = taskKey[Option[ScalaModuleInfo]]("") | ||
final val compatibilityDefaultRules = taskKey[Seq[ModuleID]]("") | ||
final val compatibilityDefaultReconciliation = taskKey[Option[VersionCompatibility]]("") | ||
|
||
final val compatibilityIgnoreSbtDefaultReconciliations = taskKey[Boolean]("") | ||
final val compatibilityUseCsrConfigReconciliations = taskKey[Boolean]("") | ||
final val compatibilityDefaultReconciliation = taskKey[VersionCompatibility]("") | ||
|
||
final val compatibilityAutoPreviousArtifacts = taskKey[Seq[ModuleID]]("") | ||
final val compatibilityPreviousArtifactsFromMima = taskKey[Seq[ModuleID]]("") | ||
final val compatibilityPreviousVersions = taskKey[Seq[String]]("") | ||
} | ||
final val compatibilityInternal: SbtCompatibilityInternalKeys = | ||
new SbtCompatibilityInternalKeys {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
lazy val v1 = project | ||
.settings( | ||
check := {}, | ||
name := "defaults-test", | ||
libraryDependencies ++= Seq( | ||
"org.scala-lang.modules" %% "scala-xml" % "1.0.6", | ||
"com.fasterxml.jackson.core" % "jackson-databind" % "2.10.4" | ||
), | ||
version := "0.1.0" | ||
) | ||
|
||
lazy val bumpScala = project | ||
.settings( | ||
name := "defaults-test", | ||
libraryDependencies ++= Seq( | ||
"org.scala-lang.modules" %% "scala-xml" % "1.2.0", | ||
"com.fasterxml.jackson.core" % "jackson-databind" % "2.10.4" | ||
), | ||
version := "0.1.1", | ||
checkFails | ||
) | ||
|
||
lazy val bumpJava = project | ||
.settings( | ||
name := "defaults-test", | ||
libraryDependencies ++= Seq( | ||
"org.scala-lang.modules" %% "scala-xml" % "1.0.6", | ||
"com.fasterxml.jackson.core" % "jackson-databind" % "2.11.0" | ||
), | ||
version := "0.1.1" | ||
) | ||
|
||
lazy val bumpScalaAndAddRule = project | ||
.settings( | ||
name := "defaults-test", | ||
libraryDependencies ++= Seq( | ||
"org.scala-lang.modules" %% "scala-xml" % "1.2.0", | ||
"com.fasterxml.jackson.core" % "jackson-databind" % "2.10.4" | ||
), | ||
version := "0.1.1", | ||
compatibilityRules += "org.scala-lang.modules" %% "*" % "semver" | ||
) | ||
|
||
inThisBuild(List( | ||
scalaVersion := "2.12.11", | ||
organization := "io.github.alexarchambault.sbtcompatibility.test", | ||
)) | ||
|
||
lazy val check = taskKey[Unit]("") | ||
|
||
lazy val checkFails = Def.settings( | ||
check := { | ||
val direction = compatibilityCheckDirection.value | ||
val reports = compatibilityFindDependencyIssues.value | ||
val failed = reports.exists(!_._2.validated(direction)) | ||
assert(failed, s"Expected a failed report in $reports") | ||
} | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
addSbtPlugin("io.github.alexarchambault.sbt" % "sbt-compatibility" % sys.props("plugin.version")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
> v1/publishLocal | ||
-> bumpScala/compatibilityReportDependencyIssues | ||
> bumpScala/check | ||
> bumpJava/compatibilityReportDependencyIssues | ||
> bumpScalaAndAddRule/compatibilityReportDependencyIssues |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters