在 ANT 文件中折射类似的代码片段 [英] refractor similar code snippet in ANT files

查看:29
本文介绍了在 ANT 文件中折射类似的代码片段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 ANT 文件中有以下代码片段,可将我的项目编译为 swf 文件:

i have the following code snippet in my ANT File which compiles my project to a swf file :

<target name="my target">
<mxmlc  file="${APPS_DIR}//@{appName}.mxml" 
    output="${DEPLOY_APPS_DIR}/@{appName}.swf" 
    actionscript-file-encoding="UTF-8" 
    keep-generated-actionscript="false" 
    optimize="true" 
    debug="${DEBUG_TF}" 
    locale="en_US"
    static-rsls="false"
    static-link-runtime-shared-libraries="false"
    verify-digests="false"> 
<!-- BEGIN code A -->
...
...
...
<!-- END code A -->
</mxmlc>
</target>

由于我有很多以类似方式使用代码 A 的文件,我想创建一个包含此代码的可分离文件.

As i have much files that use the code A in similar way, I want to create a separable file which contains this code.

但是,我如何从主 ant 文件中调用它?

But, how can I call it from the main ant file ?

推荐答案

我找到了解决方案.我自己同时回答和提问.我在此处找到了它.

I found the solution. Answered and asked by myself at the same time. I was found it here.

您可以使用 XML 的方式来包含外部文件,并让解析器为 Ant 完成这项工作:

You can use XML's way of including external files and let the parser do the job for Ant:

<?xml version="1.0"?>
<!DOCTYPE project [
       <!ENTITY common SYSTEM "common.xml">
]>
<project name="test" default="test" basedir=".">
  <target name="setup">
    ...
  </target>
  &common;
  ...   
</project>

这篇关于在 ANT 文件中折射类似的代码片段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