Skip to content

Commit

Permalink
Merge pull request #340 from alejandrohdezma/feature/version-policy
Browse files Browse the repository at this point in the history
Add `sbt-version-policy`
  • Loading branch information
alejandrohdezma authored Jan 15, 2024
2 parents b08388e + de97a60 commit 8d00d51
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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)))
Expand Down
7 changes: 6 additions & 1 deletion modules/sbt-ci/src/main/scala/sbt/ci/SbtCiPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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] {
Expand All @@ -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(
Expand All @@ -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 {
Expand Down

0 comments on commit 8d00d51

Please sign in to comment.