GithubHelp home page GithubHelp logo

eed3si9n / sbt-compatibility Goto Github PK

View Code? Open in Web Editor NEW

This project forked from scalacenter/sbt-version-policy

0.0 2.0 0.0 81 KB

Compatibility checks for your dependencies

License: Apache License 2.0

Scala 100.00%

sbt-compatibility's Introduction

sbt-compatibility

sbt-compatibility:

  • configures sbt-mima automatically
  • ensures that none of your dependencies are bumped or removed in an incompatible way.

How to use

Add to your project/plugins.sbt:

addSbtPlugin("ch.epfl.scala" % "sbt-compatibility" % "0.0.9")

The latest version is Maven Central.

sbt-compatibility depends on sbt-mima, so that you don't need to explicitly depend on it.

compatibilityCheck

The compatibilityCheck key:

  • runs mimaReportBinaryIssues,
  • along with compatibilityReportDependencyIssues

compatibilityReportDependencyIssues itself checks for

  • removed dependencies, or
  • dependencies bumped in an incompatible way,

and fails if any of these checks fails.

Automatic previous version calculation

sbt-compatibility automatically sets mimaPreviousArtifacts, depending on the current value of version, kind of like sbt-mima-version-check does. The previously compatible version is computed from version the following way:

  • drop any "metadata part" (anything after a +, including the + itself)
    • if the resulting version contains only zeros (like 0.0.0), leave mimaPreviousArtifacts empty,
    • else if the resulting version does not contain a qualifier (see below), it is used in mimaPreviousArtifacts.
  • else, drop the qualifier part, that is any suffix like -RC1 or -M2 or -alpha or -SNAPSHOT
    • if the resulting version ends with .0, mimaPreviousArtifacts is left empty
    • else, the last numerical part of this version is decreased by one, and used in mimaPreviousArtifacts.

compatibilityPreviousArtifacts

compatibilityReportDependencyIssues compares the dependencies of compatibilityPreviousArtifacts to the current ones.

By default, compatibilityPreviousArtifacts relies on mimaPreviousArtifacts from sbt-mima, so that only setting / changing mimaPreviousArtifacts is enough for both sbt-mima and sbt-compatibility.

compatibilityRules

compatibilityRules allows to specify whether some version bumps are allowed or not, like

compatibilityRules += "org.scala-lang.modules" %% "scala-xml" % "semver"

The following compatility types are available:

  • semver: assumes the matched modules follow semantic versioning,
  • pvp: assumes the matched modules follow package versioning policy (quite common in Scala),
  • always: assumes all versions of the matched modules are compatible with each other,
  • strict: requires exact matches between the wanted and the selected versions of the matched modules.

If no rule for a module is found in compatibilityRules, compatibilityDefaultReconciliation is used as a compatibility type. It's default value is VersionCompatibility.PackVer (package versioning policy).

Acknowledgments

sbt-compatibility is funded by the Scala Center.

sbt-compatibility's People

Contributors

alexarchambault avatar julienrf avatar scala-steward avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.