Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possibility to configure compass using config.rb #64

Open
ghost opened this issue May 24, 2016 · 3 comments
Open

Possibility to configure compass using config.rb #64

ghost opened this issue May 24, 2016 · 3 comments

Comments

@ghost
Copy link

ghost commented May 24, 2016

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?

@ghost ghost changed the title Possibility to configure compass using configure.rb Possibility to configure compass using config.rb May 24, 2016
@beradrian
Copy link

Actually, you cannot specify all the options. In config.rb you can also add custom code like an importer. So this must be fixed.

@ghost
Copy link
Author

ghost commented Jul 4, 2016

My request was actually the other way around. I want to use the configuration in an existing config.rb file and make gradle-compass use this file instead of specifying the options in the gradle file.

That is, it would be great if something like this would be possible:

compass {
  configFile project.file('src/main/webapp/config.rb')
}

And config.rb specifies the acutal configruation that is to be used relative to it's location.

@beradrian
Copy link

This is what I need to. I was making the point that not everything that you put in the config.rb file can also be specified in the gradle file too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant