Hello!
A short post for newbies on how to use the configuration file to set compiler options.
What is a configuration file and what is it for? This file is nothing but an xml file containing compiler options. And he needed to actually manage the compiler. You can specify the path to the configuration file using the -load-config compiler option.
By default, the Flex SDK includes a configuration file called flex-config.xml.
This file contains the default compiler settings for the application and compiler components. The flex-config.xml file is located in the flex_install_dir / frameworks directory of your Flex SDK. That is, when building from the command line, by default it is used.
')
Flash Builder does not use the flex-config.xml file from the Flex SDK, and during the build it generates its configuration file based on the project settings. You can see the contents from the generated configuration file by using the -dump-config compiler option myapp-config.xml. Then when compiling the project, it will be created in the file myapp-config.xml which will contain the current configuration of the compiler.
For example, create your configuration file with the name my-flex-config.xml in which we define a pair of constants for conditional compilation:
In the created file, we describe the basic file structure:
<?xml version="1.0"?> <flex-config xmlns="http://www.adobe.com/2006/flex-config"> <compiler> <define> <name>CONFIG::debug</name> <value>true</value> </define> <define> <name>CONFIG::console</name> <value>true</value> </define> </compiler> </flex-config>
Description of the syntax of the configuration fileExactly the same can be done by specifying the compiler option from the command line
-define = CONFIG :: debug, true -define = CONFIG :: console, true.
In fact, the configuration file allows you to specify all the parameters of the compiler in one file.
To add the -load-config compiler option in Flash Builder, right-click on the project, select Properties, then Action Script Compiler, and in the Additional Compiler Argumets text area, add -load-config + = my -flex-config.xml

In this case, "+ =" means that we supplement the main configuration file with our config file. file. If you need to completely replace the configuration file, then we specify it through "=".