使用 COMPC 编译 SWC,不包括第 3 方库
我有一个我构建的代码库。 它依赖于另外 2 个(第三方)库。 目前,当我将库编译成swc时,两个第三方库都包含在内。 我正在寻找一种方法来针对第三方库编译我的代码库,但不将它们包含在已编译的 SWC 中。
这显然意味着任何使用我的库的人都需要这两个库,但我更喜欢这种方式。 我没有使用 Flex/Flashbuilder,我知道它允许您选择要包含在 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.
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.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
-external-library-path+=my.swc 是答案,尽管不需要使用 -runtime-shared-libraries。 使用此参数允许您指定将在编译中使用但不放入 SWC 中的代码。 显然,当使用 SWC 时,仍然需要这个排除的 clode。
特别值得注意的是,与其他参数不同,-external-library-path 使用 += 而不是 =。 通过仅使用=,您将中断对玩家低级类和添加的任何其他外部库的引用。
如果您使用带有 Ant 的 FlexTasks,您的目标可能如下所示:
您还可以将 external-library-path 指向一个文件夹,在这种情况下,它将包含其中的所有 swc。 请注意,如果您遵循 Adobe 的 FlexTasks 准则并将 flexTasks.jar 文件放入 libs 文件夹中,并使用 external-library-path 将其定位为文件夹,则 flexTasks.jar 本身将被排除,从而导致构建失败。 要解决此问题,请将 flexTasks.jar 放在单独的文件夹中,或者直接针对您的 SWC,如上面的示例所示
-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.
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.
If you are using FlexTasks w/ Ant, your target might look like this:
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
我不认为你可以只要求其他人具有依赖关系。 它可以使用第三方库作为运行时共享库,您需要 url 上提供的第三方库,并在编译时使用以下内容
-runtime-shared-libraries=http://www.yourhost.com/my .swf-外部库路径+=my.swc
。请参阅 Adobe 文档,了解有关 RSL 的完整详细信息< /a>
I don't think you can just require that someone else has the dependencies. It could use the third party libraries as Runtime Shared Libraries, you will need the third party libs available on the url and use the following when compiling
-runtime-shared-libraries=http://www.yourhost.com/my.swf -external-library-path+=my.swc
.See the Adobe docs for full details about RSLs