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.

Thanks
9 comments
Comment actions Permalink

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

0
Comment actions Permalink

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

0
Comment actions Permalink

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.
0
Comment actions Permalink

IntelliJ IDEA license doesn't allow reverse engineering.

0
Comment actions Permalink

Any XML manipulating API will work.

0
Comment actions Permalink

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?
0
Comment actions Permalink

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.

0
Comment actions Permalink

Thanks :)

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

0

Please sign in to leave a comment.