A simple Sass compiler for gradle (tested only on Gradle 6.0+). Given a folder containing .sass and .css files, the plugin will compile them into a single file.
The plugin does not seem to work on a linux environment due to a dependency bug. For an alternative and for more information read here
Import the plugin using one of these:
plugins {
id "com.leobia.gradle.sassjavacompiler" version "0.2.1"
}
or using legacy plugin app:
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "gradle.plugin.com.leobia.gradle:sassjavacompiler:0.2.1"
}
}
apply plugin: "com.leobia.gradle.sassjavacompiler"
The usage of the plugin it's pretty simple, first you define the options (inside the build.gradle):
sassOptions {
inputPath = file("./resources/")
outputPath = file("./resources/minified/")
outputStyle = "compressed"
sass = true
indentWithTabs = false
}
Option | Type | Description |
---|---|---|
inputPath* | String | It telss the plugin where to search input files (not recursive) |
outputPath | String | Directory where output should be saved (will be saved as style.css) |
sass | Boolean | Tells which files should be considered, true -> .sass, false -> .scss |
outputStyle | String | Possible values: nested (default), compressed (minified), compact and expanded |
and then you can call the task:
compileSass
- Leonardo Bianco - leobia
Checkout my Gradle JsCompiler
This project is licensed under the MIT License - see the LICENSE.md file for details