Creating flash modules with same source but different compile options

Answered

Hi everyone!

I have an AIR/Flex project that I'm working on. I need to compile two separate SWFs from the same source (not necessarily at the same time, that's not important).

What I have done is created two modules that reference the same source files. The only difference between the compiles is that I need to set some conditional compile options on one of the modules.

Is there anyway to do this with run configurations instead?

It's annoying because I only need to compile the 2nd module once per build cycle because it's for test automation. So I can turn on the skip compilation for that module during development, but it's just inconvenient to always have to check and uncheck that because I forget.

0
11 comments

Apologies but I have seen that. It even has a section labeled "Compile options" but none of the build configurations for flash allow you to change compiler options that I saw. Only in module settings can yuou cahnge them. Which is why I created two modules and is what I'm asking if I can do without

0

Make sure you understand that Flash Build Configuration and Flash Run Configuration are different things.

For your case, you need to configure one Flash module with two Flash Build Configurations (BCs). Each BC has its own Compiler Settings tab.

Each Flash Run Configuration (Run | Edit Configurations) is based on one of the BCs. Run Configuration says how to run the app, not how to compile it, so it is not possible to edit compiler options in the Run Configuration.

When you press Run or Debug button only the BC configured for the started Run Configuration is compiled, so you probably do not need to switch on the 'Skip compilation' flag for the another BC. To compile all BCs use 'Build Project' (in the toolbar or under Build main menu item)

0

OK that does make sense and that actually is how I have it set up after looking at it, screenshot attached. One module "PassportPOS" with two BCs "PassportPOS" and "TestCompletePOS". I then have two run configurations, one of each points to the two different BCs. But every single time I run/debug it compiles both and pops up the hint about parallel compilation.

0

Would that be a bug then if it is compiling both? I thought maybe it compiled both becuase both pointed to the same source  and since the source files had changed it just automatically does it.

0

I can't reproduce the issue. If I click Debug or Run button only one BC is compiled for me. Don't they depend on each other (see Dependencies tab)?

0

I don't believe so. They both rely on the same set of libraries. They are all the exact same project except in Compile Options I have set a conditional compiler option and added a swc using the -include-libraries compiler option

0

An issue with a sample project to reproduce is welcome.

0

Certainly! I will try to pear down this project and see if I can upload it after I'm off work today. Thanks!

0

Sorry for the delay but I finally pared it down and here it is. There is literally nothing in it but it still compiles both modules. Here is the porject

 

https://www.dropbox.com/s/17rmboovkhx3s1e/test_project.zip?dl=0 

0

Still can't reproduce. This is what I get when I select PassportPOS run configuration in the combo box and click Run:

And this is for TestCompletePOS run configuration:

0

Please sign in to leave a comment.