Flex facet build configration

Hi guys,

How can I change flex facet build configuration?

FacetType type = FacetTypeRegistry.getInstance().findFacetType("flex");         for (Module module : ModuleManager.getInstance(project).getModules()) {             Facet facet = FacetManager.getInstance(module).getFacetByType(type.getId());             facet.getConfiguration().         }

Can't find the correct API to access it.


Unfortunately Flex Support plugin in IntelliJ IDEA is not open sourced and doesn't have publicly open API.


Seems logical then that I should be able to voverride this settings with reflection?


When I come to think of it, I can simply(?) manipulate the iml file to change the settings I need.
Is there an easy way to get and set properties inside the iml file?

<?xml version="1.0" encoding="UTF-8"?> <module type="JAVA_MODULE" version="4">   <component name="FacetManager">     <facet type="flex" name="Flex">       <configuration>         <option name="DO_BUILD" value="true" />         <option name="OUTPUT_TYPE" value="Application" />

I would like to manipulate the options inside the flex facet.

IntelliJ IDEA license doesn't allow reverse engineering.


Any XML manipulating API will work.


Hi Alexander,

I am trying to adjust my plugin to version 11.1.

This code stopped to work:

FacetType type = FacetTypeRegistry.getInstance().findFacetType("flex");
Facet facet = FacetManager.getInstance(module).getFacetByType(type.getId());

I used this to test if module is of type flex: facet != null

How can I fix this please?

There are no Java modules with Flex facets in 11.1, only Flash modules left. Module type check is the same as before: ModuleType.get(module) == FlexModuleType.getInstance(). FlashBuildConfigurations are accessed via FlexBuildConfigurationManager class. But again, this API is not open, and decompilation and reverse engineereing is not allowed by the license.


Thanks :)

Regarding what is allowed by the license, changing the *.iml file programatically in the file system is allowed?


Please sign in to leave a comment.