Does anyone know how to use JRuby and Compass modules to compile SASS (*.scss) files within build.xml?
I'm able to use the Sass::Exec module within sass standalone installation to compile from *.scss to *.css in the following manner:
<!-- Compile SCSS files copied to target folder -->
<property name="stylesheetFolder" location="myproject/stylesheet"/>
<property name="inputFiles" value="${stylesheetFolder}/[^_]*.scss" />
<echo message="Compiling SCSS files from ${stylesheetFolder}..." />
<script language="ruby" classpath="${env.EP_LIB}/jruby/complete/${jruby-complete.build.jar}">
<![CDATA[
require $project.getProperty('env.EP_LIB') + '/sass/sass-3.2.9/lib/sass'
require 'sass/exec'
files = Dir.glob($project.getProperty('inputFiles'))
files.each do |file|
opts = Sass::Exec::Sass.new(["--style", "compressed", "--load-path", File.dirname(file), file, File.join(File.dirname(file), File.basename(file, ".*") + ".css")])
opts.parse
end
]]>
</script>
<echo message="Done compiling SCSS source files." />
However, that doesn't give me the power of the Compass framework. I downloaded compass gem as a standalone and I'd like to use one of the Compass Ruby modules to replace the above code in Ant build.xml with something like:
<script language="ruby" classpath="${env.EP_LIB}/jruby/complete/${jruby-complete.build.jar}">
<![CDATA[
require $project.getProperty('env.EP_LIB') + '/compass/compass-0.12.2/lib/compass'
require 'compass/exec'
files = Dir.glob($project.getProperty('inputFiles'))
files.each do |file|
opts = Compass::Exec::Compass.new(["--style", "compressed", "--load-path", File.dirname(file), file, File.join(File.dirname(file), File.basename(file, ".*") + ".css")])
opts.parse
end
]]>
</script>
Has anyone done this successfully?
compass
command instead of running theCompass
library? – Shepmaster