flex ant编译css

时间:2015-02-23 21:44:42

标签: css flex ant

我有一个我需要用ant构建的flex项目。到目前为止我有这个

<mxmlc file="${flex.src.dir}/MyFlexApp.mxml"
           output="${flex.build.dir}/MyFlexApp.swf"
           services="${conf.dir}/flex/services-config.xml" 
           locale="es_ES,en_US"
           context-root="/${ant.project.name}"
           allow-source-path-overlap="true"
           keep-generated-actionscript="false">

        <load-config filename="${FLEX_HOME}/frameworks/flex-config.xml"/>
        <source-path path-element="${FLEX_HOME}/frameworks"/>
        <source-path path-element="${flex.src.dir}/locales/{locale}" />

        <compiler.include-libraries dir="${flex.lib.dir}" append="true">
            <include name="*.swc" />
        </compiler.include-libraries>
    </mxmlc>

在这个项目中,我有两个.css(Dark.css和Light.css),它们是自定义主题方法的样式表,并且为了完成该功能,我添加了编译器选项,如下所示

<buildCSSFiles>
<buildCSSFileEntry destPath="bin-debug" sourcePath="flex_src/assets/themes/Dark/Theme.css"/>
<buildCSSFileEntry destPath="bin-debug" sourcePath="flex_src/assets/themes/Light/Theme.css"/>

所以,我需要的是指示build.xml文件也添加这个编译选项。请问有人可以帮帮我吗?任何建议都会非常感激。

1 个答案:

答案 0 :(得分:1)

与编写swf只是在css文件中指向mxmlc相同。

<mxmlc file="path/to/css/file/your-css.css"
output="bin-debug/your-css.swf" >
<load-config filename="${FLEX_HOME}/frameworks/flex-config.xml"/>
</mxmlc>