From 726d8f95859e3baa8e2ce7248e18986f2729859d Mon Sep 17 00:00:00 2001 From: "Yang, Bo" Date: Tue, 2 Nov 2021 19:10:16 -0700 Subject: [PATCH] Add DefaultVersionScheme plugin --- build.sbt | 5 ++++- .../versionScheme/DefaultVersionScheme.scala | 9 +++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 version-scheme/src/main/scala/com/thoughtworks/sbtBestPractice/versionScheme/DefaultVersionScheme.scala diff --git a/build.sbt b/build.sbt index 48b13da..40cafe8 100644 --- a/build.sbt +++ b/build.sbt @@ -22,6 +22,8 @@ lazy val mima = project lazy val `skip-duplicate-java-publish` = project +lazy val `version-scheme` = project + dependsOn( `scalac-options`, `detect-license`, @@ -31,7 +33,8 @@ dependsOn( `publish-unidoc`, `detect-scala-organization`, `subdirectory-organization`, - `skip-duplicate-java-publish` + `skip-duplicate-java-publish`, + `version-scheme` ) libraryDependencies += "com.lihaoyi" %% "sourcecode" % "0.2.7" diff --git a/version-scheme/src/main/scala/com/thoughtworks/sbtBestPractice/versionScheme/DefaultVersionScheme.scala b/version-scheme/src/main/scala/com/thoughtworks/sbtBestPractice/versionScheme/DefaultVersionScheme.scala new file mode 100644 index 0000000..f6e6a19 --- /dev/null +++ b/version-scheme/src/main/scala/com/thoughtworks/sbtBestPractice/versionScheme/DefaultVersionScheme.scala @@ -0,0 +1,9 @@ +package com.thoughtworks.sbtBestPractice.versionScheme + +import sbt.AutoPlugin +import sbt._, Keys._ + +object DefaultVersionScheme extends AutoPlugin { + override def trigger = allRequirements + override def buildSettings = Seq(ThisBuild / versionScheme := Some(VersionScheme.SemVerSpec)) +}