当源代码在项目中时如何链接到 SWC?

发布于 2024-09-06 18:30:39 字数 368 浏览 1 评论 0原文

我想将视图类从 flash 编译为 SWC,并使用 mxmlc 编译应用程序的其余部分(避免通过 IDE 重新编译)。但是,由于视图类(源)位于项目类路径中,因此 mxmlc 使它们优先于已编译的 SWC。

现在我在想也许视图类必须分离到一个单独的项目中,但我对此犹豫不决,因为我不认为这些类真正构成一个独立的项目,并且将它们分离出来不会有任何其他目的解决链接优先级问题。此外,如果我改变对链接的想法,我将不得不重组这两个项目,并且这两个项目之间的任何共同依赖关系可能很难维护。

如何让 mxmlc 优先考虑 SWC 而不是 Actionscript?或者,如果这不可能,是否更常见的是为 Flash 编译的库创建一个单独的项目,或者隔离项目中的 Flash 源以使其不包含在项目类路径中?

I would like to compile my view classes into an SWC from flash, and compile the rest of the application using mxmlc (avoiding recompiling through the IDE). However, because the view classes (source) are in the project class path, mxmlc gives them precedence over the compiled SWC.

Now I'm thinking that maybe the view classes have to be separated into a separate project, but I am hesitant to do so because I don't think these classes truly constitute an independent project, and separating them out would not serve any purpose beyond working around the linking precedence problem. Furthermore, if i were to change my mind about the linkage, i would have to restructure both projects, and any common dependancies between the two projects could be messy to maintain.

How can I get mxmlc to give precedence to the SWC over the Actionscript? Or, if this is not possible, is it more common to create a separate project for the Flash-compiled library, or to isolate the Flash source in the project so that it is not included in the project class path?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

疯狂的代价 2024-09-13 18:30:39

更常见的是为 Flash 编译的库创建一个单独的项目,还是隔离项目中的 Flash 源,使其不包含在项目类路径中?

实际上,其中一种并不比另一种更常见。这取决于您想要实现的目标。例如,我经常下载有用的库(补间、jpeg 编码等)并将它们全部放入库目录中。然后我将它们作为附加来源包含在内。

我还有一个在多个项目中使用的个人库,它是它自己的 Flex 项目,并且作为 SWC 链接。

不过,我怀疑我是否想在同一个项目中分离类。

还有一些其他方法可以从 mxmlc 中排除文件。 本文展示了一种使用编译器选项的方法 -link- report-load-externs 看起来非常聪明。因此,如果您愿意手工制作自己的 xml 排除文件,那么 -load-externs 也适合您。

允许您省略符号的其他编译器选项包括:-externs-compiler.external-library-path

is it more common to create a separate project for the Flash-compiled library, or to isolate the Flash source in the project so that it is not included in the project class path?

One isn't more common than the other really. It depends on what you are trying to achieve. For example, I often download useful libraries (tweening, jpeg encoding, etc) and put them in all into a library directory. I then just include them as additional source.

I also have a personal library that I use in several projects which is its own Flex project and I link as a SWC.

I doubt I'd want to separate classes in the same project though.

There are a few other ways to exclude files from mxmlc. This article shows one method using the compiler options -link-report and -load-externs and it seems pretty clever. So if you are comfortable hand-crafting your own xml exclude file then -load-externs could work for you too.

The other compiler options that allow you to omit the symbols include: -externs and -compiler.external-library-path.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文