Closed argv-minus-one closed 11 years ago
So the plugin uses SASS via a jRuby script. All of the options available here http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#sass_options can be used in the sassOptions section of the plugin config.
For example here is the ruby script that is generated and run by the sass plugin via jruby:
require 'rubygems'
require 'sass/plugin'
Sass::Plugin.options.merge!(
:cache_location => '/project/target/sass_cache',
:style => :expanded,
:cache => true,
:unix_newlines => true,
:always_update => true
)
Sass::Plugin.add_template_location('/project/src/main/webapp/media/skins/muniversality/common/jquerymobile/scss', '/project/target/uPortal/media/skins/muniversality/common/jquerymobile')
Sass::Plugin.add_template_location('/project/src/main/webapp/media/skins/muniversality/common/scss', '/project/target/uPortal/media/skins/muniversality/common')
Sass::Plugin.add_template_location('/project/src/main/webapp/media/skins/muniversality/iphone/scss', '/project/target/uPortal/media/skins/muniversality/iphone')
Sass::Plugin.add_template_location('/project/src/main/webapp/media/skins/universality/coal/scss', '/project/target/uPortal/media/skins/universality/coal')
Sass::Plugin.add_template_location('/project/src/main/webapp/media/skins/universality/common/scss', '/project/target/uPortal/media/skins/universality/common')
Sass::Plugin.add_template_location('/project/src/main/webapp/media/skins/universality/hc/scss', '/project/target/uPortal/media/skins/universality/hc')
Sass::Plugin.add_template_location('/project/src/main/webapp/media/skins/universality/ivy/scss', '/project/target/uPortal/media/skins/universality/ivy')
Sass::Plugin.add_template_location('/project/src/main/webapp/media/skins/universality/uportal3/scss', '/project/target/uPortal/media/skins/universality/uportal3')
Sass::Plugin.update_stylesheets
If you can give me an example of a script like this that triggers the compass features I'll be happy to include it in the plugin.
Note that digging through "sass-3.2.3/lib/sass/exec.rb" shows the following block being executed if --compass is specified. I'm guessing I'd need to do something similar in the SASS generated script. Sadly I don't have any test project that uses compass to really try it out on so if you'd really like this feature I'll need some help testing things.
def load_compass
begin
require 'compass'
rescue LoadError
require 'rubygems'
begin
require 'compass'
rescue LoadError
puts "ERROR: Cannot load compass."
exit 1
end
end
Compass.add_project_configuration
Compass.configuration.project_path ||= Dir.pwd
@options[:for_engine][:load_paths] += Compass.configuration.sass_load_paths
end
I'm not providing a compass test case, but I'd really love to see a working example as well =)
I'll have a crack at providing an example webapp
I've uploaded a small webapp with some Compass use at https://github.com/mprins/maven-compass-example
Hi mprins,
I tried to compile your project, but i am getting the following error:
[INFO] Queing SASS Template for compile: src/main/scss => target/compass-example/css [INFO] Compiling SASS Templates [ERROR] Compilation of template /Users/aaanim/Documents/workspace/javascript/maven-compass-example/src/main/scss/compiled.scss failed: File to import not found or unreadable: compass/css3.
Thanks, Waldo
I think that's why he created this project : to prove that it doesn't work with compass =) Now that we have a simple example to work with, maybe someone can find a solution =P
Ohh, my bad. I thought he said it was working with compass.
Thanks for the clarification.
note that this pull jmarsault/scss-editor#12 could give some inspiration on implementing Compass support, specifically https://github.com/sir-gawain/scss-editor/commit/fcb2ab8f8b1ca54e29eda5ad1f097065137a5d02
I've started on a fork supporting this https://github.com/mprins/sass-maven-plugin/commit/f2838beec72a5a036ac719f30ff0dc80f8e1e04e
Awesome, let me know if you get it working.
got it working, see #23
The Sass command-line tool has the option
--compass
@argv-minus-one I've searched, but failed to find any documentation on this. Could you point me to it?
The Sass command-line tool has the option
--compass
, which brings in all the Compass stuff (imports, language extensions, etc). The sass-maven-plugin does not appear to be able to do this.