I have a module containing a huge Flex web app (browser based) to which I am now adding mobile support. A lot of the non-UI code needs to be shared, and the module is not currently a Library type, so IntelliJ doesn't allow sharing source outside the module. It has about 25 build configurations which output the functionality into modular swfs.
For my first mobile app, which is basically a mobile compatible UI on top of the same app, I have created a new build configuration within the same module, specifying the AIR mobile type.
This works, but only to a point.
The breakdown occurs when I have to always be mindful of the "Active Flash build configuration" in the lower right corner, and when I always have to look at the "other half" of my source code in an error state, according to IntelliJ. Apparently, only a subset of the Flex SDK components are visible to a given "Active Flash build configuration" - so the components invisible show up as undefined symbols in the source code editor, thus turning red and misleading me about the state of the code.
I realize I could split my app into three parts, one module for non-UI, one module for Mobile UI, and one module for Flex Web UI. However, is this the best use of my time, and the most elegant way to solve the problem? I guess I just like keeping my source together... My current package structure is so elaborate, I don't want to make it twice as hard to maintain nor do I need twice as many folders to go though to find a source file during development... Time is money! This is more than what FlexBuilder would have mandated, because I believe you could share another Project on the classpath, even if it was not a Library. It was up to the developer not to use a component in the wrong device context.
It seems to me that a simple solution should be to do away with the active build configuration concept for Flex / AIR, at least in terms of the code (binary or source) that is shared. Allow a given set of libraries to be shared with a module, instead of limiting the classpath to a build configuration, and share the entire SDK with each source file in the module.
It was very tedious setting up the 25 build configurations, only to put exactly the same set of libraries on ALL of them. It was a very duplicative effort, and I eventually resorted to editing the XML file for the project in a text editor, and reopening IntelliJ with the new settings to save all the clicking...
I think it is reasonable to impose a rule that a new module is required if a different set of libraries is desired on the Flex "classpath". This would be similar to Eclipse project, which shared the classpath.
Is there anything that can be done to improve IntelliJ 13, so I can keep my apps organized in the same module?