Exporting release build - Flex through Intellij Idea

4.4k Views Asked by At

How do I generate release build of my Flex Application
through IntelliJ Idea, like I do in Flex Builder?

3

There are 3 best solutions below

0
On BEST ANSWER
  1. Right click on any project and select module setting.
  2. Select tab "Flex compiler setting"
  3. Last field on this tab is "Additional compiler options:" add "-debug=false" without double quotes to it.
  4. Do this for all the subprojects. (From this form only you can choose different projects).
  5. do a project Rebuild and you will get a smaller swf.

Only problem is you need to keep separate project files for debug and release build, but thats ok, as you release builds are done rarely.

0
On

Does IntelliJ support Ant? Maybe not the answer you're looking for, but you could use the Flex Ant Tasks to build outside of FB.

http://livedocs.adobe.com/flex/3/html/help.html?content=anttasks_1.html

0
On

Alternate answer:

Instead of creating a Flex Module, create a Java Module, and add 2 Flex Facet's to it. One facet will be configured as the debug facet, the other as the release facet. This process will create 2 swf files, debug and release versions.

  1. Create a java module, for example "FlexHelloWorld". Do not add a flex facet yet.
  2. In the project view, right click on the project and select module setting
  3. Under the Modules option, select the "FlexHelloWorld" module
  4. Click the "+" symbol, add Flex Facet
  5. Rename facet to "Debug"
  6. Enter your main class name
  7. Enter "debug.swf" as the output file name
  8. Click apply
  9. Click the "+" symbol, add Flex Facet
  10. Rename facet to "Release"
  11. Enter your main class name
  12. Enter "release.swf" as the output file name
  13. Under additional compiler options, add "-debug=false -optimize=true"
  14. Click ok
  15. Build the module. In the output directory, you will have "debug.swf" and "release.swf" files.

Note: In your HTML wrapper, you will have to call either debug.swf or release.swf. Or you could create 2 wrappers.