From b263cb6b3cb4abb6eade80dd04cec062216c623c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Herna=CC=81ndez?= Date: Mon, 15 Jan 2024 13:25:56 +0100 Subject: [PATCH 1/2] Add `sbt-version-policy` to the build --- build.sbt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build.sbt b/build.sbt index 9fdc0ab..91f4a50 100644 --- a/build.sbt +++ b/build.sbt @@ -9,6 +9,8 @@ addCommandAlias("ci-publish", "versionCheck; github; ci-release") val `sbt-mdoc` = "org.scalameta" % "sbt-mdoc" % "[2.0,)" % Provided // scala-steward:off +val `sbt-version-policy` = "ch.epfl.scala" % "sbt-version-policy" % "[3.2,)" % Provided // scala-steward:off + lazy val documentation = project .enablePlugins(MdocPlugin) .settings(mdocIn := file(".github") / "docs") @@ -17,6 +19,7 @@ lazy val documentation = project lazy val `sbt-ci` = module .settings(addSbtPlugin(`sbt-mdoc`)) + .settings(addSbtPlugin(`sbt-version-policy`)) .enablePlugins(SbtPlugin) .enablePlugins(BuildInfoPlugin) .settings(buildInfoKeys += BuildInfoKey("repo", repository.value.map(_.name))) From de97a6042b1913de5a41387c242d70cbe49e64f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Herna=CC=81ndez?= Date: Mon, 15 Jan 2024 13:27:29 +0100 Subject: [PATCH 2/2] Set default for `versionPolicyIgnoredInternalDependencyVersions` --- modules/sbt-ci/src/main/scala/sbt/ci/SbtCiPlugin.scala | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/sbt-ci/src/main/scala/sbt/ci/SbtCiPlugin.scala b/modules/sbt-ci/src/main/scala/sbt/ci/SbtCiPlugin.scala index 464d763..2e37c5a 100644 --- a/modules/sbt-ci/src/main/scala/sbt/ci/SbtCiPlugin.scala +++ b/modules/sbt-ci/src/main/scala/sbt/ci/SbtCiPlugin.scala @@ -22,6 +22,8 @@ import sbt.Keys.streams import sbt._ import com.alejandrohdezma.resource.generator.ResourceGenerator +import sbtversionpolicy.SbtVersionPolicyPlugin +import sbtversionpolicy.SbtVersionPolicyPlugin.autoImport.versionPolicyIgnoredInternalDependencyVersions /** This plugin generates (or updates) a bunch of files common to several projects. */ object SbtCiPlugin extends AutoPlugin with ResourceGenerator[Unit] { @@ -41,6 +43,8 @@ object SbtCiPlugin extends AutoPlugin with ResourceGenerator[Unit] { override def trigger = allRequirements + override def requires: Plugins = SbtVersionPolicyPlugin + import autoImport._ override def buildSettings = Seq( @@ -51,7 +55,8 @@ object SbtCiPlugin extends AutoPlugin with ResourceGenerator[Unit] { excludeFile = globPatterns.value, logger = streams.value.log.info(_) ) - } + }, + versionPolicyIgnoredInternalDependencyVersions := Some("^\\d+\\.\\d+\\.\\d+\\+\\d+".r) ) private val globPatterns = Def.setting {