2013-05-01 121 views
1

CSS我能成功在我的build.xml文件使用下面的脚本编译我SASS为CSS编译SASS使用ANT构建任务

<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> 

如何传递SASS选项参数?比如我想编译SASS到--style:压缩状态

回答

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

会工作。因此,将其他的命令行参数编译器,只要你把它们作为单独的“ARG” S

+0

谢谢JamieJag! :-D – user1812741 2013-05-01 15:47:51

2

您已经传递参数给sass.bat。见线

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

您可以根据需要添加尽可能多的arg元素。

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

+0

这是对而非SASS编译,因为一个说法,如果你看一下SASS文件,它说的是对的选择unix新行实际上是“--unix-newlines”。如果我用这个来代替“--unix换行”编译失败 – user1812741 2013-05-01 15:01:17

+0

'arg'是'apply'这是值传递给SAAS的参数的元素。 – 2013-05-01 19:56:01