gpt4 book ai didi

ant - mxmlc 和框架链接 - 如何将链接指定为 rsl

转载 作者:行者123 更新时间:2023-12-01 22:50:10 25 4
gpt4 key购买 nike

我正在尝试使用 ant 构建我的 Flex 4 项目。在 Flash Builder 4 中,在项目属性中,可以将“框架链接”设置为“合并到代码”、“运行时共享库​​ (RSL)”或“使用 SDK 默认值(运行时共享库​​)”之一。如何在 build.xml 中设置与 mxmlc 选项等效的选项?

我当前的 build.xml 如下所示:

<target name="myapp">
<mxmlc
file="${PROJECT_ROOT}/myapp.mxml"
output="${DEPLOY_DIR}/myapp.swf"
actionscript-file-encoding="UTF-8"
keep-generated-actionscript="false"
warnings="false" optimize="true" incremental="false" >

<load-config filename="${FLEX_HOME}/frameworks/flex-config.xml"/>

<source-path path-element="${FLEX_FRAMEWORKS}"/>

<compiler.debug>true</compiler.debug>

<runtime-shared-library-path path-element="${FLEX_FRAMEWORKS}/libs/framework.swc">
<url rsl-url="framework_4.0.0.14159.swz"/>
<url rsl-url="framework_4.0.0.14159.swf"/>
</runtime-shared-library-path>

<compiler.source-path path-element="src"/>

<!-- List of external libraries -->
<compiler.source-path path-element="${MY_LIB}/src" />

<!-- List of SWC files or directories that contain SWC files. -->
<compiler.library-path dir="libs" append="true">
<include name="*.swc" />
</compiler.library-path>

<copy todir="${DEPLOY_DIR}" file="${FLEX_FRAMEWORKS}/rsls/framework_4.0.0.14159.swz"/>
<copy todir="${DEPLOY_DIR}" file="${FLEX_FRAMEWORKS}/rsls/framework_4.0.0.14159.swf"/>

</mxmlc>
</target>

我认为设置运行时共享库​​路径指令并将框架 swf、swz 文件复制到我的目标文件夹中将使事情正常工作,但情况似乎并非如此。

我评估其是否有效的方式如下:我使用自定义预加载器,为了使其工作,我需要将框架链接为 RSL。通过“合并到代码中”,我的预加载器卡在某个点并且无法进展到我的应用程序 swf。这与我使用上面的 build.xml 时看到的行为相同,这让我认为 SWF 是通过合并到代码中的框架链接(而不是 RSL 链接)构建的。

与此相关的一个问题是如何确定我的 swf 是否正在使用 RSL。我想我可以看看编译输出的大小。但似乎应该有一种方法可以在我不知情的情况下判断我是否正在使用外部框架文件,或者它是否以某种方式捆绑到 SWF 中。

最佳答案

这有点棘手,因为这方面的文档有点稀缺。您可能需要在命令行或配置文件中设置以下选项。

static-link-runtime-shared-libraries=false

Adobe 的文档对该选项的作用提供了以下略显神秘的描述。

Determines whether to compile against libraries statically or use RSLs. Set this option to true to ignore the RSLs specified by the runtime-shared-library-path option. Set this option to false to use the RSLs. The default value is true.

This option is useful so that you can quickly switch between a statically and dynamically linked application without having to change the runtime-shared-library-path option, which can be verbose, or edit the configuration files.

这是文档的链接。 "About the application compiler options"

请注意,文档中的默认值为 true。但是,如果您正在加载 flex-config.xml 文件(默认或自定义),您还应该检查该文件中是否存在此设置以及它是什么。根据我的经验,frameworks/flex-config.xml 的默认值实际上是 false。然而,在上面的示例中,这似乎可以以其他方式设置。

<小时/>

(我们使用与 ANT 不同的构建系统,所以我不太熟悉您需要的 build.xml 语法。)

关于ant - mxmlc 和框架链接 - 如何将链接指定为 rsl,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4069679/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com