Building a Flex application with themes

IntelliJ doesn't build the modules of my application in the correct order, and not sure how to resolve it. My application consists of a Main module, a few libraries, a couple (Flex) modules, and a theme. The parts that I'm having build troubles with are

- MyFlexModule (depends on MyTheme)
- MyTheme (depends on MyLibrary)
- MyLibrary (no dependancies)

MyFlexModule uses the "Compiler Options/Styles and Themes/Theme" area of its "Build Configuration" to point to the compiled MyTheme.swc.
MyTheme uses the "Dependencies" area of its "Build Configuration" to point to the MyLibrary build configuration.

When I select "Rebuild Project", the first thing that happens is it tries to compile MyFlexModule and errors because it's unable to open MyTheme.swc. Based on my listed depencies, it should compile MyLibrary first, then MyTheme, and finally MyFlexModule. So why does it try to build MyFlexModule first?

Because of this, in order to do a full clean build, I have manually compile six IntelliJ modules (I only listed the three that are having problems, but there's a total of 6 that make up the application) in order, which is very time consuming.

0
2 comments

I think there won't be any harm if you also add dependency of MyFlexModule on MyTheme at Dependencies tab as if MyTheme were a normal lib.
But this is only a workaround. I think that ideal solution is to remove Styles and Themes/Theme from Compiler Options tab and add a Theme linkage type at Dependencies tab. Do you agree? Please watch/vote/comment http://youtrack.jetbrains.com/issue/IDEA-101602.

0
Avatar
Permanently deleted user

I was thinking that would, unneccessarily, increase the file size of the compiled Flex module, but since the module doesn't reference any classes directly, it appears that the file size remains the same when making the theme a dependency for the module.

Having the theme compiler option (as it is now) would be fine when using a 3rd party theme, or a theme that rarely changes. But in this situation, where I'm developing the theme as I develop the rest of the app, it does prove a bit difficult. I like your idea of creating a Theme linkage type and think it would solve the issue.

0

Please sign in to leave a comment.