1

I am successfully able to compile my SASS into CSS by using the following script in my build.xml file

<apply executable="sass.bat" dest="${css.dir}" verbose="true" force="true" failonerror="true">
    <arg value="--unix-newline" />
    <srcfile />
    <targetfile />
    <fileset dir="${sass.dir}" includes="**/*.scss,**/*.sass" excludes="**/_*" />
    <firstmatchmapper>
      <globmapper from="*.sass" to="*.css" />
      <globmapper from="*.scss" to="*.css" />
    </firstmatchmapper>
  </apply>
  <echo message="Done compiling scss files!" />
</target>

How can I pass SASS options as arguments? For instance I would like to compile the SASS to a --style:compressed state

2 Answers 2

2

You are already passing arguments to sass.bat. See the line

<arg value="--unix-newlines" />

You can add as many arg element as you need.

See http://ant.apache.org/manual/using.html#arg

Sign up to request clarification or add additional context in comments.

2 Comments

Is this an argument for <apply> rather than the SASS compile because if you look at the SASS documentation it says that the option for unix new line is actually "--unix-newlines". If I use this instead of "--unix-newline" the compile fails
arg is the element of apply which is passing the value to the arguments of SAAS.
1
<arg value="--unix-newlines" />

will work. So will other command-line arguments to the compiler as long as you include them as separate "arg"s

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.