public interface Configuration
Configuration
interface allows clients to set compiler options for Application and Library.
The client can not instantiate a Configuration
object. It can be obtained by invoking the
getDefaultConfiguration()
method in Application
and Library
.
Application app = new Application(new File("HelloWorld.mxml")); Configuration c1 = app.getDefaultConfiguration(); Library lib = new Library(); Configuration c2 = lib.getDefaultConfiguration();The compiler populates the default
Configuration
object with the values in flex-config.xml
.
If a local configuration file is also available (for example, HelloWorld-config.xml
), the compiler also uses
values in that file to populate the Configuration
object. The local configuration file's values take precedence
over options set in the flex-config.xml
file. If you add a configuration file using the addConfiguration()
method, that configuration file's options take precedence over those set in flex-config.xml or in a local configuration file; they
do not take precedence over configuration options set using the Configuration
interface's methods such as setExterns()
.
The order of configuration option precedence is as follows (highest first):
1. Methods of theConfiguration
interface such assetExterns()
. 2. Configuration file loaded with theaddConfiguration()
method. 3. Local configuration file (such as app_name-config.xml). 4. The flex-config.xml file. 5. Default compiler settings.
Modifier and Type | Field and Description |
---|---|
static int |
CONTRIBUTOR
A contributor's name to store in the SWF metadata.
|
static int |
CREATOR
A creator's name to store in the SWF metadata.
|
static int |
DATE
The creation date to store in the SWF metadata.
|
static String |
DEFAULT_OUTPUT_DIRECTORY_TOKEN
Set the default output directory for configuration settings.
|
static int |
DESCRIPTION
The default and localized RDF/XMP description to store in the SWF metadata.
|
static int |
LANGUAGE
The language to store in the SWF metadata (i.e.
|
static int |
PUBLISHER
A publisher's name to store in the SWF metadata.
|
static int |
TITLE
The default and localized RDF/XMP title to store in the SWF metadata.
|
static int |
WARN_ARRAY_TOSTRING_CHANGES
Array.toString() format has changed. |
static int |
WARN_ASSIGNMENT_WITHIN_CONDITIONAL
Assignment within conditional.
|
static int |
WARN_BAD_ARRAY_CAST
Possibly invalid Array cast operation.
|
static int |
WARN_BAD_BOOLEAN_ASSIGNMENT
Non-Boolean value used where a
Boolean value was expected. |
static int |
WARN_BAD_DATE_CAST
Invalid
Date cast operation. |
static int |
WARN_BAD_ES3_TYPE_METHOD
Unknown method.
|
static int |
WARN_BAD_ES3_TYPE_PROP
Unknown property.
|
static int |
WARN_BAD_NAN_COMPARISON
Illogical comparison with
NaN . |
static int |
WARN_BAD_NULL_ASSIGNMENT
Impossible assignment to
null . |
static int |
WARN_BAD_NULL_COMPARISON
Illogical comparison with
null . |
static int |
WARN_BAD_UNDEFINED_COMPARISON
Illogical comparison with
undefined . |
static int |
WARN_BOOLEAN_CONSTRUCTOR_WITH_NO_ARGS
Boolean() with no arguments returns false in ActionScript 3.0. |
static int |
WARN_CHANGES_IN_RESOLVE
__resolve is deprecated. |
static int |
WARN_CLASS_IS_SEALED
Class is sealed. |
static int |
WARN_CONST_NOT_INITIALIZED
Constant not initialized.
|
static int |
WARN_CONSTRUCTOR_RETURNS_VALUE
Function used in new expression returns a value.
|
static int |
WARN_DEPRECATED_EVENT_HANDLER_ERROR
EventHandler was not added as a listener.
|
static int |
WARN_DEPRECATED_FUNCTION_ERROR
Unsupported ActionScript 2.0 function.
|
static int |
WARN_DEPRECATED_PROPERTY_ERROR
Unsupported ActionScript 2.0 property.
|
static int |
WARN_DUPLICATE_ARGUMENT_NAMES
More than one argument by the same name.
|
static int |
WARN_DUPLICATE_VARIABLE_DEF
Duplicate variable definition
|
static int |
WARN_FOR_VAR_IN_CHANGES
ActionScript 3.0 iterates over an object's properties within a "
for x in target " statement in random order. |
static int |
WARN_IMPORT_HIDES_CLASS
Importing a package by the same name as the current class will hide that class identifier in this scope.
|
static int |
WARN_INSTANCEOF_CHANGES
Use of the
instanceof operator. |
static int |
WARN_INTERNAL_ERROR
Internal error in compiler.
|
static int |
WARN_LEVEL_NOT_SUPPORTED
_level is no longer supported. |
static int |
WARN_MISSING_NAMESPACE_DECL
Missing namespace declaration (e.g. variable is not defined to be
public , private , etc.). |
static int |
WARN_NEGATIVE_UINT_LITERAL
Negative value will become a large positive value when assigned to a
uint data type. |
static int |
WARN_NO_CONSTRUCTOR
Missing constructor.
|
static int |
WARN_NO_EXPLICIT_SUPER_CALL_IN_CONSTRUCTOR
The
super() statement was not called within the constructor. |
static int |
WARN_NO_TYPE_DECL
Missing type declaration.
|
static int |
WARN_NUMBER_FROM_STRING_CHANGES
In ActionScript 3.0, white space is ignored and
'' returns 0 . |
static int |
WARN_SCOPING_CHANGE_IN_THIS
Change in scoping for the
this keyword. |
static int |
WARN_SLOW_TEXTFIELD_ADDITION
Inefficient use of
+= on a TextField . |
static int |
WARN_UNLIKELY_FUNCTION_VALUE
Possible missing parentheses.
|
static int |
WARN_XML_CLASS_HAS_CHANGED
Possible usage of the ActionScript 2.0
XML class. |
Modifier and Type | Method and Description |
---|---|
void |
addActionScriptMetadata(String[] md)
Adds the list of ActionScript metadata names to the existing list of ActionScript metadata
that the compiler keeps in the SWF.
|
void |
addApplicationDomainForRuntimeSharedLibraryPath(File path,
String applicationDomainTarget)
Add application domain setting to the existing list of application domain
settings.
|
void |
addConfiguration(File file)
Adds a file to the existing list of configuration files.
|
void |
addDefineDirective(String name,
String value)
Add a global AS3 compiler configuration value and preserve existing definitions.
|
void |
addExtensionLibraries(File extension,
List<String> parameters) |
void |
addExternalLibraryPath(File[] paths)
Adds to the existing list of SWC files.
|
void |
addExterns(File[] files)
Adds a list of files to the existing list of definitions to be omitted from linking.
|
void |
addExterns(String[] definitions)
Adds a list of definitions to the existing list of definitions.
|
void |
addFontManagers(String[] classNames)
Adds font managers to the existing font manager list.
|
void |
addForceRuntimeSharedLibraryPaths(File[] paths)
Adds SWCs to the existing set of SWCs whose RSLs will be loaded at runtime.
|
void |
addIncludes(String[] definitions)
Adds a list of definitions to the existing list of definitions.
|
void |
addLibraryPath(File[] paths)
Adds a list of SWC files or directories to the default library path.
|
void |
addLocalFontPaths(String[] paths)
Adds local font paths to the existing local font path list.
|
void |
addRuntimeSharedLibraries(String[] libraries)
Adds a list of run-time shared library URLs to the existing list.
|
void |
addRuntimeSharedLibraryPath(String swc,
String[] rslUrls,
String[] policyFileUrls)
This is equivalent to using more than one
runtime-shared-library-path
option when using the mxmlc compiler. |
void |
addSourcePath(File[] paths)
Adds a list of path elements to the existing source path list.
|
void |
addTheme(File[] files)
Adds a list of CSS or SWC files to the existing list of theme files.
|
void |
allowSourcePathOverlap(boolean b)
Allows some source path directories to be subdirectories of the other.
|
void |
checkActionScriptWarning(int warningCode,
boolean b)
Enables checking of the following ActionScript warnings:
--compiler.warn-array-tostring-changes
--compiler.warn-assignment-within-conditional
--compiler.warn-bad-array-cast
--compiler.warn-bad-bool-assignment
--compiler.warn-bad-date-cast
--compiler.warn-bad-es3-type-method
--compiler.warn-bad-es3-type-prop
--compiler.warn-bad-nan-comparison
--compiler.warn-bad-null-assignment
--compiler.warn-bad-null-comparison
--compiler.warn-bad-undefined-comparison
--compiler.warn-boolean-constructor-with-no-args
--compiler.warn-changes-in-resolve
--compiler.warn-class-is-sealed
--compiler.warn-const-not-initialized
--compiler.warn-constructor-returns-value
--compiler.warn-deprecated-event-handler-error
--compiler.warn-deprecated-function-error
--compiler.warn-deprecated-property-error
--compiler.warn-duplicate-argument-names
--compiler.warn-duplicate-variable-def
--compiler.warn-for-var-in-changes
--compiler.warn-import-hides-class
--compiler.warn-instance-of-changes
--compiler.warn-internal-error
--compiler.warn-level-not-supported
--compiler.warn-missing-namespace-decl
--compiler.warn-negative-uint-literal
--compiler.warn-no-constructor
--compiler.warn-no-explicit-super-call-in-constructor
--compiler.warn-no-type-decl
--compiler.warn-number-from-string-changes
--compiler.warn-scoping-change-in-this
--compiler.warn-slow-text-field-addition
--compiler.warn-unlikely-function-value
--compiler.warn-xml-class-has-changed
|
void |
compress(boolean b)
Enables ZLIB compression on SWF file.
|
void |
enableAccessibility(boolean b)
Enables accessibility in the application.
|
void |
enableAdvancedAntiAliasing(boolean b)
Enables advanced anti-aliasing for embedded fonts, which provides greater clarity for small fonts.
|
void |
enableDebugging(boolean b,
String debugPassword)
Enables debugging in the application.
|
void |
enableDigestComputation(boolean compute)
Enable or disable the computation of a digest for the created swf library.
|
void |
enableDigestVerification(boolean verify)
Verifies the RSL loaded
has the same digest as the RSL specified when the application was compiled.
|
void |
enableFlashType(boolean b)
Deprecated.
|
void |
enableStrictChecking(boolean b)
Runs the ActionScript compiler in strict error checking mode.
|
void |
enableVerboseStacktraces(boolean b)
Generates bytecodes that include line numbers.
|
void |
includeLibraries(File[] libraries)
Includes a list of SWC files to completely include in the application.
|
void |
keepAllTypeSelectors(boolean b)
Instructs the compiler to keep a style sheet's type selector in a SWF file, even if that type
(the class) is not used in the application.
|
void |
keepCompilerGeneratedActionScript(boolean b)
Saves temporary source files that are generated during MXML compilation.
|
void |
keepConfigurationReport(boolean b)
Instructs the compiler to keep a report of the compiler configuration settings.
|
void |
keepLinkReport(boolean b)
Instructs the linker to keep a report of the content that is included in the application.
|
void |
keepSizeReport(boolean b)
Instructs the linker to keep a SWF size summary.
|
void |
optimize(boolean b)
Enables post-link optimization.
|
void |
removeUnusedRuntimeSharedLibraryPaths(boolean b)
Enables the removal of RSLs associated with libraries
that are not used by an application.
|
void |
setActionScriptFileEncoding(String encoding)
Sets the ActionScript file encoding.
|
void |
setActionScriptMetadata(String[] md)
Sets the ActionScript metadata that the compiler keeps in the SWF.
|
void |
setApplicationDomainForRuntimeSharedLibraryPath(File path,
String applicationDomainTarget)
Set the application domain of a configured RSL to override the default
settings.
|
void |
setCompatibilityVersion(int major,
int minor,
int revision)
Sets the SDK compatibility version.
|
void |
setComponentManifest(String namespaceURI,
File manifest)
Specifies a URI to associate with a manifest of components for use as MXML elements.
|
void |
setConfiguration(File file)
Loads a file containing configuration options.
|
void |
setConfiguration(String[] args)
Sets the configuration parameters.
|
void |
setContextRoot(String path)
Sets the context root path so that the compiler can replace
{context.root} tokens for
service channel endpoints. |
void |
setDefaultBackgroundColor(int color)
Sets the default background color.
|
void |
setDefaultCSS(File url)
Sets the location of the default CSS file.
|
void |
setDefaultFrameRate(int rate)
Sets the default frame rate to be used in the application.
|
void |
setDefaultScriptLimits(int maxRecursionDepth,
int maxExecutionTime)
Sets the default script execution limits (which can be overridden by root attributes).
|
void |
setDefaultSize(int width,
int height)
Sets the default application size.
|
void |
setDefineDirective(String[] names,
String[] values)
Set global AS3 compiler configuration values and clear existing definitions.
|
void |
setExtensionLibraries(Map<File,List<String>> extensions) |
void |
setExternalLibraryPath(File[] paths)
Sets the list of SWC files or directories to compile against, but to omit from linking.
|
void |
setExterns(File[] files)
Sets a list of definitions to omit from linking when building an application.
|
void |
setExterns(String[] definitions)
Sets a list of definitions to omit from linking when building an application.
|
void |
setFontLanguageRange(String language,
String range)
Sets a range to restrict the number of font glyphs embedded into the application.
|
void |
setFontManagers(String[] classNames)
Sets the font managers used by the compiler.
|
void |
setForceRuntimeSharedLibraryPaths(File[] paths)
Sets the SWCs that will have their associated RSLs loaded at runtime.
|
void |
setFrameLabel(String label,
String[] classNames)
Sets a SWF frame label with a sequence of class names that are linked onto the frame.
|
void |
setIncludes(String[] definitions)
Sets a list of definitions to always link in when building an application.
|
void |
setLibraryPath(File[] paths)
Sets a list of SWC files or directories that contain SWC files.
|
void |
setLicense(String productName,
String serialNumber)
Specifies the licenses that the compiler validates before compiling.
|
void |
setLocale(Locale locale)
Deprecated.
As of 3.0, use setLocale(String[])
|
void |
setLocale(String[] locales)
Sets the locales that the compiler uses to replace
{locale} tokens that appear in some configuration values. |
void |
setLocalFontPaths(String[] paths)
Sets the local font file paths to be searched by the compiler.
|
void |
setLocalFontSnapshot(File file)
Sets the location of the local font snapshot file.
|
void |
setMaximumCachedFonts(int size)
Sets the maximum number of embedded font faces that can be cached.
|
void |
setMaximumGlyphsPerFace(int size)
Sets the maximum number of character glyph outlines to cache for each font face.
|
void |
setRuntimeSharedLibraries(String[] libraries)
Sets a list of run-time shared library URLs to be loaded before the application starts.
|
void |
setRuntimeSharedLibraryPath(String swc,
String[] rslUrls,
String[] policyFileUrls)
Set the arguments required to use an RSL with optional failover RSLs.
|
void |
setServiceConfiguration(File file)
Sets the location of the Flex Data Services service configuration file.
|
void |
setSourcePath(File[] paths)
Sets a list of path elements that form the roots of ActionScript class hierarchies.
|
void |
setSWFMetaData(int field,
Object value)
Sets the metadata section of the application SWF.
|
void |
setSWFMetaData(String xml)
Sets the metadata section of the application SWF.
|
void |
setTargetPlayer(int major,
int minor,
int revision)
Sets the version of the Flash Player that is being targeted by the application.
|
void |
setTheme(File[] files)
Sets a list of CSS or SWC files to apply as a theme.
|
void |
setToken(String name,
String value)
Defines a token that can be used for token substitutions.
|
void |
showActionScriptWarnings(boolean b)
Runs the ActionScript compiler in a mode that detects legal but potentially incorrect code.
|
void |
showBindingWarnings(boolean b)
Toggles whether warnings generated from data binding code are displayed.
|
void |
showDeprecationWarnings(boolean b)
Toggles whether the use of deprecated APIs generates a warning.
|
void |
showShadowedDeviceFontWarnings(boolean b)
Toggles whether warnings are displayed when an embedded font name shadows
a device font name.
|
void |
showUnusedTypeSelectorWarnings(boolean b)
Toggles whether warnings generated from unused type selectors are displayed.
|
void |
useActionScript3(boolean b)
Uses the ActionScript 3 class-based object model for greater performance and better error reporting.
|
void |
useECMAScript(boolean b)
Uses the ECMAScript edition 3 prototype-based object model to allow dynamic overriding
of prototype properties.
|
void |
useHeadlessServer(boolean b)
Sets the compiler when it runs on a server without a display.
|
void |
useNetwork(boolean b)
Toggles whether the application SWF is flagged for access to network resources.
|
void |
useResourceBundleMetaData(boolean b)
Determines whether resources bundles are included in the application.
|
static final int WARN_ARRAY_TOSTRING_CHANGES
Array.toString()
format has changed.static final int WARN_ASSIGNMENT_WITHIN_CONDITIONAL
static final int WARN_BAD_ARRAY_CAST
static final int WARN_BAD_BOOLEAN_ASSIGNMENT
Boolean
value was expected.static final int WARN_BAD_DATE_CAST
Date
cast operation.static final int WARN_BAD_ES3_TYPE_METHOD
static final int WARN_BAD_ES3_TYPE_PROP
static final int WARN_BAD_NAN_COMPARISON
NaN
. Any comparison operation involving NaN
will evaluate to false
because NaN != NaN
.static final int WARN_BAD_NULL_ASSIGNMENT
null
.static final int WARN_BAD_NULL_COMPARISON
null
.static final int WARN_BAD_UNDEFINED_COMPARISON
undefined
. Only untyped variables (or variables of type *
) can be undefined
.static final int WARN_BOOLEAN_CONSTRUCTOR_WITH_NO_ARGS
Boolean()
with no arguments returns false
in ActionScript 3.0.
Boolean()
returned undefined
in ActionScript 2.0.static final int WARN_CHANGES_IN_RESOLVE
__resolve
is deprecated.static final int WARN_CLASS_IS_SEALED
Class
is sealed. It cannot have members added to it dynamically.static final int WARN_CONST_NOT_INITIALIZED
static final int WARN_CONSTRUCTOR_RETURNS_VALUE
static final int WARN_DEPRECATED_EVENT_HANDLER_ERROR
static final int WARN_DEPRECATED_FUNCTION_ERROR
static final int WARN_DEPRECATED_PROPERTY_ERROR
static final int WARN_DUPLICATE_ARGUMENT_NAMES
static final int WARN_DUPLICATE_VARIABLE_DEF
static final int WARN_FOR_VAR_IN_CHANGES
for x in target
" statement in random order.static final int WARN_IMPORT_HIDES_CLASS
static final int WARN_INSTANCEOF_CHANGES
instanceof
operator.static final int WARN_INTERNAL_ERROR
static final int WARN_LEVEL_NOT_SUPPORTED
_level
is no longer supported. For more information, see the flash.display
package.static final int WARN_MISSING_NAMESPACE_DECL
public
, private
, etc.).static final int WARN_NEGATIVE_UINT_LITERAL
uint
data type.static final int WARN_NO_CONSTRUCTOR
static final int WARN_NO_EXPLICIT_SUPER_CALL_IN_CONSTRUCTOR
super()
statement was not called within the constructor.static final int WARN_NO_TYPE_DECL
static final int WARN_NUMBER_FROM_STRING_CHANGES
''
returns 0
.
Number()
returns NaN
in ActionScript 2.0 when the parameter is ''
or contains white space.static final int WARN_SCOPING_CHANGE_IN_THIS
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.static final int WARN_SLOW_TEXTFIELD_ADDITION
+=
on a TextField
.static final int WARN_UNLIKELY_FUNCTION_VALUE
static final int WARN_XML_CLASS_HAS_CHANGED
XML
class.static final int CONTRIBUTOR
static final int CREATOR
static final int DATE
static final int DESCRIPTION
static final int TITLE
static final int LANGUAGE
static final int PUBLISHER
static final String DEFAULT_OUTPUT_DIRECTORY_TOKEN
void enableAccessibility(boolean b)
accessible
option of the mxmlc or compc compilers.
The default value is false
.
b
- Boolean value that enables or disables accessibility.void setActionScriptFileEncoding(String encoding)
actionscript-file-encoding
option of the mxmlc or compc compilers.
The default encoding is UTF-8
.
encoding
- The character encoding; for example UTF-8
or Big5
.void allowSourcePathOverlap(boolean b)
compiler.allow-source-path-overlap
option of the mxmlc or compc compilers.
In some J2EE settings, directory overlapping should be allowed; for example:
wwwroot/MyAppRoot wwwroot/WEB-INF/flex/source_path1
The default value is false
.
b
- Boolean value that allows directory overlapping.void useActionScript3(boolean b)
compiler.as3
option of the mxmlc or compc compilers.
The default value is false
.
b
- Boolean value that determines whether to use the AS3 class-based object model.void setContextRoot(String path)
{context.root}
tokens for
service channel endpoints. This is equivalent to using the compiler.context-root
option
for the mxmlc or compc compilers.
By default, this value is undefined.
path
- An instance of String.void enableDebugging(boolean b, String debugPassword)
compiler.debug
and -debug-password=true|false
options
for the mxmlc or compc compilers.
The default value debug
is false
. The default debug password is "".
b
- Boolean value that enables or disables debugging.debugPassword
- A password that is embedded in the application.void setDefaultCSS(File url)
compiler.defaults-css-url
option of the mxmlc or compc compilers.url
- An instance of java.io.File
.void useECMAScript(boolean b)
compiler.es
option for the mxmlc or compc compilers.
The default value is false
.
b
- Boolean value that enables or disables the use of the ECMAScript edition 3 prototype-based object model.void setExternalLibraryPath(File[] paths)
compiler.external-library-path
option of the
mxmlc or compc compilers.paths
- A list of paths. The File.isDirectory()
method should return
true
; File
instances should represent SWC files.void addExternalLibraryPath(File[] paths)
paths
- A list of paths. The File.isDirectory()
method should return
true
; File
instances should represent SWC files.setExternalLibraryPath(File[])
void setFontLanguageRange(String language, String range)
compiler.fonts.languages.language-range
option
for the mxmlc or compc compilers.
For example:
setFontLanguageRange("englishRange", "U+0020-U+007E");
language
- Represents the language name.range
- Defines range of glyphs.void setLocalFontSnapshot(File file)
flex2.tools.FontSnapshot
tool. This is equivalent to using the compiler.fonts.local-fonts-snapshot
option for the mxmlc or compc compilers.file
- Local font snapshot file.void setLocalFontPaths(String[] paths)
mxmlc/compc --compiler.fonts.local-font-paths
.paths
- an array of file paths.void addLocalFontPaths(String[] paths)
paths
- an array of local font file paths.setLocalFontPaths(String[])
void setFontManagers(String[] classNames)
flash.fonts.JREFontManager
.
This is equivalent to using the compiler.fonts.managers
option for the mxmlc or compc compilers.
For example:
setFontManagers("flash.fonts.BatikFontManager");
classNames
- An array of Java class names.void addFontManagers(String[] classNames)
classNames
- An array of Java class names.setFontManagers(String[])
void setMaximumCachedFonts(int size)
compiler.fonts.max-cached-fonts
option for the
mxmlc or compc compilers.
The default value is 20.
size
- An integer representing the maximum number of embedded font faces.void setMaximumGlyphsPerFace(int size)
compiler.fonts.max-glyphs-per-face
option
for the mxmlc or compc compilers.
The default value is 1000.
size
- An integer representing the maximum number of character glyph outlines to cache for each font face.void useHeadlessServer(boolean b)
compiler.headless-server
option of the mxmlc or compc compilers.b
- Boolean value that determines if the compiler is running on a server without a display.void setActionScriptMetadata(String[] md)
compiler.keep-actionscript-metadata
option of the mxmlc or compc compilers.
The default value is {Bindable, Managed, ChangeEvent, NonCommittingChangeEvent, Transient}
.
md
- An array of ActionScript metadata names.void addActionScriptMetadata(String[] md)
md
- An array of ActionScript metadata names.setActionScriptMetadata(String[])
void keepAllTypeSelectors(boolean b)
compiler.keep-all-type-selectors
option of the mxmlc or compc compilers.
The default value is false
.
b
- Boolean value.void keepCompilerGeneratedActionScript(boolean b)
compiler.keep-generated-actionscript
option of the
mxmlc and compc compilers.
The default value is false
.
b
- Boolean value.void keepLinkReport(boolean b)
Report.writeLinkReport()
method to retrieve the linker report.b
- Boolean value.void keepSizeReport(boolean b)
Report.writeSizeReport()
method to retrieve the linker report.b
- Boolean value.void keepConfigurationReport(boolean b)
Report.writeConfigurationReport()
method to retrieve the configuration report.b
- Boolean value.void includeLibraries(File[] libraries)
compiler.include-libraries
option of the mxmlc and compc compilers.libraries
- An array of File
objects. The File.isDirectory()
method should return
true
; or instances must represent SWC files.setIncludes(String[])
,
setExterns(File[])
,
setExterns(String[])
,
setExternalLibraryPath(File[])
void setLibraryPath(File[] paths)
compiler.library-path
option of the mxmlc or compc compilers.paths
- An array of File
objects. The File.isDirectory()
method should return
true
; instances must represent SWC files.void addLibraryPath(File[] paths)
paths
- An array of File
objects. The File.isDirectory()
method should return
true
; instances must represent SWC files.setLibraryPath(File[])
void setLocale(String[] locales)
{locale}
tokens that appear in some configuration values.
This is equivalent to using the compiler.locale
option of the mxmlc or compc compilers.
For example:
addSourcePath(new File[] { "locale/{locale}" }); setLocales(new String[] { "en_US" });
The compiler adds the locale/en_US
directory to the source path.
locales
- An array of Strings specifying locales.void setLocale(Locale locale)
{locale}
tokens that appear in some configuration values.
This is equivalent to using the compiler.locale
option of the mxmlc or compc compilers
to set a single locale.
For example:
addSourcePath(new File[] { "locale/{locale}" }); setLocale(Locale.US);
The compiler adds the locale/en_US
directory to the source path.
locale
- A java.util.Locale
.void setComponentManifest(String namespaceURI, File manifest)
compiler.namespaces.namespace
option of the mxmlc or compc compilers.namespaceURI
- A namespace URI.manifest
- A component manifest file (XML).void optimize(boolean b)
compiler.optimize
option of the
mxmlc or compc compilers. Application sizes are usually smaller with this option enabled.
The default value is true
.
b
- Boolean value.void compress(boolean b)
compiler.compress
option of the
mxmlc or compc compilers. Application sizes are usually smaller with this option enabled.b
- Boolean value.void setServiceConfiguration(File file)
compiler.services
option of the mxmlc and compc compilers.file
- Instance of the File
class.void showActionScriptWarnings(boolean b)
compiler.show-actionscript-warnings
option of the
mxmlc or compc compilers.
The default value is true
.
b
- Boolean value.checkActionScriptWarning(int, boolean)
void showBindingWarnings(boolean b)
compiler.show-binding-warnings
option of the mxmlc or compc compilers.
The default value is true
.
b
- Boolean value.void showDeprecationWarnings(boolean b)
compiler.show-deprecation-warnings
option of the mxmlc or compc compilers.
The default value is true
.
b
- Boolean value.void showShadowedDeviceFontWarnings(boolean b)
compiler.show-shadowed-device-font-warnings
option of the mxmlc or compc compilers.
The default value is true
.
b
- Boolean value.void showUnusedTypeSelectorWarnings(boolean b)
compiler.show-unused-type-selector-warnings
option of the mxmlc or compc
compilers.
The default value is true
.
b
- Boolean value.void setSourcePath(File[] paths)
compiler.source-path
option of the mxmlc or compc compilers.paths
- An array of java.io.File
objects. The File.isDirectory()
method
must return true
.void addSourcePath(File[] paths)
paths
- An array of java.io.File
objects. The File.isDirectory()
method must return true
.setSourcePath(File[])
void enableStrictChecking(boolean b)
compiler.strict
option of the mxmlc or compc compilers.
The default value is true
.
b
- Boolean value.void setTheme(File[] files)
compiler.theme
option of the mxmlc or compc compilers.files
- An array of java.io.File
objects.void addTheme(File[] files)
files
- An array of java.io.File
objects.setTheme(File[])
void useResourceBundleMetaData(boolean b)
compiler.use-resource-bundle-metadata
option of the mxmlc or compc compilers.
The default value is true
.
b
- Boolean value.void enableVerboseStacktraces(boolean b)
compiler.verbose-stacktraces
option of the mxmlc or compc compilers.
The default value is false
.
b
- Boolean value.void enableFlashType(boolean b)
compiler.fonts.flash-type
option for the mxmlc or compc compilers.
The default value is true
.
b
- Boolean value.void enableAdvancedAntiAliasing(boolean b)
compiler.fonts.advanced-anti-aliasing
option for the mxmlc or compc compilers.
The default value is true
.
b
- Boolean value.void checkActionScriptWarning(int warningCode, boolean b)
--compiler.warn-array-tostring-changes --compiler.warn-assignment-within-conditional --compiler.warn-bad-array-cast --compiler.warn-bad-bool-assignment --compiler.warn-bad-date-cast --compiler.warn-bad-es3-type-method --compiler.warn-bad-es3-type-prop --compiler.warn-bad-nan-comparison --compiler.warn-bad-null-assignment --compiler.warn-bad-null-comparison --compiler.warn-bad-undefined-comparison --compiler.warn-boolean-constructor-with-no-args --compiler.warn-changes-in-resolve --compiler.warn-class-is-sealed --compiler.warn-const-not-initialized --compiler.warn-constructor-returns-value --compiler.warn-deprecated-event-handler-error --compiler.warn-deprecated-function-error --compiler.warn-deprecated-property-error --compiler.warn-duplicate-argument-names --compiler.warn-duplicate-variable-def --compiler.warn-for-var-in-changes --compiler.warn-import-hides-class --compiler.warn-instance-of-changes --compiler.warn-internal-error --compiler.warn-level-not-supported --compiler.warn-missing-namespace-decl --compiler.warn-negative-uint-literal --compiler.warn-no-constructor --compiler.warn-no-explicit-super-call-in-constructor --compiler.warn-no-type-decl --compiler.warn-number-from-string-changes --compiler.warn-scoping-change-in-this --compiler.warn-slow-text-field-addition --compiler.warn-unlikely-function-value --compiler.warn-xml-class-has-changed
warningCode
- Warning code.b
- Boolean value.WARN_ARRAY_TOSTRING_CHANGES
,
WARN_ASSIGNMENT_WITHIN_CONDITIONAL
,
WARN_BAD_ARRAY_CAST
,
WARN_BAD_BOOLEAN_ASSIGNMENT
,
WARN_BAD_DATE_CAST
,
WARN_BAD_ES3_TYPE_METHOD
,
WARN_BAD_ES3_TYPE_PROP
,
WARN_BAD_NAN_COMPARISON
,
WARN_BAD_NULL_ASSIGNMENT
,
WARN_BAD_NULL_COMPARISON
,
WARN_BAD_UNDEFINED_COMPARISON
,
WARN_BOOLEAN_CONSTRUCTOR_WITH_NO_ARGS
,
WARN_CHANGES_IN_RESOLVE
,
WARN_CLASS_IS_SEALED
,
WARN_CONST_NOT_INITIALIZED
,
WARN_CONSTRUCTOR_RETURNS_VALUE
,
WARN_DEPRECATED_EVENT_HANDLER_ERROR
,
WARN_DEPRECATED_FUNCTION_ERROR
,
WARN_DEPRECATED_PROPERTY_ERROR
,
WARN_DUPLICATE_ARGUMENT_NAMES
,
WARN_DUPLICATE_VARIABLE_DEF
,
WARN_FOR_VAR_IN_CHANGES
,
WARN_IMPORT_HIDES_CLASS
,
WARN_INSTANCEOF_CHANGES
,
WARN_INTERNAL_ERROR
,
WARN_LEVEL_NOT_SUPPORTED
,
WARN_MISSING_NAMESPACE_DECL
,
WARN_NEGATIVE_UINT_LITERAL
,
WARN_NO_CONSTRUCTOR
,
WARN_NO_EXPLICIT_SUPER_CALL_IN_CONSTRUCTOR
,
WARN_NO_TYPE_DECL
,
WARN_NUMBER_FROM_STRING_CHANGES
,
WARN_SCOPING_CHANGE_IN_THIS
,
WARN_SLOW_TEXTFIELD_ADDITION
,
WARN_UNLIKELY_FUNCTION_VALUE
,
WARN_XML_CLASS_HAS_CHANGED
void setDefaultBackgroundColor(int color)
default-background-color
option of the mxmlc or compc compilers.
The default value is 0x869CA7
.
color
- An RGB value.void setDefaultFrameRate(int rate)
default-frame-rate
option of the mxmlc or compc compilers.
The default value is 24
.
rate
- Number of frames per second.void setDefaultScriptLimits(int maxRecursionDepth, int maxExecutionTime)
default-script-limits
option of the mxmlc or compc compilers.
The default maximum recursion depth is 1000
.
The default maximum execution time is 60
.
maxRecursionDepth
- Recursion depth.maxExecutionTime
- Execution time, in seconds.void setDefaultSize(int width, int height)
default-size
option of the mxmlc or compc compilers.
The default width is 500
.
The default height is 375
.
width
- The width of the application, in pixels.height
- The height of the application, in pixels.void setExterns(String[] definitions)
externs
option of the mxmlc and compc compilers.definitions
- An array of definitions (for example, classes, functions, variables, or namespaces).void addExterns(String[] definitions)
definitions
- An array of definitions (for example, classes, functions, variables, namespaces).setExterns(File[])
,
setExterns(String[])
void setConfiguration(File file)
flex-config.xml
file.
This is equivalent to using the load-config
option of the mxmlc or compc compilers.file
- An instance of the java.io.File
class.void addConfiguration(File file)
file
- An instance of the java.io.File
class.setConfiguration(File)
void setConfiguration(String[] args)
mxmlc/compc
command-line arguments.args
- mxmlc/compc
command-line argumentsvoid setExterns(File[] files)
load-externs
option of the mxmlc or compc compilers.
This option is similar to the setExterns(String[])
method. The following is an example of
the file format:
<script> <!-- use 'dep', 'pre' or 'dep' to specify a definition to be omitted from linking. --> <def id="mx.skins:ProgrammaticSkin"/> <pre id="mx.core:IFlexDisplayObject"/> <dep id="String"/> </script>
files
- An array of java.io.File
objects.setExterns(String[])
void addExterns(File[] files)
files
- An array of java.io.File
objects.setExterns(File[])
,
setExterns(String[])
void setFrameLabel(String label, String[] classNames)
frames.frame
option of the mxmlc or compc compilers.label
- A string.classNames
- An array of class names.void setIncludes(String[] definitions)
includes
option of the mxmlc or compc compilers.definitions
- An array of definitions (for example, classes, functions, variables, or namespaces).void addIncludes(String[] definitions)
definitions
- An array of definitions (for example, classes, functions, variables, or namespaces).setIncludes(String[])
void setLicense(String productName, String serialNumber)
licenses.license
option of the mxmlc or compc compilers.productName
- A string representing the product name; for example "flexbuilder3".serialNumber
- A serial number.void setSWFMetaData(int field, Object value)
metadata.contributor metadata.creator metadata.date metadata.description metadata.language metadata.localized-description metadata.localized-title metadata.publisher metadata.title
The valid fields and types of value are specified below:
CONTRIBUTOR java.lang.String CREATOR java.lang.String DATE java.util.Date DESCRIPTION java.util.MapFor example:TITLE java.util.Map LANGUAGE java.lang.String PUBLISHER java.lang.String
Map titles = new HashMap(); titles.put("EN", "Adobe Flex 2 Application"); Map descriptions = new HashMap(); descriptions.put("EN", "http://www.adobe.com/products/flex"); setSWFMetaData(Configuration.LANGUAGE, "EN"); setSWFMetaData(Configuration.TITLE, titles); setSWFMetaData(Configuration.DESCRIPTION, descriptions);
field
- One of: CONTRIBUTOR
, CREATOR
,
DATE
, DESCRIPTION
, TITLE
,
LANGUAGE
, or PUBLISHER
.value
- A String
, Date
, or
Map
object.CONTRIBUTOR
,
CREATOR
,
DATE
,
DESCRIPTION
,
TITLE
,
LANGUAGE
,
PUBLISHER
void setSWFMetaData(String xml)
raw-metadata
option of the mxmlc or compc compilers.
This option overrides anything set by the setSWFMetaData()
method.xml
- A well-formed XML fragment.setSWFMetaData(int, Object)
void setRuntimeSharedLibraries(String[] libraries)
runtime-shared-libraries
option of the mxmlc or compc compilers.libraries
- An array of java.lang.String
objects.void addRuntimeSharedLibraries(String[] libraries)
libraries
- An array of java.lang.String
objects.setRuntimeSharedLibraries(String[])
void useNetwork(boolean b)
use-network
option of the mxmlc or compc compilers.
The default value is true
.
b
- Boolean value.void setToken(String name, String value)
mxmlc +flexlib=path1 +foo=bar -var=${foo}Where
var=bar
occurs after the substitution of ${foo}
.name
- The name of the token.value
- The value of the token.void setTargetPlayer(int major, int minor, int revision)
major
- The major version. Must be greater than or equal to nine.minor
- The minor version. Must be greater than or equal to zero.revision
- The revsion must be greater than or equal to zero.void setCompatibilityVersion(int major, int minor, int revision)
major
- The major version. For this release, this value must be 2.minor
- The minor version. For this release, this value must be 0.revision
- For this release, this value must be 1.void setRuntimeSharedLibraryPath(String swc, String[] rslUrls, String[] policyFileUrls)
addRuntimeSharedLibraryPath
method.
This is equivalent to the -runtime-shared-library-path
option of the mxmlc compiler.swc
- path to the swc. The classes in the swc will be excluded from
the compiled application.rslUrls
- array of URLs. The first RSL URL in the list is the primary RSL. The
remaining RSL URLs will only be loaded if the primary RSL fails to load.policyFileUrls
- array of policy file URLs. Each entry in the rslUrls array must
have a corresponding entry in this array. A policy file may be needed in
order to allow the player to read an RSL from another domain. If
a policy file is not required, then set it to an empty string.IllegalArgumentException
- if the length of the rslUrls array is not equal to
the length of the policyFileUrls array.NullPointerException
- if any of the arguments are null.addRuntimeSharedLibraryPath(String, String[], String[])
void addRuntimeSharedLibraryPath(String swc, String[] rslUrls, String[] policyFileUrls)
runtime-shared-library-path
option when using the mxmlc compiler.swc
- path to the swc. The classes in the swc will be excluded from
the compiled application.rslUrls
- array of URLs. The first RSL URL in the list is the primary RSL. The
remaining RSL URLs will only be loaded if the primary RSL fails to load.policyFileUrls
- array of policy file URLs. Each entry in the rslUrls array must
have a corresponding entry in this array. A policy file may be needed in
order to allow the player to read an RSL from another domain. If
a policy file is not required, then set it to an empty string.IllegalArgumentException
- if the length of the rslUrls array is not equal to
the length of the policyFileUrls array.NullPointerException
- if any of the arguments is null.setRuntimeSharedLibraryPath(String, String[], String[])
void enableDigestVerification(boolean verify)
verify-digests
option in the mxmlc compiler.
The default value is true
verify
- set to true to verify
the digest of the loaded RSL matches the digest of the
expected RSL. Set to false to disable the checks during
the development process but it is highly recommend that
production applications be compiled with verify
set to true.void enableDigestComputation(boolean compute)
compiler.computDigest
in the compc
compiler.
The default value is true
compute
- set to true
to create a digest for the compiled library.void addDefineDirective(String name, String value)
-define
option.name
- The qualified name of the configuration constant, e.g. "CONFIG::debugging" or "APP::version"value
- The value of the constant, e.g. "true" or "!CONFIG::release" or "3.0"setDefineDirective(String[], String[])
void setDefineDirective(String[] names, String[] values)
names
- A list of qualified names/configuration constants, e.g. "CONFIG::debugging" or "APP::version"values
- A list of values of the constants, e.g. "true" or "!CONFIG::release" or "3.0"addDefineDirective(String, String)
void setExtensionLibraries(Map<File,List<String>> extensions)
libraries
- void removeUnusedRuntimeSharedLibraryPaths(boolean b)
remove-unused-rsls
option of the mxmlc compiler.
The default value is false
.
b
- Boolean value that enables or disables the removal.void setForceRuntimeSharedLibraryPaths(File[] paths)
removed-used-rsls
option.
This is equivalent to using the
runtime-shared-library-settings.force-rsls
option of the
mxmlc compiler.paths
- An array of File
objects. Each File
instance should represent a SWC file. May not be null.NullPointerException
- if path is null.void addForceRuntimeSharedLibraryPaths(File[] paths)
runtime-shared-library-settings.force-rsls
option of the
mxmlc compiler.paths
- An array of File
objects. Each File
instance should represent a SWC file. May not be null.NullPointerException
- if path is null.#setForcedRuntimeSharedLibraryPaths(File[])
void setApplicationDomainForRuntimeSharedLibraryPath(File path, String applicationDomainTarget)
runtime-shared-library-settings.application-domain
option of
the mxmlc compiler.path
- The File
instance represents a SWC file with RSL
linkage. The RSL associated with the SWC will have its
application domain modified as specified in the
applicationDomainTarget
parameter. Passing null
resets the application domain settings.applicationDomainTarget
- The application domain an RSL will be loaded
into. May only be null when the path
parameter is null.NullPointerException
- if applicationDomain is null and path is
not null.void addApplicationDomainForRuntimeSharedLibraryPath(File path, String applicationDomainTarget)
runtime-shared-library-settings.application-domain
option of
the mxmlc compiler.path
- The File
instance represents a SWC file with RSL
linkage. The RSL associated with the SWC will have its
application domain modified as specified in the
applicationDomainTarget
parameter. May not be
null.applicationDomainTarget
- The application domain an RSL will be
loaded into. May not be null.NullPointerException
- if any of the arguments are null.setApplicationDomainForRuntimeSharedLibraryPath(File, String)
Copyright © 2016 The Apache Software Foundation. All rights reserved.