如何在 ANT 中存储 XML 块?
我对 ANT 非常陌生,并且已经开始在 Flash Builder 项目中使用它。
当我运行编译器时,我需要传递一些库路径。整个事情看起来像这样:
<mxmlc
file="${SOURCE_DIR}/com/${PACKAGE_NAME}/Main.as"
output="${RELEASE_DIR}/assets/swf/${IDENTIFIER}/main.swf"
locale="${LOCALE}"
static-rsls="false"
accessible="true"
>
<compiler.debug>false</compiler.debug>
<load-config filename="${FLEX_HOME}/frameworks/flex-config.xml"/>
<source-path path-element="${SOURCE_DIR}"/>
<external-library-path file="${FLEX_HOME}/frameworks/libs/player/10.0/playerglobal.swc" append="true"/>
<library-path file="${FLEX_HOME}/frameworks/libs/flash-integration.swc" append="true"/>
<library-path file="${FLEX_HOME}/frameworks/libs/flex.swc" append="true"/>
<library-path file="${FLEX_HOME}/frameworks/libs/utilities.swc" append="true"/>
<library-path dir="${basedir}/libs" includes="*" append="true"/>
</mxmlc>
基本上,output=部分之后的所有内容都可以以某种方式存储并重用于所有其他编译。有没有什么方法可以在 ANT 中存储一大块 xml,然后通过变量引用或其他东西来调用它?
谢谢你!
I'm very new to ANT and have started using it in a Flash Builder project.
When I run the compiler I need to pass in some library paths. The whole thing looks like this:
<mxmlc
file="${SOURCE_DIR}/com/${PACKAGE_NAME}/Main.as"
output="${RELEASE_DIR}/assets/swf/${IDENTIFIER}/main.swf"
locale="${LOCALE}"
static-rsls="false"
accessible="true"
>
<compiler.debug>false</compiler.debug>
<load-config filename="${FLEX_HOME}/frameworks/flex-config.xml"/>
<source-path path-element="${SOURCE_DIR}"/>
<external-library-path file="${FLEX_HOME}/frameworks/libs/player/10.0/playerglobal.swc" append="true"/>
<library-path file="${FLEX_HOME}/frameworks/libs/flash-integration.swc" append="true"/>
<library-path file="${FLEX_HOME}/frameworks/libs/flex.swc" append="true"/>
<library-path file="${FLEX_HOME}/frameworks/libs/utilities.swc" append="true"/>
<library-path dir="${basedir}/libs" includes="*" append="true"/>
</mxmlc>
Basically everything after the output= part could be stored in some fashion and reused for all the other compilations. Is there some way to store a big block of xml in ANT and just call it through a variable reference or something..?
Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
可以使用 macrodef 来解决这个问题。只需定义一个新宏作为上述调用,但将
file
和output
作为参数。You can use macrodef to solve this problem. Simply define a new macro as the above invocation, but taking
file
andoutput
as arguments.