Giter VIP home page Giter VIP logo

gradle-compass's Introduction

Gradle Compass plugin

A SASS / Compass plugin for Gradle. The plugin uses JRuby to install and run Compass.

Build Status

download

Tasks

The plugin adds the following tasks:

compassCompile

Compiles all SASS files. Equivalent to the compass compile command. The task supports incremental build.

compassWatch

Compiles and watches all SASS files. Equivalent to the compass watch command.

compassVersion

Prints out the compass version.

compassConfig

Writes compass configuration out to config/compass.rb.

Installation

Add the plugin like this:

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

buildscript {
  repositories {
    jcenter()
    maven { url "http://dl.bintray.com/robfletcher/gradle-plugins" }
  }
  dependencies {
    classpath "com.github.robfletcher:compass-gradle-plugin:2.0.5"
  }
}

Configuration

General configuration for the plugin goes inside a compass block in your build file and will apply to all tasks. You can also specify configuration properties on the individual tasks (for example you may want to set environment = "production" on the compileSass and debugInfo = true on watchSass). For example:

compass {
  cssDir = file("public/styles")
  sassDir = file("src/main/sass")
}

Configuration parameters

The full set of parameters supported by the plugin is…

Paths

  • cssDir: the target directory where compiled CSS is output. Equivalent to --css-dir. Defaults to build/stylesheets.

  • sassDir: the source directory where you keep .scss and/or .sass files. Equivalent to --sass-dir. Defaults to src/main/sass.

  • imagesDir: the source directory where you keep image files. Equivalent to --images-dir.

  • javascriptsDir: the source directory where you keep JavaScript files. You don’t need to specify this unless you have Compass extensions in your scripts. Equivalent to --javascripts-dir.

  • fontsDir: the source directory where you keep fonts. Equivalent to --fonts-dir.

  • importPath: a set of directories containing other Sass stylesheets. Specifying this allows you to reference those stylesheets in @import directives. Equivalent to --import-paths.

  • load: loads a framework or extensions found in the specified directory. Equivalent to --load.

  • loadAll: loads all frameworks or extensions found in the specified directory. Equivalent to --load-all.

Compilation options

  • sourcemap: if true Compass will generate a sourcemap during compilation. Equivaluent to --sourcemap.

  • debugInfo: if true (the default) Compass adds debug information to the compiled CSS. Equivalent to --debug-info if set to true or --no-debug-info if set to false.

  • force: if true Compass will overwrite existing files. Equivalent to --force.

  • environment: sets default options when set to 'development' (the default) or 'production'. Equivalent to --environment.

  • noLineComments: if true Compass will not output line comments to the compiled CSS files. Equivalent to --no-line-comments.

  • outputStyle: selects the style for compiled CSS. One of nested, expanded, compact (the default) or compressed. Eqivalent to --output-style.

  • relativeAssets: if true Compass will generate relative urls to assets. Equivalent to --relative-assets.

  • httpPath: sets the path to the root of the web application when deployed. Equivalent to --http-path.

  • generatedImagesPath: sets the path where generated images are stored. Equivalent to --generated-images-path.

Command line output

  • time: if true Compass will print timing information during compilation. Equivaluent to --time.

  • boring: if true colorized output is disabled. Equivalent to --boring.

  • quiet: if true Compass output is suppressed. Equivalent to --quiet.

  • trace: if true Compass displays full stack traces on error. Equivalent to --trace.

Dependency options

  • gemDir: the directory where the Compass gem (and any other gems you specify) will be installed. Defaults to build/tmp/gems. You may want to override this to use a shared location in multi-project builds so that gems only get downloaded once.

Specifying the Compass version

By default the plugin will use the latest version of Compass available. If you need a specific version you can set the version using Gradle’s dependency management. For example:

dependencies {
  compass "rubygems:compass:1.0.1"
}

Gems are installed using the JRuby Gradle plugin. The Compass plugin creates a special "compass" configuration that is used by all the plugin’s tasks.

Cleaning output

The Compass plugin creates a cleanCompassCompile task automatically that will delete compiles CSS. The main clean task will also delete CSS assuming cssDir is inside the project’s build directory.

Using additional gems

You can use Compass extensions from Ruby gems by adding dependencies to the compass configuration. The plugin will automatically add a --require argument for each gem when invoking Compass commands. For example to use the [Breakpoint][breakpoint] extension:

dependencies {
  compass "rubygems:breakpoint:2.5.0"
}

Automatically recompiling stylesheets while other tasks are running

A typical use-case is to run compassWatch in the background while another task runs your web-server application. This is very easy with the Compass plugin.

Assuming you’re using the Application plugin's run task you would configure your build with:

run.dependsOn compassWatchStart
run.finalizedBy compassWatchStop

Advanced Gem Install Options

You can specify additional options to gem install:

compass {
	gems = [
		[
			name: "compass",
			version: "0.12.7",
		],
		[
			name: "compass-css-arrow",
			version: "0.0.4",
			opts: ["--ignore-dependencies"],
		],
	]
}

Version history

2.0.5

  • Fixes JDK version compatibility so plugin can be used with Java 1.7.

2.0.5

  • No custom compassClean task – instead apply the base plugin so we get cleanup by convention.

2.0.4

  • Allow setting of directory where compass gems get installed (mainly this helps the integration tests run in a sane amount of time but it’s also useful for multi-project builds).

2.0.3

  • Fixes problem with POM configuration that meant transitive dependencies didn’t work.

2.0.2

2.0

1.0.10

  • added ability to specify gem versions.

1.0.9

  • use additional gems without needing a config.rb file.

1.0.8

  • added ability to specify additional gems.

1.0.7

  • made javascriptsDir, imagesDir and importPath optional.

1.0.6

  • added ability to specify importPath.

1.0.5

1.0.4

  • added ability to specify file encoding used by JRuby.

gradle-compass's People

Contributors

britter avatar davidmc24 avatar emmanueldemey avatar erickpintor avatar michaelwoodson avatar munnja001 avatar robfletcher avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

gradle-compass's Issues

Unable to resolve dependency for rb-inotify

Since about a week ago, there has been an issue trying to run this plugin. If the gems aren't already set up, dependency resolution will give this error:

:testproject:compassCompile FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':interact:compassCompile'.
> Could not resolve all dependencies for configuration ':testproject:compass'.
   > Could not find rb-inotify.gem (rubygems:rb-inotify:0.9.7).
     Searched in the following locations:
         http://rubygems-proxy.torquebox.org/releases/rubygems/rb-inotify/0.9.7/rb-inotify-0.9.7.gem

The underlying issue seems to be internal changes in the jruby-gradle-plugin that switch a maven gem proxy from http://rubygems-proxy.torquebox.org to http://rubygems.lasagna.io/.

Any clean build should reproduce this error, but I could make a build file if needed.

I made a pull request to upgrade dependencies as an option to resolve this problem:
#55

Possibility to configure compass using config.rb

In a recent project we have the following setup:

project-root
    └ src/main/webapp/resources
        ├ css/sass
        │  └ main.scss
        └ config.rb

the config.rb files contains the compass paths relativ to the current directory and additional configuration:

css_dir = "styles"
sass_dir = "css/sass"
fonts_dir = "fonts"
images_dir = "images"
javascripts_dir = "js"

output_style = :compressed
relative_assets = true
line_comments = false

This file is used for manual compilation of the scss files. Now I want to use the gradle-compass plugin without repeating the above configuration. But when I use src/main/webapps/resources as sassDir I'm getting the following error:

