Source

gradle-less-plugin /

Filename Size Date modified Message
gradle
src
106 B
47 B
182 B
9.9 KB
3.0 KB
1003 B
3.1 KB
5.0 KB
2.3 KB

Overview

The LESS plugin is a Gradle plugin for compiling LESS files into CSS files. It is available for use under the Apache License, Version 2.0. If you have any issues, please check the issue tracker, and if there isn't anything relevant, submit a new issue.

Distribution

The plugin is distributed via Bintray. If desired, you can use the Bintray plugin to simplify the configuration of Bintray repositories within Gradle build scripts.

Usage

To use the plugin, configure your build.gradle based the example below. See the CHANGES file for a listing of versions.

buildscript {
    repositories {
        maven {
            name = 'BintrayJCenter'
            url = 'http://jcenter.bintray.com'
        }
    }
    dependencies {
        classpath 'us.carrclan.david.gradle:gradle-less-plugin:VERSION'
    }
}
apply plugin: 'less'

Site Plugin Integration

The LESS plugin integrates with the Site plugin to provide a useful default configuration if both are applied.

Project Layout

The LESS plugin assumes the project layout shown below when used with the Site plugin.

Directory Meaning
src/site/less Site LESS files

Tasks

If the Site plugin is applied, the LESS plugin adds a task to your project, as shown below. Additionally, it adds a dependency on lessCompileSite to the publishSite task registered by the Site plugin.

Task name Depends on Type Description
lessCompileSite - LessCompile Compiles the site LESS files.

Task Defaults: lessCompileSite

Task Property Type Default Value
sourceDir Object "src/site/less"
destinationDir File "${site.sourceSet.output.resourceDir}/css"
encoding String None
compress Boolean None

LessCompile

The plugin introduces a new task type, LessCompile, which performs LESS compilation using lesscss-java.

Task Property Type Description
sourceDir Object The path to the LESS source files to compile.
destinationDir File The destination for the compiled CSS files.
encoding String The encoding with with to write the CSS files.
compress Boolean Whether to enable the LESS compiler's minification.
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.