FDT supports special variables in the mxmlc compiler arguments when building a project, that allow you access to certain useful information. Typically when you create a new project through FDT, you will get these two lines in the compiler arguments:
1 2 |
-target-player={playerVersion} -library-path+="{flexSDK}/frameworks/locale/en_US" |
You can already see two variables being used here: {playerVersion} and {flexSDK}. These variables are parsed before the arguments are sent to the mxmlc compiler, and would end up looking something like this:
1 2 |
-target-player=10.1 -library-path+=C:\sdks\flex_sdk_4.1.0.16076/frameworks/locale/en_US |
Very useful! So what variables are available then? Unfortunately there does not seem to be any documentation about compiler argument variables, so I do not have a definitive list, but I do know of four:
- {playerVersion} – The player version you selected when choosing the SDK for your flash project
- {flexSDK} – The path to the selected flex SDK
- {project} – The full path to the folder the project is located in
- {locale} – The chosen locale (for example en_US)
I have not actually managed to get the {locale} variable to work, but I have seen it referenced in forums and in FDT bug reports, so I presume it at least works for some people. There are a couple of variables that I would love to see added to that list that could be really useful, including the project name, swf filename and the name of the current build configuration.
Do you know of any other compiler argument variables that are available in FDT? Please leave a comment if you do, and I will add them to the list.