Errno::ESRCH on line ["941"] of org/jruby/RubyFile.java: No such process - C:/ws/project-root/build/stylesheets/css/sass/main.css
  C:/ws/project-root/build/tmp/gems/gems/sass-3.4.13/lib/sass/plugin/staleness_checker.rb:65:in `stylesheet_needs_update?'
  C:/ws/project-root/build/tmp/gems/gems/sass-3.4.13/lib/sass/plugin/compiler.rb:211:in `update_stylesheets'
  org/jruby/RubyArray.java:1613:in `each'

b/sass/plugin/compiler.rb:209:in `update_stylesheets'
  C:/ws/project-root/build/tmp/gems/gems/compass-1.0.3/lib/compass/sass_compiler.rb:40:in `compile!'

lib/compass/commands/update_project.rb:49:in `perform'

lib/compass/commands/base.rb:18:in `execute'

lib/compass/commands/project_base.rb:19:in `execute'

lib/compass/exec/sub_command_ui.rb:43:in `perform!'
  C:/ws/project-root/build/tmp/gems/gems/compass-1.0.3/lib/compass/exec/sub_command_ui.rb:15:in `run!'
  C:/ws/project-root/build/tmp/gems/gems/compass-1.0.3/bin/compass:30:in `(root)'
  org/jruby/RubyProc.java:271:in `call'
  C:/ws/project-root/build/tmp/gems/gems/compass-1.0.3/bin/compass:44:in `(root)'


(root)'

I know I can specify all of the config.rb settings in the gradle file as well but I'd like to keep the possibility to compile the stylesheets without gradle and without duplicating the configuration. Is this possible using gradle-compass?

Using a specific version of a gem does not work

I'm using this plugin to compile bootstrap-sass and everything works as expected unless I try to use a specific version of bootstrap-sass. Then I receive this error:

:installCompass
Successfully installed compass-0.12.3
ERROR:  Could not find a valid gem 'bootstrap-sass:3.1.1.0' (>= 0) in any repository
ERROR:  Possible alternatives: bootstrap-sass, bootstrap-sass-rtl, bootstrap-assets, bootstrap-jasny, bootstrap-sass-keppy

So this build script works and installs a gem "bootstrap-sass-3.1.1.0":

buildscript {
  repositories {
    mavenCentral()
    maven { url 'http://dl.bintray.com/robfletcher/gradle-plugins' }
  }
  dependencies {
    classpath 'org.gradle.plugins:gradle-compass:1.0.9'
  }
} 
...
compass {
 gems = ['compass', 'bootstrap-sass']
}

But if I specify

compass {
 gems = ['compass', 'bootstrap-sass:3.1.1.0']
}

or any other version I receive the aforementioned error message.

Nothing happens if i call `gradle watchSass`

I called gradle watchSass and nothing happened. Then I created task that depends on watchSass, make it sleeping for a long time and it works. May be it make sence to add task that will execute watchSass forever?

Install Compass fails with rubygems ffi version > 1.9.10

The rubygems ffi artifact was updated on 2016-07-05. None of the versions since then(1.9.11, 1.9.12, 1.9.13) work with gradle-compass 2.0.6 while doing a clean build.

Here's the error I see when doing gradle clean compassCompile for any of the recent updated versions:

Building native extensions.  This could take a while...
ERROR:  Error installing /root/.gradle/caches/modules-2/files-2.1/rubygems/ffi/1.9.13/3cbb2db4b73bcf1ea3b2a911c7482092ff375df5/ffi-1.9.13.gem:
    ERROR: Failed to build gem native extension.

    java -jar /root/.gradle/caches/modules-2/files-2.1/org.jruby/jruby-complete/1.7.17/dddc7eaf89c4cd2eb88b8c2e696f149f3eb58b8/jruby-complete-1.7.17.jar extconf.rb
/bin/sh: java: command not found

If I do gradle compassCompile after that without the clean, the build passes but things aren't all properly compiled.

To get around this issue I forced the 1.9.10 version of ffi for my build.

Need jcenter in example

dependency reolution failed with

buildscript {
    repositories {
        mavenCentral()
        maven { url "http://dl.bintray.com/robfletcher/gradle-plugins" }
    }
    dependencies {
        classpath "com.github.robfletcher:compass-gradle-plugin:2.0.5"
    }
}

It seems that gradle-processes is on jcenter not maven-central, so I succeeded with

buildscript {
    repositories {
        mavenCentral()
        jcenter()
        maven { url "http://dl.bintray.com/robfletcher/gradle-plugins" }
    }
    dependencies {
        classpath "com.github.robfletcher:compass-gradle-plugin:2.0.5"
    }
}

The front page should probably be updated to reflect this.

Compile 2 SASS directories

Hi,

I have just found your plugin, and it works like a charm.

Can we have compile 2 different SASS directories ? for example, I have a components/ and src/main/webapp/css directories. After the compilation, the generated CSS files will be placed in the original folder.

Thanks

Manu

Deprecation warning on Ruby 1.9.3?

When I use V2.0.6 of this plugin, I get a deprecation warning during the build:

:compassCompile
9 gems installed
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.

What shall I do?

Missing *_path options

There's no way to change the deployed locations of things. Exposing images_path for configuration would fix this.

installing "breakpoint" gem (via installCompass) fails on vanilla Linux and Windows

Problem

Attempt to install "breakpoint" gem via installCompass task fails with error message "java not found" both on Linux and Windows.

Steps to reproduce problem

  1. Setup configuration/environment (see below).
  2. Create sample build.gradle (see below).
  3. Run "build installCompass".

Program output

On Linux:

ahi@ahi-home ~/Projects/try-gradle-compass $ gradle installCompass
:installCompass
Successfully installed compass-0.12.2
Building native extensions.  This could take a while...
1 gem installed
ERROR:  Error installing breakpoint:

    ERROR: Failed to build gem native extension.

        java -jar /home/ahi/.gradle/caches/modules-2/files-2.1/org.jruby/jruby-complete/1.7.3/2273e4c2a2abdd4b25a21bc513bfc05cfba31f3b/jruby-complete-1.7.3.jar mkrf_conf.rb
/bin/sh: 1: java: not found

Gem files will remain installed in /home/ahi/.gradle/.jruby/gems/sass-3.3.0.rc.3 for inspection.
Results logged to /home/ahi/.gradle/.jruby/gems/sass-3.3.0.rc.3/ext/gem_make.out
:installCompass FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':installCompass'.
> Process 'command '/usr/lib/jvm/java-7-oracle/bin/java'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 57.228 secs

very similar error message is observed on Windows.

Configuration/environment Linux:

  1. Freshly installed Linux Mint Petra 64-bit, 3.11.0-12-generic, all updates installed.
  2. java-7-oracle (JDK) update 51 installed from ppa:webupd8team/java
  3. JAVA_HOME is correctly set to an existing folder containing JDK
  4. JAVA_HOME does not point to symbolic link
  5. java -version works in bash without problems
  6. ruby is not installed (although it should not matter for jruby)
  7. gradle 1.10 installed via gvm-tool

Configuration/environment Windows:

  1. Freshly installed Windows-7 64-bit, all updates installed.
  2. java-7-oracle (JDK) update 51 installed from oracle site
  3. JAVA_HOME is correctly set to an existing folder containing JDK
  4. JAVA_HOME does not point to symbolic link
  5. java -version works in git-bash without problems
  6. ruby is not installed (although it should not matter for jruby)
  7. gradle 1.10 installed via gvm-tool

Sample build.gradle

apply plugin: 'compass'

buildscript {
  repositories {
    jcenter()
    maven { url 'http://dl.bintray.com/robfletcher/gradle-plugins' }
  }
  dependencies {
    classpath 'org.gradle.plugins:gradle-compass:1.0.9'
  }
}

apply plugin: 'maven'

repositories {
  jcenter()
}

compass {
  gemPath = new File(gradle.gradleUserHomeDir, ".jruby")
  gems = ["compass", "breakpoint"]
}

Could not load FFI Provider: (NotImplementedError) FFI not available: null

Folks,

I've been struggling for the past day or so to try and integrate this plugin with my Gradle build environment - with limited success. After initially failing to get it to work with my existing Gradle project, I decided to keep things simple and create a new/pristine Gradle project with only the following configuration in the build.gradle file:

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

buildscript {
    repositories {
        mavenLocal()
        maven { url "https://my.internal.repo.proxy.server/artifactory/libs-release" }
    }
    dependencies {
        classpath 'com.github.robfletcher:compass-gradle-plugin:2.0.5'
    }
}

repositories {
    mavenLocal()
    maven { url "https://my.internal.repo.proxy.server/artifactory/libs-release" }
}

We use an internal Artifactory repository server/proxy to retrieve external packages for us and I can see the various gradle-compass, jruby and rubygem packages download as expected.

Download https://my.internal.repo.proxy.server/artifactory/libs-release/com/github/robfletcher/compass-gradle-plugin/2.0.5/compass-gradle-plugin-2.0.5.jar
Download https://my.internal.repo.proxy.server/artifactory/libs-release/com/github/jengelman/gradle/plugins/gradle-processes/0.3.0/gradle-processes-0.3.0.jar
Download https://my.internal.repo.proxy.server/artifactory/libs-release/com/github/jruby-gradle/jruby-gradle-plugin/0.1.9/jruby-gradle-plugin-0.1.9.jar
Download https://my.internal.repo.proxy.server/artifactory/libs-release/org/jruby/jruby-complete/1.7.15/jruby-complete-1.7.15.pom
Download https://my.internal.repo.proxy.server/artifactory/libs-release/org/jruby/jruby-artifacts/1.7.15/jruby-artifacts-1.7.15.pom
Download https://my.internal.repo.proxy.server/artifactory/libs-release/org/jruby/jruby-parent/1.7.15/jruby-parent-1.7.15.pom
Download https://my.internal.repo.proxy.server/artifactory/libs-release/org/sonatype/oss/oss-parent/7/oss-parent-7.pom
Download https://my.internal.repo.proxy.server/artifactory/libs-release/org/bouncycastle/bcprov-jdk15on/1.50/bcprov-jdk15on-1.50.pom
Download https://my.internal.repo.proxy.server/artifactory/libs-release/org/jruby/jruby-core/1.7.15/jruby-core-1.7.15.pom
Download https://my.internal.repo.proxy.server/artifactory/libs-release/org/jruby/jruby-stdlib/1.7.15/jruby-stdlib-1.7.15.pom
Download https://my.internal.repo.proxy.server/artifactory/libs-release/org/ow2/asm/asm/4.0/asm-4.0.pom
Download https://my.internal.repo.proxy.server/artifactory/libs-release/org/ow2/asm/asm-parent/4.0/asm-parent-4.0.pom
Download https://my.internal.repo.proxy.server/artifactory/libs-release/org/ow2/ow2/1.3/ow2-1.3.pom
Download https://my.internal.repo.proxy.server/artifactory/libs-release/org/ow2/asm/asm-commons/4.0/asm-commons-4.0.pom
Download https://my.internal.repo.proxy.server/artifactory/libs-release/org/ow2/asm/asm-analysis/4.0/asm-analysis-4.0.pom
Download https://my.internal.repo.proxy.server/artifactory/libs-release/org/ow2/asm/asm-util/4.0/asm-util-4.0.pom
Download https://my.internal.repo.proxy.server/artifactory/libs-release/org/jruby/joni/joni/2.1.2/joni-2.1.2.pom
Download https://my.internal.repo.proxy.server/artifactory/libs-release/com/github/jnr/jnr-netdb/1.1.2/jnr-netdb-1.1.2.pom
Download https://my.internal.repo.proxy.server/artifactory/libs-release/com/github/jnr/jnr-enxio/0.4/jnr-enxio-0.4.pom
Download https://my.internal.repo.proxy.server/artifactory/libs-release/com/github/jnr/jnr-x86asm/1.0.2/jnr-x86asm-1.0.2.pom
Download https://my.internal.repo.proxy.server/artifactory/libs-release/com/github/jnr/jnr-unixsocket/0.3/jnr-unixsocket-0.3.pom
Download https://my.internal.repo.proxy.server/artifactory/libs-release/com/github/jnr/jnr-posix/3.0.6/jnr-posix-3.0.6.pom
Download https://my.internal.repo.proxy.server/artifactory/libs-release/org/jruby/extras/bytelist/1.0.11/bytelist-1.0.11.pom
Download https://my.internal.repo.proxy.server/artifactory/libs-release/com/github/jnr/jnr-constants/0.8.5/jnr-constants-0.8.5.pom
Download https://my.internal.repo.proxy.server/artifactory/libs-release/org/jruby/jcodings/jcodings/1.0.10/jcodings-1.0.10.pom
Download https://my.internal.repo.proxy.server/artifactory/libs-release/com/github/jnr/jnr-ffi/1.0.10/jnr-ffi-1.0.10.pom
Download https://my.internal.repo.proxy.server/artifactory/libs-release/com/github/jnr/jffi/1.2.7/jffi-1.2.7.pom
Download https://my.internal.repo.proxy.server/artifactory/libs-release/com/jcraft/jzlib/1.1.2/jzlib-1.1.2.pom
Download https://my.internal.repo.proxy.server/artifactory/libs-release/org/sonatype/oss/oss-parent/6/oss-parent-6.pom
Download https://my.internal.repo.proxy.server/artifactory/libs-release/com/headius/invokebinder/1.2/invokebinder-1.2.pom
Download https://my.internal.repo.proxy.server/artifactory/libs-release/com/martiansoftware/nailgun-server/0.9.1/nailgun-server-0.9.1.pom
Download https://my.internal.repo.proxy.server/artifactory/libs-release/com/martiansoftware/nailgun-all/0.9.1/nailgun-all-0.9.1.pom
Download https://my.internal.repo.proxy.server/artifactory/libs-release/org/jruby/yecht/1.0/yecht-1.0.pom
Download https://my.internal.repo.proxy.server/artifactory/libs-release/joda-time/joda-time/2.3/joda-time-2.3.pom
Download https://my.internal.repo.proxy.server/artifactory/libs-release/com/headius/options/1.2/options-1.2.pom
Download https://my.internal.repo.proxy.server/artifactory/libs-release/org/ow2/asm/asm-tree/4.0/asm-tree-4.0.pom
Download https://my.internal.repo.proxy.server/artifactory/libs-release/org/jruby/jruby-complete/1.7.15/jruby-complete-1.7.15.jar
Download https://my.internal.repo.proxy.server/artifactory/libs-release/org/bouncycastle/bcprov-jdk15on/1.50/bcprov-jdk15on-1.50.jar
Download https://my.internal.repo.proxy.server/artifactory/libs-release/org/jruby/jruby-core/1.7.15/jruby-core-1.7.15.jar
Download https://my.internal.repo.proxy.server/artifactory/libs-release/org/jruby/jruby-stdlib/1.7.15/jruby-stdlib-1.7.15.jar
Download https://my.internal.repo.proxy.server/artifactory/libs-release/org/ow2/asm/asm/4.0/asm-4.0.jar
Download https://my.internal.repo.proxy.server/artifactory/libs-release/org/ow2/asm/asm-commons/4.0/asm-commons-4.0.jar
Download https://my.internal.repo.proxy.server/artifactory/libs-release/org/ow2/asm/asm-analysis/4.0/asm-analysis-4.0.jar
Download https://my.internal.repo.proxy.server/artifactory/libs-release/org/ow2/asm/asm-util/4.0/asm-util-4.0.jar
Download https://my.internal.repo.proxy.server/artifactory/libs-release/org/jruby/joni/joni/2.1.2/joni-2.1.2.jar
Download https://my.internal.repo.proxy.server/artifactory/libs-release/com/github/jnr/jnr-netdb/1.1.2/jnr-netdb-1.1.2.jar
Download https://my.internal.repo.proxy.server/artifactory/libs-release/com/github/jnr/jnr-enxio/0.4/jnr-enxio-0.4.jar
Download https://my.internal.repo.proxy.server/artifactory/libs-release/com/github/jnr/jnr-x86asm/1.0.2/jnr-x86asm-1.0.2.jar
Download https://my.internal.repo.proxy.server/artifactory/libs-release/com/github/jnr/jnr-unixsocket/0.3/jnr-unixsocket-0.3.jar
Download https://my.internal.repo.proxy.server/artifactory/libs-release/com/github/jnr/jnr-posix/3.0.6/jnr-posix-3.0.6.jar
Download https://my.internal.repo.proxy.server/artifactory/libs-release/org/jruby/extras/bytelist/1.0.11/bytelist-1.0.11.jar
Download https://my.internal.repo.proxy.server/artifactory/libs-release/com/github/jnr/jnr-constants/0.8.5/jnr-constants-0.8.5.jar
Download https://my.internal.repo.proxy.server/artifactory/libs-release/org/jruby/jcodings/jcodings/1.0.10/jcodings-1.0.10.jar
Download https://my.internal.repo.proxy.server/artifactory/libs-release/com/github/jnr/jnr-ffi/1.0.10/jnr-ffi-1.0.10.jar
Download https://my.internal.repo.proxy.server/artifactory/libs-release/com/github/jnr/jffi/1.2.7/jffi-1.2.7.jar
Download https://my.internal.repo.proxy.server/artifactory/libs-release/com/github/jnr/jffi/1.2.7/jffi-1.2.7-native.jar
Download https://my.internal.repo.proxy.server/artifactory/libs-release/org/yaml/snakeyaml/1.13/snakeyaml-1.13.jar
Download https://my.internal.repo.proxy.server/artifactory/libs-release/com/jcraft/jzlib/1.1.2/jzlib-1.1.2.jar
Download https://my.internal.repo.proxy.server/artifactory/libs-release/com/headius/invokebinder/1.2/invokebinder-1.2.jar
Download https://my.internal.repo.proxy.server/artifactory/libs-release/com/martiansoftware/nailgun-server/0.9.1/nailgun-server-0.9.1.jar
Download https://my.internal.repo.proxy.server/artifactory/libs-release/org/jruby/yecht/1.0/yecht-1.0.jar
Download https://my.internal.repo.proxy.server/artifactory/libs-release/joda-time/joda-time/2.3/joda-time-2.3.jar
Download https://my.internal.repo.proxy.server/artifactory/libs-release/com/headius/options/1.2/options-1.2.jar
Download https://my.internal.repo.proxy.server/artifactory/libs-release/org/ow2/asm/asm-tree/4.0/asm-tree-4.0.jar
Download http://rubygems-proxy.torquebox.org/releases/rubygems/compass/1.0.3/compass-1.0.3.gem
Download http://rubygems-proxy.torquebox.org/releases/rubygems/sass/3.4.12/sass-3.4.12.gem
Download http://rubygems-proxy.torquebox.org/releases/rubygems/compass-core/1.0.3/compass-core-1.0.3.gem
Download http://rubygems-proxy.torquebox.org/releases/rubygems/compass-import-once/1.0.5/compass-import-once-1.0.5.gem
Download http://rubygems-proxy.torquebox.org/releases/rubygems/chunky_png/1.3.4/chunky_png-1.3.4.gem
Download http://rubygems-proxy.torquebox.org/releases/rubygems/rb-fsevent/0.9.4/rb-fsevent-0.9.4.gem
Download http://rubygems-proxy.torquebox.org/releases/rubygems/rb-inotify/0.9.5/rb-inotify-0.9.5.gem
Download http://rubygems-proxy.torquebox.org/releases/rubygems/multi_json/1.10.1/multi_json-1.10.1.gem
Download http://rubygems-proxy.torquebox.org/releases/rubygems/ffi/1.9.6/ffi-1.9.6.gem

When I then initiate a simple 'compassVersion' task (either in Eclipse STS or via Gradle at the CLI) I eventually get the following:

:compassVersionERROR:  Loading command: install (LoadError)
    Could not load FFI Provider: (NotImplementedError) FFI not available: null
 See http://jira.codehaus.org/browse/JRUBY-4583
ERROR:  While executing gem ... (NoMethodError)
    undefined method `invoke_with_build_args' for nil:NilClass
