Platform: Flex 3 & Flex 4
Language: AS3
I have inherited a very large code-base written for the Flex3 framework at work.
My company would like to segment the software into “smaller”, more “specific” use-cases.
There will be some overlap in features between the different products.
One option would be to copy the code-base into various projects and prune the code for the various use-cases as appropriate. (is that even appropriate?)
However, I would like to avoid that since maintaining the same code duplicated across more than 3 software products would likely be a pain.
Is it possible to create custom build configurations on top of one (1) code-base that compiles only what is needed for that particular product? (I am imagining something akin to #ifdef statements or perhaps build configurations in Visual Studio)
Would moving to git help facilitate that? (We use SVN.)
Any advice would be greatly appreciated.
-Regards
Oliver
You can totally do conditional compilation if you use FlashDevelop.
Linky link: http://www.flashdevelop.org/wikidocs/index.php?title=AS3_Conditional_Compilation
Basically, you type something like this:
And then in your flashdevelop project settings, properties, project settings, set some compiler constants, “CONFIG::mode_a,true”, “CONFIG::mode_b,false”. Then foo_mode_a() will get called and foo_mode_b() will not.
There’s various ways you can use this (follow the link), but the most powerful is to make it so that code ISN’T EVEN THERE if you put it in a conditional compilation block with the variable set to false in your settings.