Compiler Options
List of all available compiler options
The mxmlc and compc compilers bundled with Apache Royale have a number of useful configuration options.
The list below is also available by running
mxmlc -help advanced
orcompc -help advanced
in on the command line.
-allow-dynamic-bindings
(mxmlc only) – Controls whether data binding may use reflection for dynamic access.-api-report
<filename>
– Used to generate a report of APIs used in a project.-benchmark
– Output performance benchmark.-closure-lib
<string>
– Customize the version of Google Closure Library used by the framework.-compiler.accessible
– With the SWF target, controls whether accessibility is enabled for a generated .swf file.-compiler.actionscript-file-encoding
<string>
– Specifies ActionScript file encoding. If there is no BOM in the AS3 source files, the compiler will use this file encoding.-compiler.advanced-telemetry
– Controls advanced telemetry data is enabled for a generated .swf file, allowing more data to be accessed by Adobe Scout.-compiler.allow-abstract-classes
– If true, classes and methods can be declaredabstract
and must be overridden to be used.-compiler.allow-import-aliases
– If true, import alias syntax may be used in ActionScript code.-compiler.allow-private-constructors
– If true, constructors can be declared private. Useful for a class with all-static methods or Singletons.-compiler.allow-private-name-conflicts
-compiler.allow-source-path-overlap
– Checks if a source-path entry is a subdirectory of another source-path entry. It helps make the package names of MXML components unambiguous.-compiler.allow-subclass-overrides
-compiler.as3
– With the SWF target, use the ActionScript 3 class based object model for greater performance and better error reporting. In the class based object model most built-in functions are implemented as fixed methods of classes.-compiler.binding-event-handler-class
<string>
-compiler.binding-event-handler-event
<string>
-compiler.binding-event-handler-interface
<string>
-compiler.binding-value-change-event
<string>
-compiler.binding-value-change-event-kind
<string>
-compiler.binding-value-change-event-type
<string>
-compiler.byte-array-embed-class
<string>
-compiler.component-factory-class
<string>
-compiler.component-factory-interface
<string>
-compiler.compress
– With the SWF target, enables or disables .swf file compression.-compiler.context-root
<context-path>
– Path to replace{context.root}
tokens for service channel endpoints.-compiler.debug
– Determines if the compiler generates a debug or release build.-compiler.defaults-css-files
[filename]
[...]
-compiler.defaults-css-url
<string>
– Defines the location of the default style sheet. Setting this option overrides the implicit use of the defaults.css style sheet in the framework SWC file.-compiler.define
<name>
<value>
– Define a global conditional compilation definition (i.e.COMPILE::JS
,CONFIG::debug
)-compiler.enable-runtime-design-layers
-compiler.es
– With the SWF target, use the ECMAScript edition 3 prototype based object model to allow dynamic overriding of prototype properties. In the prototype based object model built-in functions are implemented as dynamic properties of prototype objects.-compiler.exclude-defaults-css-files
[filename]
[...]
-compiler.external-library-path
[path-element]
[...]
– List of SWC files or directories to compile against but to omit from linking.-compiler.fonts.advanced-anti-aliasing
– With the SWF target, enables advanced anti-aliasing for embedded fonts, which provides greater clarity for small fonts.-compiler.fonts.languages.language-range
<lang>
<range>
– A range to restrict the number of font glyphs embedded into the SWF.-compiler.fonts.local-font-paths
[path-element]
[...]
-compiler.fonts.local-fonts-snapshot
<string>
– File containing system font data produced by flex2.tools.FontSnapshot.-compiler.fonts.managers
[manager-class]
[...]
– Compiler font manager classes, in policy resolution order.-compiler.fonts.max-cached-fonts
<string>
– Sets the maximum number of fonts to keep in the server cache. The default value is 20.-compiler.fonts.max-glyphs-per-face
<string>
– Sets the maximum number of character glyph-outlines to keep in the server cache for each font face. The default value is 1000.-compiler.fxg-base-class
<string>
-compiler.headless-server
– A flag to set when Royale is running on a server without a display.-compiler.include-libraries
[library]
[...]
– A list of libraries (SWCs) to completely include into the output.-compiler.infer-types
– Allows omitting type annotations on variables by inferring the type from the right side of assignments.-compiler.info.royale
-compiler.isolate-styles
– Enables the compiled application or module to set styles that only affect itself and its children.-compiler.js-define
– Overrides-define
for JavaScript targets.-compiler.js-external-library-path
[path-element]
[...]
– Overrides-external-library-path
for JavaScript targets.-compiler.js-library-path
[path-element]
[...]
– Overrides-library-path
for JavaScript targets.-compiler.js-namespaces.namespace
[uri]
[manifest]
[...]
– Overrides-namespace
for JavaScript targets.-compiler.keep-all-type-selectors
– Disables the pruning of unused CSS type selectors.-compiler.keep-as3-metadata
[name]
[...]
– Keep the specified metadata in the output.-compiler.keep-code-with-metadata
[name]
[...]
-compiler.library-path
[path-element]
[...]
– List of SWC files or directories that contain SWC files.-compiler.locale
[locale-element]
[...]
– Specifies the locale for internationalization.-compiler.minimum-supported-version
<string>
-compiler.mobile
– Specifies the target runtime is a mobile device.-compiler.mxml.children-as-data
-compiler.mxml.compatibility-version
<version>
– Specifies a compatibility version. e.g. -compatibility-version=2.0.1.-compiler.mxml.force-local-id
-compiler.mxml.imports
[implicit-import]
[...]
-compiler.mxml.minimum-supported-version
<string>
-compiler.namespaces.namespace
[uri]
[manifest]
[...]
– Specify a URI to associate with a manifest of components for use as MXML elements.-compiler.omit-trace-statements
– Toggle whethertrace()
statements are omitted.-compiler.optimize
– Optimizes the bytecode of a generated .swf file.-compiler.preloader
<string>
– Specifies the default value for the Application’s preloader attribute.-compiler.proxy-base-class
<string>
-compiler.remove-dead-code
-compiler.report-invalid-styles-as-warnings
– Enables reporting of invalid styles as warnings.-compiler.report-missing-required-skin-parts-as-warnings
– Use this option to generate a warning instead of an error when a missing required skin part is detected.-compiler.services
<filename>
– Path to BlazeDS configuration file-compiler.show-actionscript-warnings
– Runs the AS3 compiler in a mode that detects legal but potentially incorrect code.-compiler.show-binding-warnings
– toggle whether warnings generated from data binding code are displayed.-compiler.show-invalid-css-property-warnings
– Toggle whether invalid css property warnings are reported.-compiler.show-multiple-definition-warnings
-compiler.show-shadowed-device-font-warnings
– Toggles whether warnings are displayed when an embedded font name shadows a device font name.-compiler.show-unused-type-selector-warnings
– Toggle whether warnings generated from unused CSS type selectors are displayed.-compiler.source-path
[path-element]
[...]
– List of directory path elements that form the roots of ActionScript class hierarchies.-compiler.states-class
<string>
-compiler.states-event-override-class
<string>
-compiler.states-instance-override-class
<string>
-compiler.states-property-override-class
<string>
-compiler.states-style-override-class
<string>
-compiler.strict
– Runs the AS3 compiler in strict error checking mode.-compiler.strict-identifier-names
– Toggles whether identifier names may be keywords or not.-compiler.strict-xml
– Enables stricter rules for XML and E4X.-compiler.swf-external-library-path
[path-element]
[...]
– Overrides-external-library-path
for the SWF target.-compiler.swf-library-path
[path-element]
[...]
– Overrides-library-path
for JavaScript targets.-compiler.targets
[target]
[...]
– List of target output formats (i.e. SWF, JSRoyale).-compiler.theme
[filename]
[...]
– List of CSS or SWC files to apply as a theme.-compiler.verbose-stacktraces
– Save callstack information to the SWF for debugging.-compiler.warn-array-tostring-changes
– Warn that Array.toString() format has changed from AS2.-compiler.warn-assignment-within-conditional
– Warn that an assignment exists within a conditional.-compiler.warn-bad-array-cast
– Possibly invalid Array cast operation.-compiler.warn-bad-bool-assignment
– Non-Boolean value used where a Boolean value was expected.-compiler.warn-bad-date-cast
– Invalid Date cast operation.-compiler.warn-bad-es3-type-method
– Unknown method.-compiler.warn-bad-es3-type-prop
– Unknown property.-compiler.warn-bad-nan-comparison
– Illogical comparison with NaN. Any comparison operation involving NaN will evaluate to false because NaN != NaN.-compiler.warn-bad-null-assignment
– Impossible assignment to null.-compiler.warn-bad-null-comparison
– Illogical comparison with null.-compiler.warn-bad-undefined-comparison
– Illogical comparison with undefined. Only untyped variables (or variables of type *) can be undefined.-compiler.warn-boolean-constructor-with-no-args
– Boolean() with no arguments returns false in ActionScript 3.0. Boolean() returned undefined in ActionScript 2.0.-compiler.warn-changes-in-resolve
–__resolve
is no longer supported.-compiler.warn-class-is-sealed
– Class is sealed. It cannot have members added to it dynamically.-compiler.warn-const-not-initialized
– Constant not initialized.-compiler.warn-constructor-returns-value
– Function used in new expression returns a value. Result will be what the function returns, rather than a new instance of that function.-compiler.warn-deprecated-event-handler-error
– EventHandler was not added as a listener.-compiler.warn-deprecated-function-error
– Unsupported ActionScript 2.0 function.-compiler.warn-deprecated-property-error
– Unsupported ActionScript 2.0 property.-compiler.warn-duplicate-argument-names
– More than one argument by the same name.-compiler.warn-duplicate-variable-def
-compiler.warn-for-var-in-changes
– ActionScript 3.0 iterates over an object’s properties within a “for x in target” statement in random order.-compiler.warn-import-hides-class
– Importing a package by the same name as the current class will hide that class identifier in this scope.-compiler.warn-instance-of-changes
– Use of the instanceof operator.-compiler.warn-internal-error
– Internal error in compiler.-compiler.warn-level-not-supported
–_level
is no longer supported. For more information, see the flash.display package.-compiler.warn-missing-namespace-decl
– Missing namespace declaration (e.g. variable is not defined to be public, private, etc.).-compiler.warn-negative-uint-literal
– Negative value will become a large positive value when assigned to a uint data type.-compiler.warn-no-constructor
– Missing constructor.-compiler.warn-no-explicit-super-call-in-constructor
– Thesuper()
statement was not called within the constructor.-compiler.warn-no-type-decl
– Missing type declaration.-compiler.warn-number-from-string-changes
– In ActionScript 3.0, white space is ignored and ‘’ returns 0. Number() returns NaN in ActionScript 2.0 when the parameter is ‘’ or contains white space.-compiler.warn-scoping-change-in-this
– Change in scoping for the this keyword. Class methods extracted from an instance of a class will always resolve this back to that instance. In ActionScript 2.0 this is looked up dynamically based on where the method is invoked from.-compiler.warn-slow-text-field-addition
– Inefficient use of += on a TextField.-compiler.warn-this-within-closure
– Use ofthis
within a closure may not point to expected object.-compiler.warn-unlikely-function-value
– Possible missing parentheses.-compiler.warn-xml-class-has-changed
– Possible usage of the ActionScript 2.0 XML class.-debug-password
<string>
– With the SWF target, the password to include in debuggable .swf files.-default-background-color
<int>
– Sets the initial stage color of a generated .swf file (may be overridden by the application code).-default-frame-rate
<int>
– Sets the initial frame rate of a generated .swf file (may be overridden by the application code).-default-script-limits
<max-recursion-depth>
<max-execution-time>
– Sets the default script execution limits of a generated .swf file (may be overridden by root attributes).-default-size
<width>
<height>
– Sets the default stage width and height of a generated .swf file.-dependency-graph
<filename>
-directory
(compc only) – Output the library as an open directory instead of a SWC file.-dump-config
<filename>
– Write a file containing all currently set configuration values in a format suitable for use as a Royale config XML file.-error-problems
[class]
[...]
– Specifies the fully qualified class names of compiler problems that should be reported as errors.-exclude-native-js-libraries
-export-internal-symbols
-export-protected-symbols
-export-public-symbols
-external-js-lib
[path-element]
[...]
-externs
[symbol]
[...]
– A list of symbols to omit from linking when building the output.-externs-report
<filename>
(mxmlc only)-frames.frame
[label]
[classname]
[...]
– A SWF frame label with a sequence of classnames that will be linked onto the frame.-help
[keyword]
[...]
– Displays compiler usage instructions.-html-output-filename
<filename>
- Specifies the file name of the HTML file generated by the compiler (default: index.html)-html-template
<filename>
– The path to an optional template for the HTML file generated by the compiler.-ignore-problems
[class]
[...]
– Ignores specific problems reported by the compiler.-include-classes
[class]
[...]
(compc only) – A list of classes to include in the output SWC.-include-file
[name]
[path]
[...]
(compc only) – A list of named files to include in the output SWC.-include-inheritance-dependencies-only
– Only include inheritance dependencies of classes specified with-include-classes
.-include-namespaces
[uri]
[...]
(compc only) – All classes in the listed namespaces are included in the output SWC.-include-resource-bundles
[bundle]
[...]
– A list of resource bundles to include in the output.-include-sources
[path-element]
[...]
(compc only) – A list of directories and source files to include in the output SWC.-include-styleshehet
[name]
[path]
[...]
(compc only) – A list of named stylesheet resources to include in the output SWC.-includes
[symbol]
[...]
A list of symbols to always link into the output.-inline-constants
– Replace references to constants in compiled output with their literal values instead.-js-compiler-define
<name>
<value>
-js-compiler-option
[option]
[...]
– Additional options to pass to Google Closure Compiler.-js-complex-implicit-coercions
-js-default-initializers
– With JavaScript targets, determines if uninitialized variables are automatically initialized with default values.-js-dynamic-access-unknown-members
- With JavaScript targets, replaces.memberName
member access with["memberName"]
dynamic access, if the member is unrecognized to prevent Google Closure Compiler from renaming the member.-js-getter-prefix
<string>
– Sets the string used as a prefix for getter functions in the generated .js files.-js-include-asset
<string>
– Copies an asset file to the output directory.-js-include-css
<string>
– Copies a .css file to the output directory and adds a<link rel="stylesheet">
element to the HTML.-js-include-script
<string>
– Copies a .js file to the output directory and adds a<script>
element to the HTML.-js-load-config
<filename>
– Overrides-load-config
for JavaScript targets.-js-output
<filename>
– Sets the output directory path of the generated .js files.-js-output-optimization
[optimization]
[...]
-js-output-type
<string>
– No longer used.-js-resolve-uncertain
-js-setter-prefix
<string>
– Sets the string used as a prefix for setter functions in the generated .js files.-js-vector-emulation-class
<string>
– Sets the type used to emulate the ActionScript 3.0Vector
class in the generated .js files.-js-vector-index-checks
-jsx-factory
<string>
-keep-asdoc
-link-report
<filename>
– Generates an XML linkage report of the definitions linked into the output.-load-config
<filename>
– Loads an XML configuration file that specifies more compiler options to use.-load-externs
<filename>
– An XML file containing<def>
,<pre>
, and<ext>
symbols to omit from linking when building the output.-marmotinni
<string>
-metadata.contributor
<name>
– A contributor’s name to store in the SWF metadata.-metadata.creator
<name>
– A creator’s name to store in the SWF metadata.-metadata.date
<text>
– The creation date to store in the SWF metadata.-metadata.dateFormat
<text>
-metadata.description
<text>
– The default description to store in the SWF metadata.-metadata.language
<code>
– The language to store in the SWF metadata (i.e. EN, FR).-metadata.localized-description
<text>
<lang>
– A localized RDF/XMP description to store in the SWF metadata.-metadata.localized-title
<title>
<lang>
– A localized RDF/XMP title to store in the SWF metadata.-metadata.publisher
<name>
– A publisher’s name to store in the SWF metadata.-metadata.title
<text>
– The default title to store in the SWF metadata.-module-output
<filename>
-mxml-reflect-object-property
(mxmlc only)-output
<filename>
– Sets the output path of a generated .swf file.-prevent-rename-internal-instance-accessors
(mxmlc only)-prevent-rename-internal-instance-methods
(mxmlc only)-prevent-rename-internal-instance-variables
(mxmlc only)-prevent-rename-internal-static-accessors
(mxmlc only)-prevent-rename-internal-static-methods
(mxmlc only)-prevent-rename-internal-static-variables
(mxmlc only)-prevent-rename-internal-symbols
(mxmlc only)-prevent-rename-mxml-symbol-references
(mxmlc only)-prevent-rename-protected-instance-accessors
(mxmlc only)-prevent-rename-protected-instance-methods
(mxmlc only)-prevent-rename-protected-instance-variables
(mxmlc only)-prevent-rename-protected-static-accessors
(mxmlc only)-prevent-rename-protected-static-methods
(mxmlc only)-prevent-rename-protected-static-variables
(mxmlc only)-prevent-rename-protected-symbols
-prevent-rename-public-instance-accessors
(mxmlc only)-prevent-rename-public-instance-methods
(mxmlc only)-prevent-rename-public-instance-variables
(mxmlc only)-prevent-rename-public-static-accessors
(mxmlc only)-prevent-rename-public-static-methods
(mxmlc only)-prevent-rename-public-static-variables
(mxmlc only)-prevent-rename-public-symbols
(mxmlc only)-raw-metadata
<text>
– XML text to store in the SWF metadata (overrides metadata.* configuration).-remove-circulars
– Writes .js dependencies in a way that satisfies the Google Closure Compiler. Use this if you have circular dependencies.-remove-unused-rsls
– Remove Runtime Shared Libraries (RSLs) that are not being used by the application.-resource-bundle-list
<filename>
– Prints a list of resource bundles to a file for input to the compc compiler to create a resource bundle SWC file.-runtime-shared-libraries
[url]
[...]
– A list of runtime shared library URLs to be loaded before the application starts.-runtime-shared-library-path
[path-element]
[rsl-url]
[policy-file-url]
[rsl-url]
[policy-file-url]
– Specifies a SWC to link against, a Runtime Shared Library (RSL) URL to load, with an optional policy file URL and optional failover URLs.-runtime-shared-library-settings.application-domain
[path-element]
[application-domain-target]
[...]
– Override the application domain a Runtime Shared Library (RSL) is loaded into. The supported values are ‘current’, ‘default’, ‘parent’, or ‘top-level’.-runtime-shared-library-settings.force-rsls
[path-element]
[...]
– Force a Runtime Shared Library (RSL) to be loaded, overriding the removal caused by using the remove-unused-rsls option-sdk-js-lib
[path-element]
[...]
-size-report
<filename>
– Output an XML-formatted report detailing the size of all code and data linked into the application.-skip-transpile
-source-map
– Generate source maps for JavaScript debugging.-source-map-source-root
<string>
– Set the source root to use for source maps used for JavaScript debugging.-static-link-runtime-shared-libraries
– Statically link the libraries specified by the-runtime-shared-libraries-path
option.-strict-flex-css
– Specifies whether to use Flex’s CSS parsing rules instead of Royale’s CSS parsing rules.-strict-publish
-swf-debugfile-alias
<filename>
-swf-version
<int>
– Specifies the version of the compiled SWF file.-target-player
<version>
– Specifies the version of the player the application is targeting. Features requiring a later version will not be compiled into the application. The minimum value supported is “9.0.0”.-tools-locale
<string>
– Specifies the locale used by the compiler when reporting errors and warnings.-use-direct-blit
– With the SWF target, use hardware acceleration to blit graphics to the screen, where such acceleration is available.-use-flashbuilder-project-files
-use-gpu
– With the SWF target, use GPU compositing features when drawing graphics, where such acceleration is available.-use-network
– Toggle whether the SWF is flagged for access to network resources.-verbose
– Display more detailed compiler output.-verify-digests
– Verifies the libraries loaded at runtime are the correct ones.-version
– Display the build version of the program-warn-public-vars
– Warn for public variables that are not accessors.-warning-problems
[class]
[...]
– Specifies the fully qualified class names of compiler problems that should be reported as warnings.-warnings
– Determines if compile-time warnings are enabled.-watch
– Watch for source file changes and rebuild incrementally
allow-abstract-classes
Available since Royale 0.9.6
Determines if the abstract
modifier may be used with classes. For more details, see Abstract Classes in ActionScript.
-allow-abstract-classes
Maven configuration:
<additionalCompilerOptions>-allow-abstract-classes=true;</additionalCompilerOptions>
allow-import-aliases
Available since Royale 0.9.6
Determines if alias syntax for for imported symbols is allowed or not.
-allow-import-aliases
Maven configuration:
<additionalCompilerOptions>-allow-import-aliases=true;</additionalCompilerOptions>
allow-private-constructors
Available since Royale 0.9.6
Determines if the private
namespace may be used with class constructors. For more details, see Private Constructors in ActionScript.
-allow-private-constructors
Maven configuration:
<additionalCompilerOptions>-allow-private-constructors=true;</additionalCompilerOptions>
closure-lib
Sets the path to a custom distribution of Google’s Closure library, instead of the default version used by the compiler.
-closure-lib path/to/closure
Maven configuration:
<additionalCompilerOptions>-closure-lib=path/to/closure;</additionalCompilerOptions>
js-define
Defines a global constant at compile time. May be a boolean, number, string, or expression.
-define CONFIG::debugging true -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.
Maven configuration:
<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;
html-output-filename
Specifies the file name of the HTML file generated by the compiler to load the Apache Royale application in the browser.
-html-output-filename custom.html
Maven configuration:
<additionalCompilerOptions>-html-output-filename=custom.html;</additionalCompilerOptions>
html-template
Specifies the path to an optional template for the HTML file generated by the compiler to load the Apache Royale application in the browser.
-html-template ./path/to/template.html
Maven configuration:
<htmlTemplate>${basedir}/target/javascript/bin/js-debug/jewel-example-index-template.html</htmlTemplate>
infer-types
Available since Royale 0.9.12
Specifies that types of variables, fields, and function returns, if omitted, should be inferred from the initializer or return statements. For more details, see Type Inference in ActionScript.
-infer-types
Maven configuration:
<additionalCompilerOptions>-infer-types=true;</additionalCompilerOptions>
inline-constants
Available since Royale 0.9.7
Determines if primitive constant values (such as numbers, booleans, and strings) will be inlined.
-inline-constants
Maven configuration:
<additionalCompilerOptions>-inline-constants=true;</additionalCompilerOptions>
js-compiler-option
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.
-js-compiler-option+="--variable_map_output_file gccvars.txt" -js-compiler-option+="--compilation_level SIMPLE_OPTIMIZATIONS"
Maven configuration:
<additionalCompilerOptions>-js-compiler-option=--variable_map_output_file gccvars.txt;-js-compiler-option+=--property_map_output_file gccprops.txt</additionalCompilerOptions>
js-default-initializers
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.
-js-default-initializers
Maven configuration:
<additionalCompilerOptions>-js-default-initializers=true;</additionalCompilerOptions>
js-define
Defines a global constant at compile time for the JavaScript output, but not the SWF output. May be a boolean, number, string, or expression.
-js-define CONFIG::debugging true -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.
Maven configuration:
<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;
js-dynamic-access-unknown-members
Available since Royale 0.9.4
If the definition of a member cannot be resolved at compile time, emit dynamic access instead of normal member access. Ensures that dynamic members aren’t renamed.
-js-dynamic-access-unknown-members
Maven configuration:
<additionalCompilerOptions>-js-dynamic-access-unknown-members=true;</additionalCompilerOptions>
js-getter-prefix
Available since Royale 0.9.9
Sets the string used as a prefix for getter functions in the generated .js files. Defaults to get__
.
-js-getter-prefix=get_
Maven configuration:
<additionalCompilerOptions>-js-getter-prefix=get_;</additionalCompilerOptions>
js-include-asset
Available since Royale 0.9.13
Copies a custom asset file to the the output directory. Typically combined with -js-include-css
or -js-include-script
.
-js-include-asset+=path/to/asset-file.png
In the output directory, typically bin/js-debug or bin/js-release, the index.html file will be generated in the root, and asset files will be copied into an assets sub-directory.
Maven configuration:
<additionalCompilerOptions>-js-include-asset+=path/to/asset-file.png;</additionalCompilerOptions>
js-include-css
Available since Royale 0.9.13
Copies a .css file to the output directory and adds a <link rel="stylesheet">
element to the HTML. If the .css file references any external asset files, this option may be combined with -js-include-asset
.
-js-include-css+=path/to/file.css
In the output directory, typically bin/js-debug or bin/js-release, the index.html file will be generated in the root, and .css files will be copied into a css sub-directory.
Maven configuration:
<additionalCompilerOptions>-js-include-css+=path/to/file.css;</additionalCompilerOptions>
js-include-script
Available since Royale 0.9.13
Copies a .js file to the output directory and adds a <script>
element to the HTML. If the .js file references any external asset files, this option may be combined with -js-include-asset
.
-js-include-script+=path/to/file.js
In the output directory, typically bin/js-debug or bin/js-release, the index.html file will be generated in the root, and .js files will be copied into a scripts sub-directory.
Maven configuration:
<additionalCompilerOptions>-js-include-script+=path/to/file.js;</additionalCompilerOptions>
js-load-config
Specifies the locations of XML configuration files that define extra compiler options for JavaScript output.
-js-load-config path/to/project-config.xml
Maven configuration:
<additionalCompilerOptions>-js-load-config+=path/to/project-config.xml;</additionalCompilerOptions>
Maven configuration:
js-output
The path where the generated JavaScript output should be saved, if your are also using it for the .swf output path.
-js-output path/to/output
Maven configuration:
Use outputDirectory
within configuration
XML node instead.
js-setter-prefix
Available since Royale 0.9.9
Sets the string used as a prefix for setter functions in the generated .js files. Defaults to set__
.
-js-setter-prefix=set_
Maven configuration:
<additionalCompilerOptions>-js-setter-prefix=set_;</additionalCompilerOptions>
js-vector-emulation-class
A custom implemention to use instead of default emulation of the AVM2 Vector
typed collection.
-js-vector-emulation-class=com.example.MyVectorClass
Maven configuration:
<additionalCompilerOptions>-js-vector-emulation-class=com.example.MyVectorClass;</additionalCompilerOptions>
jsx-factory
Available since Royale 0.9.7
Customize the factory to use for JSX syntax. Defaults to React.createElement
.
-jsx-factory=_jsx
Maven configuration:
<additionalCompilerOptions>-jsx-factory=_jsx;</additionalCompilerOptions>
keep-asdoc
Determines if asdoc comment annotations are kept in the generated JavaScript.
-keep-asdoc=false
Maven configuration:
<additionalCompilerOptions>-keep-asdoc=false;</additionalCompilerOptions>
export-public-symbols
In a release build, determines if symbols in the public
namespace will be exported or not. The default value is true
.
-export-public-symbols=false
Note: This option applies only to compiling applications using
mxmlc
. If you are compiling a library (usingcompc
), this option does not exist, and you will get a warning if you try to use it.
Maven configuration:
<additionalCompilerOptions>-export-public-symbols=false;</additionalCompilerOptions>
export-protected-symbols
In a release build, determines if symbols in the protected
namespace will be exported. The default value is false
.
-export-protected-symbols=true
Note: This option applies only to compiling applications using
mxmlc
. If you are compiling a library (usingcompc
), this option does not exist, and you will get a warning if you try to use it.
Maven configuration:
<additionalCompilerOptions>-export-protected-symbols=true;</additionalCompilerOptions>
export-internal-symbols
In a release build, determines if symbols in the internal
namespace will be exported. The default value is false
.
-export-internal-symbols=true
Note: This option applies only to compiling applications using
mxmlc
. If you are compiling a library (usingcompc
), this option does not exist, and you will get a warning if you try to use it.
Maven configuration:
<additionalCompilerOptions>-export-internal-symbols=true;</additionalCompilerOptions>
prevent-rename-public-symbols
Available since Royale 0.9.8
In a release build, determines if symbols in the public
namespace may be renamed or not. The default value is true
.
-prevent-rename-public-symbols=false
Note: This option applies only to compiling applications using
mxmlc
. If you are compiling a library (usingcompc
), this option does not exist, and you will get a warning if you try to use it.
Maven configuration:
<additionalCompilerOptions>-prevent-rename-public-symbols=false;</additionalCompilerOptions>
Related options:
When prevent-rename-public-symbols
option is true
, one or more the following options may be set to false
to allow renaming of certain specific subsets of public symbols.
prevent-rename-public-static-methods
prevent-rename-public-instance-methods
prevent-rename-public-static-variables
prevent-rename-public-instance-variables
prevent-rename-public-static-accessors
prevent-rename-public-instance-accessors
prevent-rename-protected-symbols
Available since Royale 0.9.8
In a release build, determines if symbols in the protected
namespace may be renamed or not. The default value is true
.
-prevent-rename-protected-symbols=false
Note: This option applies only to compiling applications using
mxmlc
. If you are compiling a library (usingcompc
), this option does not exist, and you will get a warning if you try to use it.
Maven configuration:
<additionalCompilerOptions>-prevent-rename-protected-symbols=false;</additionalCompilerOptions>
Related options:
When prevent-rename-protected-symbols
option is true
, one or more the following options may be set to false
to allow renaming of certain specific subsets of protected symbols.
prevent-rename-protected-static-methods
prevent-rename-protected-instance-methods
prevent-rename-protected-static-variables
prevent-rename-protected-instance-variables
prevent-rename-protected-static-accessors
prevent-rename-protected-instance-accessors
prevent-rename-internal-symbols
Available since Royale 0.9.8
In a release build, determines if symbols in the internal
namespace may be renamed or not. The default value is true
.
-prevent-rename-internal-symbols=false
Note: This option applies only to compiling applications using
mxmlc
. If you are compiling a library (usingcompc
), this option does not exist, and you will get a warning if you try to use it.
Maven configuration:
<additionalCompilerOptions>-prevent-rename-internal-symbols=false;</additionalCompilerOptions>
Related options:
When prevent-rename-internal-symbols
option is true
, one or more the following options may be set to false
to allow renaming of certain specific subsets of internal symbols.
prevent-rename-internal-static-methods
prevent-rename-internal-instance-methods
prevent-rename-internal-static-variables
prevent-rename-internal-instance-variables
prevent-rename-internal-static-accessors
prevent-rename-internal-instance-accessors
prevent-rename-public-static-methods
Available since Royale 0.9.8
In a release build, determines if static methods in the public
namespace may be renamed or not. The default value is true
. This option will be ignored if the prevent-rename-public-symbols
compiler option is false
.
-prevent-rename-public-static-methods=false
Note: This option applies only to compiling applications using
mxmlc
. If you are compiling a library (usingcompc
), this option does not exist, and you will get a warning if you try to use it.
Maven configuration:
<additionalCompilerOptions>-prevent-rename-static-methods=false;</additionalCompilerOptions>
prevent-rename-public-instance-methods
Available since Royale 0.9.8
In a release build, determines if instance (non-static) methods in the public
namespace may be renamed or not. The default value is true
. This option will be ignored if the prevent-rename-public-symbols
compiler option is false
.
-prevent-rename-public-instance-methods=false
Note: This option applies only to compiling applications using
mxmlc
. If you are compiling a library (usingcompc
), this option does not exist, and you will get a warning if you try to use it.
Maven configuration:
<additionalCompilerOptions>-prevent-rename-public-instance-methods=false;</additionalCompilerOptions>
prevent-rename-public-static-variables
Available since Royale 0.9.8
In a release build, determines if static variables in the public
namespace may be renamed or not. The default value is true
. This option will be ignored if the prevent-rename-public-symbols
compiler option is false
.
-prevent-rename-public-static-variables=false
Note: This option applies only to compiling applications using
mxmlc
. If you are compiling a library (usingcompc
), this option does not exist, and you will get a warning if you try to use it.
Maven configuration:
<additionalCompilerOptions>-prevent-rename-static-variables=false;</additionalCompilerOptions>
prevent-rename-public-instance-variables
Available since Royale 0.9.8
In a release build, determines if instance (non-static) variables in the public
namespace may be renamed or not. The default value is true
. This option will be ignored if the prevent-rename-public-symbols
compiler option is false
.
-prevent-rename-public-instance-variables=false
Note: This option applies only to compiling applications using
mxmlc
. If you are compiling a library (usingcompc
), this option does not exist, and you will get a warning if you try to use it.
Maven configuration:
<additionalCompilerOptions>-prevent-rename-public-instance-variables=false;</additionalCompilerOptions>
prevent-rename-public-static-accessors
Available since Royale 0.9.8
In a release build, determines if static accessors (getters and setters) in the public
namespace may be renamed or not. The default value is true
. This option will be ignored if the prevent-rename-public-symbols
compiler option is false
.
-prevent-rename-public-static-accessors=false
Note: This option applies only to compiling applications using
mxmlc
. If you are compiling a library (usingcompc
), this option does not exist, and you will get a warning if you try to use it.
Maven configuration:
<additionalCompilerOptions>-prevent-rename-static-accessors=false;</additionalCompilerOptions>
prevent-rename-public-instance-accessors
Available since Royale 0.9.8
In a release build, determines if instance (non-static) accessors (getters and setters) in the public
namespace may be renamed or not. The default value is true
. This option will be ignored if the prevent-rename-public-symbols
compiler option is false
.
-prevent-rename-public-instance-accessors=false
Note: This option applies only to compiling applications using
mxmlc
. If you are compiling a library (usingcompc
), this option does not exist, and you will get a warning if you try to use it.
Maven configuration:
<additionalCompilerOptions>-prevent-rename-public-instance-accessors=false;</additionalCompilerOptions>
prevent-rename-protected-static-methods
Available since Royale 0.9.8
In a release build, determines if static methods in the protected
namespace may be renamed or not. The default value is true
. This option will be ignored if the prevent-rename-protected-symbols
compiler option is false
.
-prevent-rename-protected-static-methods=false
Note: This option applies only to compiling applications using
mxmlc
. If you are compiling a library (usingcompc
), this option does not exist, and you will get a warning if you try to use it.
Maven configuration:
<additionalCompilerOptions>-prevent-rename-static-methods=false;</additionalCompilerOptions>
prevent-rename-protected-instance-methods
Available since Royale 0.9.8
In a release build, determines if instance (non-static) methods in the protected
namespace may be renamed or not. The default value is true
. This option will be ignored if the prevent-rename-protected-symbols
compiler option is false
.
-prevent-rename-protected-instance-methods=false
Note: This option applies only to compiling applications using
mxmlc
. If you are compiling a library (usingcompc
), this option does not exist, and you will get a warning if you try to use it.
Maven configuration:
<additionalCompilerOptions>-prevent-rename-protected-instance-methods=false;</additionalCompilerOptions>
prevent-rename-protected-static-variables
Available since Royale 0.9.8
In a release build, determines if static variables in the protected
namespace may be renamed or not. The default value is true
. This option will be ignored if the prevent-rename-protected-symbols
compiler option is false
.
-prevent-rename-protected-static-variables=false
Note: This option applies only to compiling applications using
mxmlc
. If you are compiling a library (usingcompc
), this option does not exist, and you will get a warning if you try to use it.
Maven configuration:
<additionalCompilerOptions>-prevent-rename-static-variables=false;</additionalCompilerOptions>
prevent-rename-protected-instance-variables
Available since Royale 0.9.8
In a release build, determines if instance (non-static) variables in the protected
namespace may be renamed or not. The default value is true
. This option will be ignored if the prevent-rename-protected-symbols
compiler option is false
.
-prevent-rename-protected-instance-variables=false
Note: This option applies only to compiling applications using
mxmlc
. If you are compiling a library (usingcompc
), this option does not exist, and you will get a warning if you try to use it.
Maven configuration:
<additionalCompilerOptions>-prevent-rename-protected-instance-variables=false;</additionalCompilerOptions>
prevent-rename-protected-static-accessors
Available since Royale 0.9.8
In a release build, determines if static accessors (getters and setters) in the protected
namespace may be renamed or not. The default value is true
. This option will be ignored if the prevent-rename-protected-symbols
compiler option is false
.
-prevent-rename-protected-static-accessors=false
Note: This option applies only to compiling applications using
mxmlc
. If you are compiling a library (usingcompc
), this option does not exist, and you will get a warning if you try to use it.
Maven configuration:
<additionalCompilerOptions>-prevent-rename-static-accessors=false;</additionalCompilerOptions>
prevent-rename-protected-instance-accessors
Available since Royale 0.9.8
In a release build, determines if instance (non-static) accessors (getters and setters) in the protected
namespace may be renamed or not. The default value is true
. This option will be ignored if the prevent-rename-protected-symbols
compiler option is false
.
-prevent-rename-protected-instance-accessors=false
Note: This option applies only to compiling applications using
mxmlc
. If you are compiling a library (usingcompc
), this option does not exist, and you will get a warning if you try to use it.
Maven configuration:
<additionalCompilerOptions>-prevent-rename-protected-instance-accessors=false;</additionalCompilerOptions>
prevent-rename-internal-static-methods
Available since Royale 0.9.8
In a release build, determines if static methods in the internal
namespace may be renamed or not. The default value is true
. This option will be ignored if the prevent-rename-internal-symbols
compiler option is false
.
-prevent-rename-internal-static-methods=false
Note: This option applies only to compiling applications using
mxmlc
. If you are compiling a library (usingcompc
), this option does not exist, and you will get a warning if you try to use it.
Maven configuration:
<additionalCompilerOptions>-prevent-rename-static-methods=false;</additionalCompilerOptions>
prevent-rename-internal-instance-methods
Available since Royale 0.9.8
In a release build, determines if instance (non-static) methods in the internal
namespace may be renamed or not. The default value is true
. This option will be ignored if the prevent-rename-internal-symbols
compiler option is false
.
-prevent-rename-internal-instance-methods=false
Note: This option applies only to compiling applications using
mxmlc
. If you are compiling a library (usingcompc
), this option does not exist, and you will get a warning if you try to use it.
Maven configuration:
<additionalCompilerOptions>-prevent-rename-internal-instance-methods=false;</additionalCompilerOptions>
prevent-rename-internal-static-variables
Available since Royale 0.9.8
In a release build, determines if static variables in the internal
namespace may be renamed or not. The default value is true
. This option will be ignored if the prevent-rename-internal-symbols
compiler option is false
.
-prevent-rename-internal-static-variables=false
Note: This option applies only to compiling applications using
mxmlc
. If you are compiling a library (usingcompc
), this option does not exist, and you will get a warning if you try to use it.
Maven configuration:
<additionalCompilerOptions>-prevent-rename-static-variables=false;</additionalCompilerOptions>
prevent-rename-internal-instance-variables
Available since Royale 0.9.8
In a release build, determines if instance (non-static) variables in the internal
namespace may be renamed or not. The default value is true
. This option will be ignored if the prevent-rename-internal-symbols
compiler option is false
.
-prevent-rename-internal-instance-variables=false
Note: This option applies only to compiling applications using
mxmlc
. If you are compiling a library (usingcompc
), this option does not exist, and you will get a warning if you try to use it.
Maven configuration:
<additionalCompilerOptions>-prevent-rename-internal-instance-variables=false;</additionalCompilerOptions>
prevent-rename-internal-static-accessors
Available since Royale 0.9.8
In a release build, determines if static accessors (getters and setters) in the internal
namespace may be renamed or not. The default value is true
. This option will be ignored if the prevent-rename-internal-symbols
compiler option is false
.
-prevent-rename-internal-static-accessors=false
Note: This option applies only to compiling applications using
mxmlc
. If you are compiling a library (usingcompc
), this option does not exist, and you will get a warning if you try to use it.
Maven configuration:
<additionalCompilerOptions>-prevent-rename-static-accessors=false;</additionalCompilerOptions>
prevent-rename-internal-instance-accessors
Available since Royale 0.9.8
In a release build, determines if instance (non-static) accessors (getters and setters) in the internal
namespace may be renamed or not. The default value is true
. This option will be ignored if the prevent-rename-internal-symbols
compiler option is false
.
-prevent-rename-internal-instance-accessors=false
Note: This option applies only to compiling applications using
mxmlc
. If you are compiling a library (usingcompc
), this option does not exist, and you will get a warning if you try to use it.
Maven configuration:
<additionalCompilerOptions>-prevent-rename-internal-instance-accessors=false;</additionalCompilerOptions>
remove-circulars
Tells the Apache Royale compiler to remove circular dependencies in the generated JavaScript, where possible.
-remove-circulars
Maven configuration:
<removeCirculars>true</removeCirculars>
show-binding-warnings
Set to false to remove all data binding warnings.
-show-binding-warnings=false
Maven configuration:
<additionalCompilerOptions>-show-binding-warnings=false;</additionalCompilerOptions>
skip-transpile
(Advanced) Set to false to skip transpiling ActionScript and MXML to JavaScript, and only run the release build. Generally used by contributors to the compiler only. Default s to false
.
-skip-transpile=true
Maven configuration:
<additionalCompilerOptions>-skip-transpile=true;</additionalCompilerOptions>
strict-identifier-names
Available since Royale 0.9.7
Determines if names of identifiers must follow the strict rules of ActionScript 3.0, or if they may use the looser rules introduced in ECMAScript 5. Defaults to false
.
-strict-identifier-names
Maven configuration:
<additionalCompilerOptions>-strict-identifier-names=true;</additionalCompilerOptions>
source-map
Emits a source map in the debug build for each ActionScript file. The default value is false.
-source-map
Maven configuration:
<additionalCompilerOptions>-source-map=true;</additionalCompilerOptions>
source-map-source-root
Available since Royale 0.9.8
Sets a custom value for the sourceRoot
property in the generated source map files. This option will be ignored if the source-map
compiler option is false
.
-source-map-source-root=my/custom/path
Maven configuration:
<additionalCompilerOptions>-source-map-source-root=my/custom/path;</additionalCompilerOptions>
strict-flex-css
Available since Royale 0.9.12
Specifies whether to use Flex’s CSS parsing rules instead of Royale’s CSS parsing rules.
-strict-flex-css=true
Maven configuration:
<additionalCompilerOptions>-strict-flex-css=true;</additionalCompilerOptions>
targets
Specifies the target format of the code generated by the Apache Royale compiler. You can specify multiple targets.
-targets JSRoyale,SWF
The compiler supports the following values for “targets”:
JSRoyale
generates JavaScript with the Royale framework components.JS
generates JavaScript without the Royale framework components.JSNode
generates a complete script that may run with Node.js.JSNodeModule
generates a CommonJS module that may be loaded withrequire()
in Node.js.SWF
generates a .swf file for Adobe Flash Player or Adobe AIR.
Maven configuration:
<targets>JSRoyale</targets>
verbose
Available since Royale 0.9.6
Display more detailed compiler output.
-verbose
Maven configuration:
<additionalCompilerOptions>-verbose=true;</additionalCompilerOptions>
warn-public-vars
Enables or disables warnings about using public variables when it may be considered dangerous to use them.
-warn-public-vars
Maven configuration:
<additionalCompilerOptions>-warn-public-vars=true;</additionalCompilerOptions>
warn-this-within-closure
Available since Royale 0.9.7
Enable warning that use of this
within a closure may not point to expected object.
-warn-this-within-closure
Maven configuration:
<additionalCompilerOptions>-warn-this-within-closure=true;</additionalCompilerOptions>
watch
Available since Royale 0.9.10
After initial compilation completes, the compiler keeps running to watch for source file changes. When .as or .mxml files are changed, the compiler runs a fast incremental build. Use Ctrl+C to exit the compiler.
-watch
Maven configuration:
<additionalCompilerOptions>-watch=true;</additionalCompilerOptions>