简体   繁体   中英

Compiling closure stylesheets in java (like SoyFileSet)

https://developers.google.com/closure/templates/docs/commands explains how to compile Google stylesheets using command line. I was expecting something like SoyFileSet which I can use to compile Google templates. Is there a class similar class like that for compiling stylesheets?

There is a java jar you can run from the command line called closure-stylesheets.jar. You can download it here : https://code.google.com/p/closure-stylesheets/downloads/list

We run it through an Ant task like this:

<target name="closure-stylesheets">
        <java jar="closure-stylesheets/closure-stylesheets.jar" fork="true" failonerror="true">
            <arg line="--output-file ../styles/closure.css"/>
            <arg value="closure-stylesheets/closure-main-def.gss"/>
            <arg value="closure-stylesheets/closure.gss"/>
            <arg value="closure-stylesheets/tree.css"/>
        </java>
</target>

If you are using Soy templates and want to use closure's CSS renaming capabilities, look here (I'm not familiar with using this) : https://code.google.com/p/closure-stylesheets/#Renaming

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM