robfletcher / gradle-compass

A SASS / Compass plugin for Gradle
Apache License 2.0
59 stars 39 forks source link

Can't run plugin on windows 10 #69

Open darrensw777 opened 7 years ago

darrensw777 commented 7 years ago

Hi,

I am trying to use the pulgin. It works on a linux machine, However when I use it on linux on windows 10 Home edition it is not working.

When running compass compile I am getting the following error. The is not much more information even when I run gradle --stacktrace clean compassCompile. Your help would be appreciated.

DEPRECATION WARNING: Sass 3.5 will no longer support Ruby 1.9.3. Please upgrade to Ruby 2.0.0 or greater as soon as possible. Errno::ESRCH on line ["952"] of org/jruby/RubyFile.java: No such process - C:/Users/SSR/dev/cfe-main/build/generated/css/scss/main.css Run with --trace to see the full backtrace

My gradle syntax is.

 dependencies {
        classpath 'net.saliman:gradle-cobertura-plugin:2.3.2'           
        classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") 
        classpath('org.kar:gradle-jslint-plugin:0.2') 
        classpath('org.unbroken-dome.gradle-plugins:gradle-testsets-plugin:1.0.2')
        classpath('com.github.robfletcher:compass-gradle-plugin:2.0.6')
        classpath ("com.github.jruby-gradle:jruby-gradle-plugin:0.1.17")
}

apply plugin: "com.github.robfletcher.compass"
def compassGroup='Compass'
compass {
    cssDir=file("$buildDir/generated/css")
    sassDir=file("$projectDir/src/main/webapp/css")
    fontsDir=file("$projectDir/src/main/webapp/css/fonts")
    imagesDir=file("$projectDir/src/main/webapp/images")
    sourcemap=false
    outputStyle='compressed'
}
task cleanGeneratedCSS(description:"Command to delete compiled css", group: compassGroup) << {
    def copiedMainCss = new File("$projectDir/src/main/webapp/css/main.css")
    copiedMainCss.delete()
    assert !copiedMainCss.exists()
    logger.lifecycle('Cleaned compiled Css from src')
}
task copyGeneratedCSSToSource(description:"Command to copy compiled css into source", group: compassGroup) << {
    def mainCss = new File("$buildDir/generated/css/scss/main.css")
    assert mainCss.exists()
    copy {
        from "$buildDir/generated/css/scss"
        into "$projectDir/src/main/webapp/css/"
    }
    def copiedMainCss = new File("$projectDir/src/main/webapp/css/main.css")
    assert copiedMainCss.exists()
    logger.lifecycle('Compiled Css copied into src')
}
compassCompile.dependsOn('cleanGeneratedCSS')
compassCompile.finalizedBy('copyGeneratedCSSToSource')
compassWatch.dependsOn('cleanGeneratedCSS')
compassWatch.finalizedBy('copyGeneratedCSSToSource')
compassWatch.group=compassGroup
compassWatchStop.group=compassGroup
processResources.finalizedBy('compassCompile')
war.dependsOn('compassCompile')
war.dependsOn('copyGeneratedCSSToSource')
copyGeneratedCSSToSource.mustRunAfter('compassCompile')
tmateri commented 7 years ago

Hi, i had the same problem, and i solved it this way:


gemDir =  file('src/main/resources/temp') 
sassDir = file('src/main/resources/someFolder')
cssDir = file(project.buildDir.absolutePath + "/resources/main/someFolder") 
//first create the directory @see  Errno::ESRCH on line ["952"] 
    sassDir.eachFileRecurse {
        if(it.isFile() && it.name.endsWith(".scss")){
            File temp= new File(it.absolutePath.replace(sassDir.absolutePath, cssDir.absolutePath)).parentFile
            if(!temp.exists())temp.mkdirs();
        }
    }