scalasbtscanamo

How setup dependency in sbt library for version like `1.0.0-M10` and above


I want write library, which should work with artifact "org" %% "scanamo" version 1.0.0-M10 and above, eg 1.0.0-M11, 1.0.0-RC1, 1.0.1. But version should select library's user.

I tired "org" %% "scanamo" % "1.0.+" in sbt, but it cant find any versions.

How I can setup user provided dependency in library with rule "1.0.0-M10 and above"


Solution

  • There is no such feature.

    As a library, you specify the version that you need. Just a single specific version.

    If the library user chooses to use a different version (or another dependency pulls in a different version), the highest version will be chosen.

    That higher version may or may not work with your library. If SBT thinks (according to semantic versioning rules) that the version may be incompatible it will print a warning. But it is up to the user to figure out if it will work or not.

    It is a bit of a mess. Especially in Scalaland, where incompatible library updates are frequent.

    How I can setup user provided dependency in library with rule "1.0.0-M10 and above"

    You depend on org" %% "scanamo" % "1.0.0-M10". You hope that later versions stay compatible with it.