Working with Build Configurations
This feature is only supported in the Ultimate edition.
In this section:
- Build configuration types
- Main options for build configurations
- Build configuration dependencies (build path)
- Compiler options
- Active build configuration
- Possible changes when changing the build configuration type
Every Flash module in IntelliJ IDEA includes one or more build configurations. A build configuration defines how the module source files are transformed into the target output type (SWF or SWC) and then packaged.
One build configuration is created when creating a module. You can add more build configurations if and when needed.
Build configuration types
The build configuration type is defined by the following:
- Target platform (i.e. the environment in which the developed content is going to be used): Web (for Flash player / Web browser-targeted content), Desktop (for Adobe AIR-targeted content), or Mobile (AIR Mobile, for the content intended for Android and iOS mobile devices).
- Whether the build configuration uses the Flex framework or is pure ActionScript.
- Output type: Application (a runnable application, an SWF file), Library (an SWC file), or a Runtime-loaded module (a dynamically-loadable module, an SWF file).
Main options for build configurations
Once the build configuration type is defined, the following main options can be specified:
- For the Applications and Runtime-loaded modules: the main class.
- The output file name.
- The output folder.
- For Web Applications: the folder with the HTML wrapper template.
- For Web and Desktop Applications: the modules and runtime Style Sheets.
Build configuration dependencies (build path)
Generally, the build path for each build configuration may be defined by the following:
- Flex SDK. The necessary SDK SWCs are selected automatically depending on the build configuration type. Additionally, you can manage the set of the SWCs by selecting the following:
- For the Web target platform: the Flash player version. If the SDK includes more than one player version, you can choose which of the corresponding SWCs should be used.
- For Flex framework-based build configurations: the Flex 4 component sets. You can specify that only the Spark or MX or both component sets should be used.
For Flex components you can specify their framework linkage type (Merged Into Code, RLS or External).
- Other build configurations that generate libraries and runtime-loaded modules.
- 3rd-party libraries, both SWC and raw ActionScript.
Each build configuration is associated with a set of compiler options.
IntelliJ IDEA provides the default sets of compiler options at the level of the IDE, project and module.
The defaults at a lower level may be inherited from the upper level or redefined. At the level of individual build configurations, similarly, the compiler options may be inherited from the module level defaults. Alternatively, build configuration-specific values may be specified.
IntelliJ IDEA provides a convenient interface for editing the defaults at various levels. There is also an ability to restore the defaults for the values that were changed.
Active build configuration
One of the build configurations is set active for the corresponding module.
The active build configuration provides the basis for source code highlighting in the editor. So when you change the active configuration, the code highlighting in the module changes as well.
Managing build configurations and their settings
To manage build configurations and their settings, follow these steps
- Open the Project Structure dialog (e.g. Ctrl+Shift+Alt+S).
- Under Project Settings, select Modules.
- In the area under , expand the necessary Flash module node and select any of the build configurations. Now you can:
- View and edit the settings for the selected build configuration on the Build Configuration page shown in the right-hand part of the dialog.
- Create a copy of the selected build configuration. To do that, click or select Copy in the context menu. Specify the settings for the copy the build configuration in the dialog that opens. Note that depending on the settings, the copy of the build configuration may have the type different from that of the original. See Possible changes when changing the build configuration type.
- Find the usages of the selected build configuration in the project. To do that, click , press Alt+F7 or select Find usages in the context menu.
- Delete the selected build configuration. To do that, click , press Delete or select Delete in the context menu.
- Create a new build configuration. To do that:
- Click , press Alt+Insert or select New in the context menu.
- Select Flash build configuration.
- In the Add Build Configuration dialog that opens, specify the name and select the main options for the new build configuration, and click OK.
- If necessary edit the build configuration settings on the Build Configuration page.
- Change the build configuration type. To do that, click Change on the General tab (to the right of the area where the build configuration type is shown) and specify the build configuration properties in the dialog that opens. See Possible changes when changing the build configuration type.
- Click OK in the Project Structure dialog.
See also, To use shortcuts to open build configuration settings, follow these steps.
Selecting an active build configuration
To select an active build configuration, follow these steps
The name of the build configuration which is currently active is shown in the right-hand part of the status bar.
To make a different build configuration active, click this name.
As a result, the Active Flash build configuration menu is shown in which you can select a different build configuration which will become active.
The Active Flash build configuration menu can also be accessed from the editor when working with a
.mxml file. The Active Flash Build Configuration command is available for this purpose.
Using shortcuts to open build configuration settings
To use shortcuts to open build configuration settings, follow these steps
As already mentioned, the Active Flash build configuration menu is used to select an active build configuration (see To select an active build configuration, follow these steps).
In addition, this menu provides a shortcut for accessing build configuration settings (the Project Structure option).
When you select Project Structure in the Active Flash build configuration menu, the Project Structure dialog opens showing the settings for the active build configuration.
See also, To manage build configurations and their settings, follow these steps.
Possible changes when changing the build configuration type
When changing the build configuration type (by using the Change type command or when creating a copy of a build configuration), the following changes may occur if the build configuration output type has changed (e.g., from Application to Library):
- The output file name extension may change (from
.swcand vice versa).
- If the output type has changed to Library, dependencies on runtime-loaded modules (if existed) are removed.
- If dependencies on the build configuration with the changed type have become inappropriate, such dependencies are removed.
When creating a copy of a build configuration, the following changes occur in addition:
- The output file name changes.
- If applicable, the package file name or names change.