robfletcher / gradle-compass

A SASS / Compass plugin for Gradle
Apache License 2.0
60 stars 38 forks source link

Multiple executions - Illegal Null Value #62

Open JamesTPF opened 8 years ago

JamesTPF commented 8 years ago

I am trying to set up gradle so that I run the compass task twice to compile two sets of CSS files.

I have the following bits in my gradle file to achieve this:

buildscript {
  dependencies {
    classpath "com.github.robfletcher:compass-gradle-plugin:2.0.5"
}

apply plugin: "com.github.robfletcher.compass"

compass {
  debugInfo = true
  time = true
  sourcemap = true
}

task compassWeb(type: com.github.robfletcher.compass.CompassTask) {
  cssDir = file("src/main/webapp/web/css")
  sassDir = file("src/main/sass/web")
}

task compassMobile(type: com.github.robfletcher.compass.CompassTask) {
  cssDir = file("src/main/webapp/mobile/css")
  sassDir = sassDir = file("src/main/sass/mobile")
}

processResources.dependsOn("compassMobile", "compassWeb")

Each time I run this I get the same error:

Execution failed for task ':compassMobile'.
> Illegal null value provided in this collection: [-S, compass, null, --    sourcemap, --time, --debug-info, --sass-dir, /Users/.../src/main/sass/mobile, --css-dir, /Users/.../src/main/webapp/mobile/css]

The error seems to be the null after the 'compass' script argument.

This seems to be an issue with with the CompassTask or the JRubyExecTask. I've tried to follow the code in each plugin but I can't work out what I'm missing from my configuration.

Alternatively, is there a better way of achieving two executions of the grade task?