FAILED

I've had a look at the referenced JIRA ticket, although this appears to relate to JRuby 1.5.x and since I'm running on an x64 Windows based system I didn't think this issue would affect me. Just wondering if I'm missing something obvious. Some additional info about my environment:

OS: Windows 8.1 x64
Java: JDK 1.8.0_31-b13
Gradle: 2.3

Regards,

Shane

gzip results

Thanks for this excellent plugin. The one last step that would be useful is to make it easy for us to gzip the final compressed output. Because web servers like Apache optimise sending the gzipped version of a file if it is found on disk (if set up with MultiViews), rather than compressing on the fly, this is useful.

The task you'd need to add could be as simple as this: https://github.com/eriwen/gradle-js-plugin/blob/master/src/main/groovy/com/eriwen/gradle/js/tasks/GzipJsTask.groovy

Remove @charset "UTF-8";

Hi,

I use this plugin with JavaFX and everything is fine expected this one line:
@charset "UTF-8";
at the beginning of the File.

Since JavaFX 8 it breaks the application so I have to remove this line. Is there any way to remove this lines automatically at compassWatch is running?

FFI is broken on Windows 10 x64 (and possibly others). Easy fix.

I've got a really simple build.gradle.

plugins {
    id "com.github.robfletcher.compass" version "2.0.6"
}

