actionscript-3environment-variablesflash-builder

Use environment var in compiler arguments on a Flashbuilder project


In the compiler options of my flashbuilder project, i'm trying to do this :

-define+=CONFIG::dev,${MY_VAR}

As MY_VAR would be a variable related to the environment and not to the project (so each developer on the project can define his value of MY_VAR). I tried to find a way in flashbuilder, or by setting an os var in windows, but without success, any idea ?


Solution

  • I don't believe you can grab a value from the environment straight away but if you want to customize your data per dev, you can have them in the flex-config.xml file for each dev.

    If you don't want to have it right into the flex-config.xml file, you can """concat/merge""" another XML config file with another command: -load-config+=myfile.xml

    More info on the different ways you can define them (inline or within the XML file): http://blogs.adobe.com/flexdoc/files/flexdoc/conditionalcompilation.pdf In action: http://ditdahgames.com/2011/07/stupid-flex-mxmlc-compiler-tricks-part-1-conditional-compiling/

    Fabien