Warn on missing versionScheme

Fixes https://github.com/sbt/sbt/issues/6303

This will print warning on publishing when versionScheme is not set.

```
[warn] versionScheme setting is empty; set `ThisBuild / versionScheme := Some("early-semver")` or `Some("pvp")`
[warn] so tooling can use it for evction errors etc - https://www.scala-sbt.org/1.x/docs/Publishing.html
```
This commit is contained in:
Eugene Yokota 2021-02-15 16:53:57 -05:00
parent da4e1d3711
commit 9cde1dfcaa
1 changed files with 8 additions and 0 deletions

View File

@ -3045,6 +3045,14 @@ object Classpaths {
)
},
publishConfiguration := {
val s = streams.value
val vs = versionScheme.value
if (vs.isEmpty)
s.log.warn(
s"""versionScheme setting is empty; set `ThisBuild / versionScheme := Some("early-semver")` or `Some("pvp")`
|so tooling can use it for evction errors etc - https://www.scala-sbt.org/1.x/docs/Publishing.html""".stripMargin
)
else ()
publishConfig(
publishMavenStyle.value,
deliverPattern(crossTarget.value),