开发者

How to link against SWC when source is in project?

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.

Ho开发者_如何学Gow 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?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