2 Configuration

There are several configuration options for the plugin, but most are related to mxml compilation and html wrapper file generation.

Core properties

There are only two 'core' properties and only one is required - grails.plugin.flex.home - and only if the FLEX_HOME environment variable is not set.

PropertyDefaultMeaning
grails.plugin.flex.homenone, must be setLocation of your Flex SDK
grails.plugin.flex.webtier.compiler.enabledtrue in developmentwhether the webtier MXML compiler is enabled

MXMLC properties

There are also several properties that configure mxml compilation, both automatic precompilation when building a war file and explicit compilation when running the compile-mxml script.

PropertyDefaultMeaning
grails.plugin.flex.precompileMxml.enabledfalseSet to true to precompile mxml files to swf files when creating a war
grails.plugin.flex.precompileMxml.filesnoneA list of file names (relative to the web-app folder) to precompile
grails.plugin.flex.mxmlc.keepGeneratedfalseSet to true keep the files generated by the compiler
grails.plugin.flex.mxmlc.extraSourcePathsnoneA list of extra source paths
grails.plugin.flex.mxmlc.extraLibPathsnoneA list of extra library paths
grails.plugin.flex.mxmlc.compileTimeConstantsnoneA map of compile-time constants
grails.plugin.flex.mxmlc.contextRootapplication nameThe context root of the web application, used to calculate AMF channel URLs
grails.plugin.flex.mxmlc.incrementalfalseWhen incremental compilation is enabled, the compiler inspects changes to the bytecode between revisions and only recompiles the section of bytecode that has changed.
grails.plugin.flex.mxmlc.debugfalseIf true generates a debug SWF file which includes line numbers and filenames of all source files.
grails.plugin.flex.mxmlc.verboseStacktracesfalseIf true generates source code that includes line numbers for display in stacktraces when a runtime error occurs.
grails.plugin.flex.mxmlc.actionscriptFileEncodingnoneSets the .as file encoding so that the compiler correctly interprets ActionScript files.
grails.plugin.flex.mxmlc.accessiblefalseEnables accessibility features
grails.plugin.flex.mxmlc.headlessfalseEnables the headless implementation of the Flex compiler; required to use fonts and SVG on UNIX systems without X Windows.
grails.plugin.flex.mxmlc.optimizetrueEnables the ActionScript optimizer which reduces file size and increases performance by optimizing the SWF file's bytecode.

HTML wrapper properties

The remaining properties configure the generation of an html wrapper to load a swf file.

PropertyDefaultMeaning
grails.plugin.flex.mxmlc.htmlWrapper.createfalseif true then an html wrapper file will be created when precompiling
grails.plugin.flex.mxmlc.htmlWrapper.titleMXML file nameThe HTML title tag value
grails.plugin.flex.mxmlc.htmlWrapper.extensiongspThe extension for the html file
grails.plugin.flex.mxmlc.htmlWrapper.historyfalseIf true creates resources for history tracking
grails.plugin.flex.mxmlc.htmlWrapper.height100%The height of the swf in the page
grails.plugin.flex.mxmlc.htmlWrapper.width100%The width of the swf in the page
grails.plugin.flex.mxmlc.htmlWrapper.bgcolor#ffffffThe background color for the page
grails.plugin.flex.mxmlc.htmlWrapper.version.major10The minimum required Flash major version
grails.plugin.flex.mxmlc.htmlWrapper.version.minor0The minimum required Flash minor version
grails.plugin.flex.mxmlc.htmlWrapper.version.revision0The minimum required Flash revision version