IntelliJ IDEA 2017.3 Help

Keymap:

Configuring dependencies for modular applications

This feature is only supported in the Ultimate edition.

There are two ways of configuring dependencies for modular applications. (Modular applications are ones that include dynamically loadable modules, see Modular applications overview in Flex documentation.)

One way is to list the main classes for runtime-loaded modules (RLMs) in the build configuration for the main application (a.k.a. shell). This way doesn't require creating build configurations for the modules.

The other way is to create build configurations for each of the RLMs and then, in the build configuration for the main application, specify the dependencies on these build configurations.

These two approaches along with their advantages and drawbacks are discussed below.

Specifying the dependencies by listing the main RLM classes

If the source code of the main application and its runtime-loaded modules are in the same IntelliJ IDEA module, you can just list the main RLM classes in the build configuration for the main application. In addition, if you want to optimize a module against the main application (this considerably reduces the size of compiled module file), you can do that by turning the corresponding option on in the UI.

Note that this way of specifying the dependencies is available for Web and desktop applications but unavailable for mobile applications.

In the Choose Main Class of Runtime-Loaded Module dialog that opens, select the main class of the corresponding RLM and click OK.

If you want the module SWF file size to be optimized, select the Optimize checkbox.

In a similar way, add dependencies on other RLMs.

Click OK in the Runtime-Loaded Modules dialog.

Click OK in the Project Structure dialog.

Specifying the dependencies by listing the RLM build configurations

When using this way of specifying the dependencies, you should have build configurations for each of the RLMs. Besides, to optimize the file size of the RLMs, you should specify the load-externs and link-report compiler options manually (in the corresponding build configurations).

Advantages:

The main application and the modules can be compiled using different sets of compilation options. (Every build configuration has its own set of compiler options.)

The source code of the main application and the RLMs may be in the same IntelliJ IDEA module or in different modules (within the same project).

Drawbacks:

You have to create a build configuration for each of the RLMs.

To use the load-externs and link-report compiler options, you should specify them manually.