sbt-version-policy-dummy


License

License

Categories

Categories

Scala Languages
GroupId

GroupId

ch.epfl.scala
ArtifactId

ArtifactId

sbt-version-policy-dummy_2.12
Last Version

Last Version

1.0.0-RC4
Release Date

Release Date

Type

Type

jar
Description

Description

sbt-version-policy-dummy
sbt-version-policy-dummy
Project URL

Project URL

https://github.com/scalacenter/sbt-version-policy
Project Organization

Project Organization

ch.epfl.scala
Source Code Management

Source Code Management

https://github.com/scalacenter/sbt-version-policy

Download sbt-version-policy-dummy_2.12

How to add to project

<!-- https://jarcasting.com/artifacts/ch.epfl.scala/sbt-version-policy-dummy_2.12/ -->
<dependency>
    <groupId>ch.epfl.scala</groupId>
    <artifactId>sbt-version-policy-dummy_2.12</artifactId>
    <version>1.0.0-RC4</version>
</dependency>
// https://jarcasting.com/artifacts/ch.epfl.scala/sbt-version-policy-dummy_2.12/
implementation 'ch.epfl.scala:sbt-version-policy-dummy_2.12:1.0.0-RC4'
// https://jarcasting.com/artifacts/ch.epfl.scala/sbt-version-policy-dummy_2.12/
implementation ("ch.epfl.scala:sbt-version-policy-dummy_2.12:1.0.0-RC4")
'ch.epfl.scala:sbt-version-policy-dummy_2.12:jar:1.0.0-RC4'
<dependency org="ch.epfl.scala" name="sbt-version-policy-dummy_2.12" rev="1.0.0-RC4">
  <artifact name="sbt-version-policy-dummy_2.12" type="jar" />
</dependency>
@Grapes(
@Grab(group='ch.epfl.scala', module='sbt-version-policy-dummy_2.12', version='1.0.0-RC4')
)
libraryDependencies += "ch.epfl.scala" % "sbt-version-policy-dummy_2.12" % "1.0.0-RC4"
[ch.epfl.scala/sbt-version-policy-dummy_2.12 "1.0.0-RC4"]

Dependencies

compile (1)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.12.12

Project Modules

There are no modules declared in this project.

sbt-version-policy

sbt-version-policy:

Install

Add to your project/plugins.sbt:

addSbtPlugin("ch.epfl.scala" % "sbt-version-policy" % "<version>")

The latest version is Maven Central.

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

Configure

The plugin introduces a new key, versionPolicyIntention, that you need to set to the level of compatibility that your next release is intended to provide. It can take the following three values:

  • // Your next release will provide no compatibility guarantees with the
    // previous one.
    ThisBuild / versionPolicyIntention := Compatibility.None
  • // Your next release will be binary compatible with the previous one,
    // but it may not be source compatible.
    ThisBuild / versionPolicyIntention := Compatibility.BinaryCompatible
  • // Your next release will be both binary compatible and source compatible
    // with the previous one.
    ThisBuild / versionPolicyIntention := Compatibility.BinaryAndSourceCompatible

Use

Check that pull requests don’t break the intended compatibility level

In your CI server, run the task versionPolicyCheck on pull requests.

$ sbt versionPolicyCheck

This task checks that the PR does not break the compatibility guarantees claimed by your versionPolicyIntention. For instance, if your intention is to have BinaryAndSourceCompatible changes, the task versionPolicyCheck will fail if the PR breaks binary compatibility or source compatibility.

Check that release version numbers are valid with respect to the compatibility guarantees they provide

Before you cut a release, run the task versionCheck.

$ sbt versionCheck

Note: make sure that the version is set to the new release version number before you run versionCheck.

This task checks that the release version number is consistent with the intended compatibility level as per versionPolicyIntention. For instance, if your intention is to publish a release that breaks binary compatibility, the task versionCheck will fail if you didn’t bump the major version number.

How does versionPolicyCheck work?

The versionPolicyCheck task:

  • runs mimaReportBinaryIssues,
  • along with versionPolicyReportDependencyIssues

versionPolicyReportDependencyIssues 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-version-policy 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.

versionPolicyPreviousArtifacts

versionPolicyReportDependencyIssues compares the dependencies of versionPolicyPreviousArtifacts to the current ones.

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

Dependency compatibility adjustments

Set versionPolicyDependencyRules to specify whether library dependency upgrades are compatible or not. For instance:

versionPolicyDependencyRules += "org.scala-lang" % "scala-compiler" % "strict"

The following compatility types are available:

  • early-semver: assumes the matched modules follow a variant of Semantic Versioning that enforces compatibility within 0.1.z,
  • semver-spec: 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 versionPolicyDependencyRules, versionPolicyDefaultReconciliation is used as a compatibility type. Its default value is VersionCompatibility.PackVer (package versioning policy).

Acknowledgments

sbt-version-policy is funded by the Scala Center.

ch.epfl.scala

Scala Center

Versions

Version
1.0.0-RC4
1.0.0-RC3
1.0.0-RC2
1.0.0-RC1