List of Available Compiler Options
Royale provides these options for its compiler:
Specifies the file name of the HTML file generated by the compiler to load the Apache Royale application in the browser.
-compiler.html-output-filename custom.html
Specifies the path to an optional template for the the HTML file generated by the compiler to load the Apache Royale application in the browser.
-compiler.html-template ./path/to/template.html
<htmlTemplate>${basedir}/target/javascript/bin/js-debug/jewel-example-index-template.html</htmlTemplate>
Specifies one or more custom compiler options to pass to the Google Closure Compiler, which is used to create the release build of an Apache Royale application.
-compiler.js-compiler-option.variable_map_output_file gccvars.txt -compiler.compilation_level SIMPLE_OPTIMIZATIONS
<additionalCompilerOptions>-js-compiler-option=--variable_map_output_file gccvars.txt;-js-compiler-option+=--property_map_output_file gccprops.txt</additionalCompilerOptions>
Defaults to true. Enables or disables initialization of primitive (Number, Boolean, etc.) variables with default values in the generated JavaScript. Corresponds to AVM runtime implicit type intialization values.
Note that some reflection utility functions require this to be set to true in order for them to work correctly in JavaScript.
-compiler.js-default-initializers
<additionalCompilerOptions>-js-default-initializers=true;</additionalCompilerOptions>
Defines a global constant at compile time for the JavaScript output. May be a boolean, number, string, or expression.
-compiler.js-define CONFIG::debugging true -compiler.js-define CONFIG::release false
For Boolean and numeric values, you may pass in literals like true, false, or 123. Format string values with nested quotes, like “‘hello’”, because the compiler will attempt to evaluate an expression when it encounters a quotation mark.
<defines> <property> <name>BUILD::buildNumber</name> <value>'"${buildTimestamp}"'</value> </property> <property> <name>BUILD::buildVersion</name> <value>'"${project.version}"'</value> </property> </defines>
Then in AS3 you can do:
// Build Number private static var _buildNumber :String = BUILD::buildNumber; // Project Version private static var _projectVersion :String = BUILD::buildVersion;
Specifies the locations of XML configuration files that define extra compiler options for JavaScript output.
-compiler.js-load-config path/to/project-config.xml
The path where the generated JavaScript output should be saved, if your are also using it for the .swf output path.
-compiler.js-output path/to/output
Use instead outputDirectory
in configuration
xml node
Tells the Apache Royale compiler to remove circular dependencies in the generated JavaScript, where possible.
-compiler.remove-circulars
<removeCirculars>true</removeCirculars>
Emits a source map in the debug build for each ActionScript file. The default value is false.
-compiler.source-map
<additionalCompilerOptions>-source-map=true;</additionalCompilerOptions>
Specifies the target format of the code generated by the Apache Royale compiler. You can specify multiple targets.
-compiler.targets JSRoyale,SWF
The compiler supports the following values for “targets”:
<targets>JSRoyale</targets>
Enables or disables warnings about using public variables.
-compiler.warn-public-vars
<additionalCompilerOptions>-warn-public-vars=true;</additionalCompilerOptions>
Set to false to remove all binding warnings.
-compiler.show-binding-warnings=false
<additionalCompilerOptions>-show-binding-warnings=false;</additionalCompilerOptions>