From d15b60630378fc886e2f68d0954314184d7a829c Mon Sep 17 00:00:00 2001 From: Matthias Kurz Date: Sat, 13 Jan 2024 01:24:47 +0100 Subject: [PATCH] Add sbt-ci-release --- README.md | 16 +++++++--------- build.sbt | 28 +++++++++++++++++++++++++--- project/plugins.sbt | 2 ++ version.sbt | 1 - 4 files changed, 34 insertions(+), 13 deletions(-) delete mode 100644 version.sbt diff --git a/README.md b/README.md index c71cfeb..0b149a3 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,15 @@ sbt-less ======== -[![Build Status](https://api.travis-ci.org/sbt/sbt-less.png?branch=master)](https://travis-ci.org/sbt/sbt-less) [![Download](https://api.bintray.com/packages/sbt-web/sbt-plugin-releases/sbt-less/images/download.svg)](https://bintray.com/sbt-web/sbt-plugin-releases/sbt-less/_latestVersion) +[![Build Status](https://github.com/sbt/sbt-less/actions/workflows/build-test.yml/badge.svg)](https://github.com/sbt/sbt-less/actions/workflows/build-test.yml) -Allows less to be used from within sbt. Builds on com.typesafe.sbt:js-engine in order to execute the less compiler along with +Allows less to be used from within sbt. Builds on com.github.sbt:js-engine in order to execute the less compiler along with the scripts to verify. js-engine enables high performance linting given parallelism and native JS engine execution. To use this plugin use the addSbtPlugin command within your project's plugins.sbt (or as a global setting) i.e.: ```scala -addSbtPlugin("com.typesafe.sbt" % "sbt-less" % "1.1.2") +addSbtPlugin("com.github.sbt" % "sbt-less" % "2.0.0") ``` Your project's build file also needs to enable sbt-web plugins. For example with build.sbt: @@ -48,7 +48,7 @@ verbose | Be verbose. The following sbt code illustrates how compression can be enabled: ```scala -LessKeys.compress in Assets := true +Assets / LessKeys.compress := true ``` By default only `main.less` is looked for given that the LESS compiler must be explicitly fed the files @@ -56,7 +56,7 @@ that are required for compilation. Beyond just `main.less`, you can use an expre following: ```scala -includeFilter in (Assets, LessKeys.less) := "foo.less" | "bar.less" +Assets / LessKeys.less / includeFilter := "foo.less" | "bar.less" ``` ...where both `foo.less` and `bar.less` will be considered for the LESS compiler. @@ -69,9 +69,7 @@ you may have a convention where any LESS file starting with an `_` should not be include all `.less` files but exclude any beginning with an `_` you can use the following declaration: ```scala -includeFilter in (Assets, LessKeys.less) := "*.less" +Assets / LessKeys.less / includeFilter := "*.less" -excludeFilter in (Assets, LessKeys.less) := "_*.less" +Assets / LessKeys.less / excludeFilter := "_*.less" ``` - -© Typesafe Inc., 2013, 2014 diff --git a/build.sbt b/build.sbt index 4f7fff2..89b4c31 100755 --- a/build.sbt +++ b/build.sbt @@ -1,6 +1,21 @@ -lazy val `sbt-less` = (project in file(".")).enablePlugins(SbtWebBase) +lazy val `sbt-less` = project in file(".") + +enablePlugins(SbtWebBase) + +sonatypeProfileName := "com.github.sbt.sbt-less" // See https://issues.sonatype.org/browse/OSSRH-77819#comment-1203625 + description := "sbt-web less plugin" +developers += Developer( + "playframework", + "The Play Framework Team", + "contact@playframework.com", + url("https://github.com/playframework") +) + +addSbtJsEngine("1.3.5") +addSbtWeb("1.5.3") + libraryDependencies ++= Seq( "org.webjars" % "less-node" % "2.7.2-1", "org.webjars" % "mkdirp" % "0.5.0", @@ -9,5 +24,12 @@ libraryDependencies ++= Seq( "org.webjars" % "es6-promise-node" % "2.1.1" ) -addSbtJsEngine("1.3.5") -addSbtWeb("1.5.3") +// Customise sbt-dynver's behaviour to make it work with tags which aren't v-prefixed +ThisBuild / dynverVTagPrefix := false + +// Sanity-check: assert that version comes from a tag (e.g. not a too-shallow clone) +// https://github.com/dwijnand/sbt-dynver/#sanity-checking-the-version +Global / onLoad := (Global / onLoad).value.andThen { s => + dynverAssertTagVersion.value + s +} diff --git a/project/plugins.sbt b/project/plugins.sbt index b40c6f7..6e4254c 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1 +1,3 @@ addSbtPlugin("com.github.sbt" % "sbt-web-build-base" % "2.0.2") + +addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12") diff --git a/version.sbt b/version.sbt deleted file mode 100644 index ab5848f..0000000 --- a/version.sbt +++ /dev/null @@ -1 +0,0 @@ -version := "1.1.3-SNAPSHOT"