repositories {
    mavenCentral()
}

compass {
    cssDir = file("build/css")
    sassDir = file("sass")
}

When I try gradlew compassCompile, here's what I get:

(a bunch of downloads)
Download http://rubygems-proxy.torquebox.org/releases/rubygems/ffi/1.9.10/ffi-1.9.10.gem
ERROR:  Loading command: install (LoadError)
        Could not load FFI Provider: (NotImplementedError) FFI not available: null
 See http://jira.codehaus.org/browse/JRUBY-4583
ERROR:  While executing gem ... (NoMethodError)
    undefined method `invoke_with_build_args' for nil:NilClass

By looking at #37, I was able to fix this by prefixing my buildscript with this snippet:

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath "com.github.jruby-gradle:jruby-gradle-plugin:0.1.17"
    }
}

It would be cool if the plugin worked out of the box. Also, jruby-gradle-plugin:0.1.17 is from June 2015. Since then they've made it to 1.2.0 in December 2015. Might be worth updating to the latest version.

Could not find FFI Provider

Running any kind of task created by this plugin crash on my machine:

ERROR: Loading command: install (LoadError)
               Could not load FFI Provider: (NotImplementedError) FFI not available: null
 See https://jira.codehaus.org/browse/JRUBY-4583

ERROR: While executing gem ... (NoMethodError=
      undefined method 'invoke_with_build_args' for nul:NilClass

My machine is Windows 8.1, x64. My Gradle version: 2.3.6. The gradle-compass plugin version used: 2.0.5.

Multiple executions - Illegal Null Value

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?

backwards paths for images aren't happy

Works fine if I use paths like '../images' in config.rb but it doesn't like it through the plugin. Seems to concat the images path onto the base directory

For some reason it's mangling the path and dropping the leading slash. The arguments that it's passing into compass are (emphasis mine):
compass compile --sass-dir /Users/cstephens/workspace/atg-backcountry-ca/modules/Store/build/css-src --css-dir /Users/cstephens/workspace/atg-backcountry-ca/modules/Store/build/css --images-dir Users/cstephens/workspace/atg-backcountry-ca/modules/Store/images --fonts-dir /Users/cstephens/workspace/atg-backcountry-ca/modules/Store/fonts

compassWatch failing to detect file changes.

I found that there is some problems in the compass watch command with jruby-complete.jar since 1.7.14.

My env is Win7 x64, jvm version "1.8.0_40".

First I met the problem that fail to detect changes for '.scss' files in this plugin's task compassWatch.

At the time of running the task, it compiles scss files to css files, but it do nothing on these scss files is changed.

So I check compass watch command with jruby-complete-1.7.19.jar like this

java -jar jruby-complete-1.7.19.jar build\tmp\jrubyExec-compass\bin\compass watch --css-dir=grails-app\assets\stylesheets\develop\css --sass-dir=grails-app\assets\stylesheets\scss

then it did not work properly, as same as compassWatch task did not.

So I check the versions of 'jruby-complete' [1.7.2,1.7.10,1.7.13,1.7.14,1.7.15,1.7.17,1.7.18,9.0.0.0.pre1].

The results for compass watch works properly is the following.

version it works properly
1.7.2 OK
1.7.10 OK
1.7.13 OK
1.7.14 NG
1.7.15 NG
1.7.17 NG
1.7.18 NG
9.0.0.0.pre1 NG

So I tried to use the version 'org.jruby:jruby-complete:1.7.13' but that did not work with runtime error.

:web:compassWatchLoadError on line ["1071"] of org/jruby/RubyKernel.java: no such file to load -- jruby-complete
Run with --trace to see the full backtrace

I think this issue is not for your plugin but for jruby or gradle-jruby plugin.

This is just a note for someone who will see the same problem.

scss import statements issue..

i am having issue with when my .scss file have @imports statements.

when you do gradle compileSass , it is not able to import them.

here are my config:
compass.config
compass {
cssDir = file('src/main/webapp/css')
sassDir = file('src/main/scss')
importPath = files('src/main/scss')
encoding = 'UTF-8'
debugInfo = true
noLineComments = true
outputStyle = "compressed"
trace = true
}

src/main/scss/checkout.scss
src/main/scss/assets/normlize.scss
src/main/scss/assets/foundation/ …..scss

in checkout.scss
calling as
@import "assets/normalize";
@import "assets/foundation/functions";

i don't able to see foundation/functions,scss import.

is there anything you can help with.

Provide sass in environment PATH ?

Hello,

I understand this might not be the primary objective of this Gradle plugin, but maybe it's a nice feature to have.

I see your plugin is already able to provide a working sass that uses jruby, itself automatically provided by the jruby-gradle-plugin.
However, that sass tool is not callable from the command line directly.

My goal is to integrate gradle/sass/grunt/grunt-contrib-sass properly.

The grunt-contrib-sass plugin is checking for the sass binary in the environment PATH.
I'm using the com.moowork.grunt Gradle plugin to call grunt.
And I'm able to configure the environment PATH from Gradle on the grunt_build task (GruntTask).

Is there someway I could ask for the sass tool to be installed locally (with a compassInstall task for example), and then retrieve the path of the executable, to be used in an external tool ?

Thank you!
Regards,

Olivier

Install fails to install sass

Hi - when I try to call the compass task using the following configuration:

apply plugin: "com.github.robfletcher.compass"
buildscript {
  repositories {
    jcenter()
    maven { url "http://dl.bintray.com/robfletcher/gradle-plugins" }
  }
  dependencies {
    classpath "com.github.robfletcher:compass-gradle-plugin:2.0.6"
  }
}

compass {
    sassDir = file('web/sohoxi/sass')
    cssDir = file('web/sohoxi/css')
    gemDir = file('etc/build/gems')
}

It downloads jruby and compass successfully, but does not do the same for sass. Am I doing something wrong?
Successfully installed compass-1.0.3
1 gem installed
Gem::LoadError: Could not find 'sass' (< 3.5, >= 3.3.13) among 10 total gem(s)
to_specs at /Users/tfavorite/.gradle/caches/modules-2/files-2.1/org.jruby/jruby-complete/1.7.15/4d9cb332bad3633c9c23a720542f456dc0c58a81/jruby-complete-1.7.15.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/dependency.rb:298
activate_dependencies at /Users/tfavorite/.gradle/caches/modules-2/files-2.1/org.jruby/jruby-complete/1.7.15/4d9cb332bad3633c9c23a720542f456dc0c58a81/jruby-complete-1.7.15.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/specification.rb:1271
each at org/jruby/RubyArray.java:1613
activate_dependencies at /Users/tfavorite/.gradle/caches/modules-2/files-2.1/org.jruby/jruby-complete/1.7.15/4d9cb332bad3633c9c23a720542f456dc0c58a81/jruby-complete-1.7.15.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/specification.rb:1260
activate at /Users/tfavorite/.gradle/caches/modules-2/files-2.1/org.jruby/jruby-complete/1.7.15/4d9cb332bad3633c9c23a720542f456dc0c58a81/jruby-complete-1.7.15.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/specification.rb:1242
gem at /Users/tfavorite/.gradle/caches/modules-2/files-2.1/org.jruby/jruby-complete/1.7.15/4d9cb332bad3633c9c23a720542f456dc0c58a81/jruby-complete-1.7.15.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/core_ext/kernel_gem.rb:48
(root) at /code/gtnexus/devl/modules/main/tcard/etc/build/gems/bin/compass:22
:modules:main:tcard:compassCompile FAILED

Also tried specifying the gems version as specified in the Readme, but that doesn't seem to be a valid attribute either.

No such property: gems for class: com.github.robfletcher.compass.CompassExtension_Decorated
Possible solutions: time, gemDir

JRuby setup needed? any docs or sample project available?

Hi all,

I'm new to Gradle, Ruby and this whole new web development stack (angular, sass/compass, etc), so I'd like to know if there is any detailed document where it shows how to setup and run this plugin to use it in a project from scratch?

It mentions that it uses JRuby, does that mean that I have to install JRuby on my machine first? or is it just a statement that uses JRuby and it's embedded internally in the plugin?

Will any JRuby setup clash with the locally Ruby installation I have?

Thanks

UP-TO-DATE check not working properly on Linux

The up-to-date check of this plugin is not working correctly (at all??) on Linux.

As already mentioned in issue #58 (however this is not related to the --force option) the plugin outputs up-to-date even if there are no generated files in the cssDir at all.

I have the following compass config:

compass {
  gemDir rootProject.file('.rubyGems')

  sassDir project.file('src/main/webapp/resources/css/sass')
  fontsDir project.file('src/main/webapp/resources/fonts')
  imagesDir project.file('src/main/webapp/resources/images')
  javascriptsDir project.file('src/main/webapp/rcat esources/js')

  cssDir project.file('src/main/webapp/resources/styles')

  httpPath "/Default"

  outputStyle 'compressed'
  relativeAssets true
  noLineComments true

  time true
  trace true
}

If I generate the css files once, remove the generated css file src/main/webapp/resources/styles/main.css and run gradlew compassCompile again it will output UP-TO-DATE:

...
12:08:49.510 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Transitioning model element 'tasks' from state SelfClosed to SelfClosed
12:08:49.510 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Transitioning model element 'tasks.compassCompile' from state Known to ProjectionsDefined
12:08:49.510 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Running model element 'tasks.compassCompile' rule action Project.<init>.tasks.compassCompile()
12:08:49.510 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Mutating tasks.compassCompile using Project.<init>.tasks.compassCompile()
12:08:49.511 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Transitioning model element 'tasks.compassCompile' to state ProjectionsDefined.
12:08:49.511 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Running model element 'tasks.compassCompile' rule action Project.<init>.tasks.compassCompile()
12:08:49.511 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Mutating tasks.compassCompile using Project.<init>.tasks.compassCompile()
12:08:49.511 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Transitioning model element 'tasks.compassCompile' to state Created.
12:08:49.511 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Transitioning model element 'tasks.compassCompile' to state RulesDefined.
12:08:49.511 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Transitioning model element 'tasks.compassCompile' to state DefaultsApplied.
12:08:49.511 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Transitioning model element 'tasks.compassCompile' to state Initialized.
12:08:49.511 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Running model element 'tasks.compassCompile' rule action copyToTaskContainer
12:08:49.511 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Mutating tasks.compassCompile using copyToTaskContainer
12:08:49.511 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Transitioning model element 'tasks.compassCompile' to state Mutated.
12:08:49.512 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Transitioning model element 'tasks.compassCompile' to state Finalized.
12:08:49.512 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Transitioning model element 'tasks.compassCompile' to state SelfClosed.
12:08:49.512 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Transitioning model element 'tasks.compassCompile' to state GraphClosed.
12:08:49.512 [INFO] [org.gradle.execution.TaskNameResolvingBuildConfigurationAction] Selected primary task 'compassCompile'
12:08:49.513 [DEBUG] [org.gradle.execution.taskgraph.DefaultTaskGraphExecuter] Timing: Creating the DAG took 0.001 secs
12:08:49.513 [INFO] [org.gradle.BuildLogger] All projects evaluated.
12:08:49.596 [INFO] [org.gradle.BuildLogger] Tasks to be executed: [task 'compassCompile']
...
12:08:49.633 [INFO] [org.gradle.api.internal.changedetection.state.InMemoryTaskArtifactCache] Creating In-memory cache of /root/project/.gradle/2.9/taskArtifacts/fileHashes.bin: MaxSize{429400}
12:08:49.633 [INFO] [org.gradle.api.internal.changedetection.state.InMemoryTaskArtifactCache] Creating In-memory cache of /root/project/.gradle/2.9/taskArtifacts/outputFileStates.bin: MaxSize{3200}
12:08:49.634 [INFO] [org.gradle.api.internal.changedetection.state.InMemoryTaskArtifactCache] Creating In-memory cache of /root/project/.gradle/2.9/taskArtifacts/fileSnapshots.bin: MaxSize{10700}
12:08:49.634 [INFO] [org.gradle.api.internal.changedetection.state.InMemoryTaskArtifactCache] Creating In-memory cache of /root/project/.gradle/2.9/taskArtifacts/taskArtifacts.bin: MaxSize{2100}
12:08:49.634 [INFO] [org.gradle.execution.taskgraph.ParallelTaskPlanExecutor] Using 1 parallel executor threads
12:08:49.635 [INFO] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] compassCompile (Thread[Daemon worker,5,main]) started.
12:08:49.635 [LIFECYCLE] [class org.gradle.TaskExecutionLogger] compassCompile
12:08:49.636 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Starting to execute task 'compassCompile'
12:08:49.636 [DEBUG] [org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter] Determining if task 'compassCompile' is up-to-date
12:08:49.636 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire exclusive lock on task history cache (/root/project/.gradle/2.9/taskArtifacts).
12:08:49.637 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired.
12:08:49.637 [INFO] [org.gradle.api.internal.changedetection.state.InMemoryTaskArtifactCache] Invalidating in-memory cache of /root/project/.gradle/2.9/taskArtifacts/outputFileStates.bin
12:08:49.637 [INFO] [org.gradle.api.internal.changedetection.state.InMemoryTaskArtifactCache] Invalidating in-memory cache of /root/project/.gradle/2.9/taskArtifacts/taskArtifacts.bin
12:08:49.637 [INFO] [org.gradle.api.internal.changedetection.state.InMemoryTaskArtifactCache] Invalidating in-memory cache of /root/project/.gradle/2.9/taskArtifacts/fileSnapshots.bin
12:08:49.637 [INFO] [org.gradle.api.internal.changedetection.state.InMemoryTaskArtifactCache] Invalidating in-memory cache of /root/project/.gradle/2.9/taskArtifacts/fileHashes.bin
12:08:49.637 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Opening cache taskArtifacts.bin (/root/project/.gradle/2.9/taskArtifacts/taskArtifacts.bin)
12:08:49.640 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Opening cache outputFileStates.bin (/root/project/.gradle/2.9/taskArtifacts/outputFileStates.bin)
12:08:49.789 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Opening cache fileHashes.bin (/root/project/.gradle/2.9/taskArtifacts/fileHashes.bin)
12:08:49.882 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Opening cache fileSnapshots.bin (/root/project/.gradle/2.9/taskArtifacts/fileSnapshots.bin)
12:08:49.890 [INFO] [org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter] Skipping task 'compassCompile' as it is up-to-date (took 0.254 secs).
12:08:49.891 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task 'compassCompile'
12:08:49.891 [LIFECYCLE] [class org.gradle.TaskExecutionLogger] compassCompile UP-TO-DATE
12:08:49.891 [WARN] [org.gradle.api.Project] compassCompile took 255ms
12:08:49.892 [INFO] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] compassCompile (Thread[Daemon worker,5,main]) completed. Took 0.257 secs.
12:08:49.899 [DEBUG] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] Task worker [Thread[Daemon worker,5,main]] finished, busy: 0.257 secs, idle: 0.007 secs
12:08:49.899 [DEBUG] [org.gradle.execution.taskgraph.DefaultTaskGraphExecuter] Timing: Executing the DAG took 0.303 secs
12:08:49.899 [LIFECYCLE] [org.gradle.BuildResultLogger]
12:08:49.901 [LIFECYCLE] [org.gradle.BuildResultLogger] BUILD SUCCESSFUL
12:08:49.901 [LIFECYCLE] [org.gradle.BuildResultLogger]
12:08:49.901 [LIFECYCLE] [org.gradle.BuildResultLogger] Total time: 32.515 secs

But there is no output file in cssDir:

root@ef44dad2248a:~/project# ls -la /root/project/src/main/webapp/resources/styles/
total 8
drwxr-xr-x 2 root root 4096 Jun  8 11:59 .
drwxr-xr-x 8 root root 4096 Jun  8 11:56 ..

I worked around this issue by disabling the up-to-date check:

compassCompile {
  outputs.upToDateWhen{ false }
}

How to specify gem source?

Seems like every time, gradle needs to download gem.

:compassCompile
Compass is charityware. If you love it, please donate on our behalf at http://umdf.org/compass Thanks!
Successfully installed compass-1.0.3
Successfully installed sass-3.4.19
Successfully installed compass-core-1.0.3
Successfully installed compass-import-once-1.0.5
Successfully installed chunky_png-1.3.4
Successfully installed rb-fsevent-0.9.6
Successfully installed rb-inotify-0.9.5
Successfully installed multi_json-1.11.2
Successfully installed ffi-1.9.10-java

Is there an option to set the gem source?

installCompass started failing overnight

Looks like the compass gem install is pulling ffi-1.9.6 instead of ffi-1.9.5_java as it did a few days ago. ffi-196 fails with:

15:05:13.726 [INFO] [org.gradle.process.internal.DefaultExecHandle] Starting process 'command '/usr/lib/jvm/java-7-openjdk-amd64/bin/java''. Working directory: /zoom Command: /usr/lib/jvm/java-7-openjdk-amd64/bin/java -client -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -Dfile.encoding=US-ASCII -cp /root/.gradle/caches/modules-2/files-2.1/org.jruby/jruby-complete/1.7.3/2273e4c2a2abdd4b25a21bc513bfc05cfba31f3b/jruby-complete-1.7.3.jar org.jruby.Main -X-C -S gem install -i /zoom/.jruby/gems --no-rdoc --no-ri compass
15:05:13.727 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Environment for process 'command '/usr/lib/jvm/java-7-openjdk-amd64/bin/java'': {OLDPWD=/zoom, TERM=xterm, GEM_PATH=/zoom/.jruby/gems, SHLVL=2, JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64/, INTERLOCK_DATA={"port":8080,"warm":false}, GRADLE_TARGETS=-i compileJava compileGroovy compileSass runMod, PATH=/zoom/.jruby/gems/bin, REPO_DIR=zoom, BRANCH=develop, HOSTNAME=zoom, GRADLE_OPTS=-Dzoom.environment=development, PWD=/zoom, HOME=/, GIT_URL=http://bamboo:[email protected]/labs/zoom-server.git}
15:05:13.728 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: STARTING
15:05:13.730 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Waiting until process started: command '/usr/lib/jvm/java-7-openjdk-amd64/bin/java'.
15:05:13.731 [INFO] [org.gradle.process.internal.ProcessParentingInitializer] An attempt to initialize for well behaving parent process finished.
15:05:13.735 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: STARTED
15:05:13.736 [DEBUG] [org.gradle.process.internal.ExecHandleRunner] waiting until streams are handled...
15:05:13.736 [INFO] [org.gradle.process.internal.DefaultExecHandle] Successfully started process 'command '/usr/lib/jvm/java-7-openjdk-amd64/bin/java''
15:05:35.056 [QUIET] [system.out] Building native extensions. This could take a while...
15:05:35.082 [ERROR] [system.err] ERROR: Error installing compass:
15:05:35.084 [ERROR] [system.err] ERROR: Failed to build gem native extension.
15:05:35.084 [ERROR] [system.err]
15:05:35.085 [ERROR] [system.err] java -jar /root/.gradle/caches/modules-2/files-2.1/org.jruby/jruby-complete/1.7.3/2273e4c2a2abdd4b25a21bc513bfc05cfba31f3b/jruby-complete-1.7.3.jar extconf.rb
15:05:35.085 [ERROR] [system.err] /bin/sh: 1: java: not found
15:05:35.086 [ERROR] [system.err]
15:05:35.086 [ERROR] [system.err]
15:05:35.087 [ERROR] [system.err] Gem files will remain installed in /zoom/.jruby/gems/gems/ffi-1.9.6 for inspection.
15:05:35.087 [ERROR] [system.err] Results logged to /zoom/.jruby/gems/gems/ffi-1.9.6/ext/ffi_c/gem_make.out
15:05:35.172 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: FAILED
15:05:35.173 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Process 'command '/usr/lib/jvm/java-7-openjdk-amd64/bin/java'' finished with exit value 1 (state: FAILED)
15:05:35.174 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ':installCompass'
15:05:35.175 [LIFECYCLE] [class org.gradle.TaskExecutionLogger] :installCompass FAILED

Update documentation

I've got Could not find org.jruby:jruby-complete:1.7.3.1 because didn't have

repositories {
    mavenCentral()
}

Pls add it to documentation

force option is not working properly

I have 4 files to compile
./sass/f1.scss
./sass/f2.scss
./sass/f3.scss
./sass/f4.scss

My compass option is like this
compass {
cssDir = file('./')
sassDir = file('./sass')
force true
}

After compiling all of them, if I run gradle again, it will say ":compassCompile UP-TO-DATE". But if I delete anyone of the generated file, say, ./f1.css, then run gradle again, it will compile all of them, which is expected for force mode.

So how can I make it run properly even in the case that I am not deleting any file?

Thank you.

setting gemJars does not work as expected

Assumption: setting gemJars in the compass configuration should use the provided jar(s) to obtain the Ruby gems rather that fetching over the network. This is important in some environments due to network
access & proxy topology issues.

In 1.0.10, setting gemJars has no apparent affect.

Looking into things, in DependenciesResolver.groovy, the check is made for "if (gemJars?.empty)..". I believe that "empty" is not a valid property here, but due to groovy's forgiving nature, the test is allowed (I suspect it's treating things like a map & looking for a key named empty).

I made a local fix by changing the test to "if (gemJars?.isEmpty())...", wherein things seemed to work as (I) expected.

I would upload the fix, but running the tests seems to generate a number of (seemingly unrelated) MIssingMethodExceptions (ImageGenerationSpec.groovy:24, :37, :50, :63 -- apparently about project.runTasks). I may be using an older groovy, gradle, or something. At any rate, without getting a successful build, I'm hesitant to push a change.

bintray POM is missing license information

The project's pom file on bintray is missing the license information. Making it difficult to use this project in a commercial environment.

As this project is under Apache 2.0 license, the following section should be added to the POM:

<licenses>
    <license>
        <name>The Apache Software License, Version 2.0</name>
        <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
</licenses>

How to specify cssDir and sassDir on a per-task basis?

I have the following configuration:

    compass {
        //sourcemap = true
        //debugInfo = true
        //force = false
        //environment = "development"
        //outputStyle = "expanded"
        importPath = rootProject.files("shared/src/main/sass")
    }

    task("compileResourceCompass", type: com.github.robfletcher.compass.CompassTask ) {
        command = "compile"
        sassDir = project.file("src/main/resources")
        cssDir = processResources.destinationDir
        //mustRunAfter processResources
    }

My custom values for sassDir and cssDir are not used.

Is there a way to create multiple instances of CompassTask with different directories?

Using gradle-compass with Android with different product flavors

We created an Android app with a webview which shows a local website from the assets folder.

The project has different Product Flavors to generate diffent apps with different styles and content but with the same codebas (native Java and HTML / JS).

For each flavor we want to define a diffent sass file with the colors and tweaks for that specific flavour.

Is it possible to use this within an Android project with different product flavors?

Edit:
This is what I have now...

android.applicationVariants.all { variant ->
    for (output in variant.outputs) {
        def procTask = output.processResources
        def sassTask = project.tasks.create("sassToCss${variant.name.capitalize()}") << {
            //file(variant.processResources.assetsDir)
            println "Assets folder: " + procTask.assetsDir

            def _ccsDir = file("$procTask.assetsDir\\css")
            def _sassDir = file("$procTask.assetsDir\\sass")
            def _imagesDir = file("$procTask.assetsDir\\images")
            def _javascriptsDir = file("$procTask.assetsDir\\js")
            def _fontsDir = file("$procTask.assetsDir\\fonts")


            project.compass{
                cssDir = _ccsDir
                sassDir = _sassDir
                imagesDir = _imagesDir
                javascriptsDir = _javascriptsDir
                fontsDir = _fontsDir
            }
            //compileSass
            project.compileSass.execute()
        }
        procTask.dependsOn(sassTask)
    }
}

It is looking ok now but now I got the error

A problem was found with the configuration of task ':app:compileSass'.
Directory 'C:\Workspaces\App folder\Android\app.jruby\gems' specified for property 'gemPath' does not exist.

Could not find org.jruby:jruby-complete:1.7.3

I made a project with just the following in the build.gradle. However i get an error saying "Could not find org.jruby:jruby-complete:1.7.3" I watched it download when the project was initially being built. Any ideas?

apply plugin: 'compass' buildscript { repositories { mavenLocal() mavenCentral() maven { url 'http://dl.bintray.com/robfletcher/gradle-plugins' } } dependencies { classpath 'org.jruby:jruby-complete:1.7.3' classpath 'org.gradle.plugins:gradle-compass:1.0.7' } } compass { cssDir = file('public/styles') sassDir = file('scss') } ![image](https://f.cloud.github.com/assets/2133184/900766/42ad2218-fb6e-11e2-965b-31bd352b82d7.png)

Depenendency on rubydevkit for windows

It looks like the compass gem, or one of its dependencies, needs some of the libs in the rubydevkit like "make". I asked the jruby guys about it and they said "C based extension support in JRuby is experimental.".

Is it possible to switch over to a jruby version of compass? The jruby guys also said "JRuby usually have a Java based extension for use under JRuby".

SASS conversion not working

I changed my code to:
apply plugin: "com.github.robfletcher.compass"

buildscript {
repositories {
maven { url "http://dl.bintray.com/robfletcher/gradle-plugins" }
jcenter()
}
dependencies {
classpath "com.github.robfletcher:compass-gradle-plugin:2.0"
classpath "com.github.jruby-gradle:jruby-gradle-plugin:0.1.2"
}
}

compass {
sassDir = file("WebContent/common/sass")
cssDir = file("WebContent/common/css")
}

Now I am getting BUILD SUCCESSFULL but there is no css file created in css folder :(

Hi
I m new to gradle and ruby world I am using following code in my gradle build but my sass files are not converting into css and I am constantly getting error of wrong version number :(
Can any one help me what I m missing and what are the steps I have to follow?

CODE [BEGIN]
apply plugin: "com.github.robfletcher.compass"

buildscript {
repositories {
mavenCentral()
maven { url "http://dl.bintray.com/robfletcher/gradle-plugins" }
}
dependencies {
classpath "org.gradle.plugins:gradle-compass:2.0.1"
classpath "com.github.jruby-gradle.base:0.1.3"
}
}

compass {
sassDir = file("WebContent/common/sass")
cssDir = file("WebContent/common/css")
}
CODE [END]

ERROR

NEGOTIATE authentication error: No valid credentials provided (Mechanism level: No valid credentials provided (Mechanism level: Failed to find any Kerberos tgt))
NEGOTIATE authentication error: No valid credentials provided (Mechanism level: No valid credentials provided (Mechanism level: Failed to find any Kerberos tgt))

FAILURE: Build failed with an exception.

BUILD FAILED

Total time: 3.949 secs

watchSass fails if run on its own

It produces the error

FAILURE: Build failed with an exception.

* What went wrong:
Failed to notify build listener.

Presumably because of the thread spawning & the fact the task never 'completes'.

Unsupported major.minor version 52.0

When I use version 2.0.5 on Android I get this error:

java.lang.UnsupportedClassVersionError: com/github/robfletcher/compass/CompassPlugin : Unsupported major.minor version 52.0

Failed to notify ProjectEvaluationListener.afterEvaluate(), but primary configuration failure takes precedence. java.lang.IllegalStateException: buildToolsVersion is not specified. at com.google.common.base.Preconditions.checkState(Preconditions.java:176) at com.android.build.gradle.BasePlugin.createAndroidTasks(BasePlugin.groovy:444) at com.android.build.gradle.BasePlugin$_createTasks_closure13_closure17.doCall(BasePlugin.groovy:415) at com.android.build.gradle.BasePlugin$_createTasks_closure13_closure17.doCall(BasePlugin.groovy) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324) at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:292) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1015) at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:39) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45) at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:54) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112) at com.android.build.gradle.internal.profile.SpanRecorders$2.call(SpanRecorders.groovy:52) at com.android.builder.profile.ThreadRecorder$1.record(ThreadRecorder.java:48) at sun.reflect.GeneratedMethodAccessor1300.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoCachedMethodSite.invoke(PojoMetaMethodSite.java:189) at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:124) at com.android.build.gradle.internal.profile.SpanRecorders.record(SpanRecorders.groovy:54) at com.android.build.gradle.BasePlugin$_createTasks_closure13.doCall(BasePlugin.groovy:414) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324) at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:292) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1015) at groovy.lang.Closure.call(Closure.java:423) at org.gradle.listener.ClosureBackedMethodInvocationDispatch.dispatch(ClosureBackedMethodInvocationDispatch.java:40) at org.gradle.listener.ClosureBackedMethodInvocationDispatch.dispatch(ClosureBackedMethodInvocationDispatch.java:25) at org.gradle.internal.event.BroadcastDispatch.dispatch(BroadcastDispatch.java:87) at org.gradle.internal.event.BroadcastDispatch.dispatch(BroadcastDispatch.java:31) at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93) at com.sun.proxy.$Proxy10.afterEvaluate(Unknown Source) at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:67) at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:61) at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:487) at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:85) at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:47) at org.gradle.execution.TaskSelector.getSelection(TaskSelector.java:84) at org.gradle.execution.TaskSelector.getSelection(TaskSelector.java:75) at org.gradle.execution.commandline.CommandLineTaskParser.parseTasks(CommandLineTaskParser.java:42) at org.gradle.execution.TaskNameResolvingBuildConfigurationAction.configure(TaskNameResolvingBuildConfigurationAction.java:44) at org.gradle.execution.DefaultBuildExecuter.configure(DefaultBuildExecuter.java:42) at org.gradle.execution.DefaultBuildExecuter.access$100(DefaultBuildExecuter.java:23) at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:48) at org.gradle.execution.ExcludedTaskFilteringBuildConfigurationAction.configure(ExcludedTaskFilteringBuildConfigurationAction.java:47) at org.gradle.execution.DefaultBuildExecuter.configure(DefaultBuildExecuter.java:42) at org.gradle.execution.DefaultBuildExecuter.access$100(DefaultBuildExecuter.java:23) at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:48) at org.gradle.execution.DefaultTasksBuildExecutionAction.configure(DefaultTasksBuildExecutionAction.java:44) at org.gradle.execution.DefaultBuildExecuter.configure(DefaultBuildExecuter.java:42) at org.gradle.execution.DefaultBuildExecuter.select(DefaultBuildExecuter.java:35) at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:142) at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:106) at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:86) at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:90) at org.gradle.tooling.internal.provider.runner.BuildModelActionRunner.run(BuildModelActionRunner.java:54) at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35) at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:41) at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:28) at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:49) at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74) at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72) at org.gradle.util.Swapper.swap(Swapper.java:38) at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.health.DaemonHealthTracker.execute(DaemonHealthTracker.java:47) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:66) at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:71) at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.health.HintGCAfterBuild.execute(HintGCAfterBuild.java:41) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50) at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:246) at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54) at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:744)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.