Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sbt-ci-release #121

Merged
merged 1 commit into from
Jan 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -48,15 +48,15 @@ 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
that are required for compilation. Beyond just `main.less`, you can use an expression in your `build.sbt` like the
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.
Expand All @@ -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
28 changes: 25 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -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",
"[email protected]",
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",
Expand All @@ -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
}
2 changes: 2 additions & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
addSbtPlugin("com.github.sbt" % "sbt-web-build-base" % "2.0.2")

addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12")
1 change: 0 additions & 1 deletion version.sbt

This file was deleted.