本文介绍了编译使用compc命令一个深港西部通道,但不包括第三方库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我建立了一个code库。它依赖于2其他(第三方)库。此刻,当我编译库到SWC,无论是第三方库都包括在内。我要寻找一种方式来对第三方库编译我的code库,但不包括他们在编译的SWC。

I have a code library that I have built. It relies on 2 other (third party) libraries. At the moment, when I compile the library into a swc, both third party libraries are included. I am looking for a way to compile my code library against the third party libraries, but without including them in the compiled swc.

这显然意味着,用我的图书馆任何人都需要两个库一样好,但我会preFER这种方式。我没有使用Flex / Flashbuilder我知道,您可以选择的类在SWC包含。

This would obviously mean that anyone using my library would need both libraries as well, but I would prefer it this way. I am not using Flex/Flashbuilder which I know allows you to choose the classes to include in a swc.

感谢

推荐答案

-external库径+ = my.swc是答案,虽然没有必要使用-runtime-共享库。使用此参数可以让你指定code将在汇编中使用,但不能放入深港西部通道。显然,当深港西部通道使用该排除clode仍然是必要的。

-external-library-path+=my.swc is the answer, though there is no need for using -runtime-shared-libraries. Using this argument allows you to specify code which will be used in compilation but not placed into the swc. Obviously this excluded clode will still be needed when the swc is used.

特别值得注意的是,不像其他的参数,-external库路径使用+ = =不。仅仅通过使用=您将打破在基准的球员水平低类和任何其他外部库补充说。

Of particular note is that unlike other arguments, -external-library-path uses += not =. By using just = you will break the refernce to the players low level classes and any other external libraries added.

如果您使用的是FlexTasks瓦特/蚂蚁,你的目标可能是这样的:

If you are using FlexTasks w/ Ant, your target might look like this:

<target name="compileToSWC">
    <compc 
        output="${bin}/${SWCName}">
            <source-path path-element="${src}"/>
            <!-- Source to include in SWC -->
            <include-sources dir="${src}" includes="*"/>
            <!-- Libs to exclude from the swc - Note append="true" which is equivillant to using +=-->
            <external-library-path file="${thirdparty.libs}/SomeLib.swc" append="true"/>
            <external-library-path file="${thirdparty.libs}/SomeOtherLib.swc" append="true"/>
    </compc>
</target>

您也可以指向外部库的文件夹路径在这种情况下,包括里面的所有SWCS。请注意,如果您按照Adobe的FlexTasks准则,并将flexTasks.jar文件到您的libs文件夹并将其定位为使用外部库路径的文件夹中,flexTasks.jar本身排除在外,导致构建失败。为了解决此问题,或者放置flexTasks.jar在一个单独的文件夹或直接针对你的SWCS如在上面的例子

You can also point external-library-path to a folder in which case it will include all swcs inside. Note that if you follow Adobe's FlexTasks guidelines and place the flexTasks.jar file into your libs folder and target it as a folder using external-library-path, the flexTasks.jar is itself excluded, causing the build to fail. To solve this, either place the flexTasks.jar in a separate folder or target your swcs directly as in the above example

这篇关于编译使用compc命令一个深港西部通道,但不包括第三方库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-15 01:37