GradleSassPlugin

Build Status Codacy Badge

Plugin for SASS compilation. It uses vaadin-sass-compiler.

About

Main features (besides SASS compilation):

Usage

Including in your project

buildscript {
  repositories {
    maven {
      url "https://plugins.gradle.org/m2/"
    }
  }
  dependencies {
    classpath "gradle.plugin.org.kravemir.gradle.sass:GradleSassPlugin:1.2.2"
  }
}

apply plugin: "org.kravemir.gradle.sass"

Or with new the plugin mechanism:

plugins {
  id "org.kravemir.gradle.sass" version "1.2.2"
}

Simple configuration with extensions

sass {
    main {
        srcDir = file("$projectDir/src/main/sass")
        outDir = file("$buildDir/css")
    }
}

Using as task

You may declare new tasks directly using SassCompileTask class, without applying plugin, just make sure to have correctly set buildscript.

Configuration

Source and output configuration:

Name Description
srcDir (required) source directory containing sass files
outDir (required) output directory for generated resource/css files
outSubDir relative path for generated files within outDir, used together with registerInSourceSets
include pattern defining files to compile
exclude pattern defining excluded files from compilation (they can still be @import-ed)

Compilation properties:

Name Description
minify minifies compiled files within build configuration

Properties for integration with Java:

Name Description
registerInSourceSets list of sourceSet names to which outDir should be registered (affects classpath), see example build.gradle

License

All published versions are licensed under Apache 2.0. So, you're free to apply gradle plugin in commercial project.

You may also modify and redistribute the source, but with few limitations - see license.