No Maintenance Intended

No Maintenance Intended

You are welcome to fork this project if desired, but the original author isn't planning on further contributing to it. You might consider trying JBake (related blog post) or Grain instead.


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.

Build Status


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.


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 = ''
    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


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


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.