public class Configurator extends Object implements ICompilerSettings, IConfigurator, ICompilerSettingsConstants, Cloneable
CONTRIBUTOR, CREATOR, DATE, DESCRIPTION, LANGUAGE, PUBLISHER, TITLE, WARN_ARRAY_TO_STRING_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
COMPILER_ACCESSIBLE, COMPILER_ACTIONSCRIPT_FILE_ENCODING, COMPILER_ALLOW_SOURCE_PATH_OVERLAP, COMPILER_AS3, COMPILER_COMPRESS, COMPILER_COMPUTE_DIGEST, COMPILER_CONTEXT_ROOT, COMPILER_DEBUG, COMPILER_DEFAULTS_CSS_URL, COMPILER_DEFINE, COMPILER_ES, COMPILER_EXTENSIONS, COMPILER_EXTERNAL_LIBRARY_PATH, COMPILER_HEADLESS_SERVER, COMPILER_INCLUDE_LIBRARIES, COMPILER_KEEP_ALL_TYPE_SELECTORS, COMPILER_KEEP_AS3_METADATA, COMPILER_KEEP_GENERATED_ACTIONSCRIPT, COMPILER_LIBRARY_PATH, COMPILER_LOCALE, COMPILER_MOBILE, COMPILER_MXML_COMPATIBILITY, COMPILER_NAMESPACES_NAMESPACE, COMPILER_OPTIMIZE, COMPILER_SERVICES, COMPILER_SHOW_ACTIONSCRIPT_WARNINGS, COMPILER_SHOW_BINDING_WARNINGS, COMPILER_SHOW_DEPRECATION_WARNINGS, COMPILER_SHOW_MULTIPLE_DEFINITION_WARNINGS, COMPILER_SHOW_UNUSED_TYPE_SELECTOR_WARNINGS, COMPILER_SOURCE_PATH, COMPILER_STRICT, COMPILER_THEME, COMPILER_USE_RESOURCE_BUNDLE_METADATA, COMPILER_VERBOSE_STACKTRACES, 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, DEBUG_PASSWORD, DEFAULT_BACKGROUND_COLOR, DEFAULT_FRAME_RATE, DEFAULT_SCRIPT_LIMITS, DEFAULT_SIZE, DUMP_CONFIG_VAR, EXCLUDE_NATIVE_JS_LIBRARIES, EXTERNS, FILE_SPECS_VAR, FLEX, FRAMES_FRAME, INCLUDE_CLASSES, INCLUDE_CLASSES_VAR, INCLUDE_FILE, INCLUDE_INHERITANCE_DEPENDENCIES_ONLY, INCLUDE_LOOKUP_ONLY, INCLUDE_NAMESPACES, INCLUDE_RESOURCE_BUNDLES, INCLUDE_SOURCES, INCLUDE_STYLESHEET, INCLUDES, LICENSES_LICENSE, LINK_REPORT, LOAD_CONFIG, LOAD_EXTERNS, METADATA_CONTRIBUTOR, METADATA_CREATOR, METADATA_DATE, METADATA_LANGUAGE, METADATA_LOCALIZED_DESCRIPTION, METADATA_LOCALIZED_TITLE, METADATA_PUBLISHER, OUTPUT, OUTPUT_VAR, PROJECTOR, RAW_METADATA, REMOVE_UNUSED_RSLS, RUNTIME_SHARED_LIBRARIES, RUNTIME_SHARED_LIBRARY_PATH, RUNTIME_SHARED_LIBRARY_SETTINGS_APPLICATION_DOMAIN, RUNTIME_SHARED_LIBRARY_SETTINGS_FORCE_RSLS, SIZE_REPORT, STATIC_LINK_RUNTIME_SHARED_LIBRARIES, SWF_VERSION, TARGET_PLAYER, USE_NETWORK, VERIFY_DIGESTS
Constructor and Description |
---|
Configurator()
Constructor
|
Configurator(Class<? extends Configuration> configurationClass)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addASMetadataNames(Collection<String> md)
Adds the list of AS3 metadata names to the existing list of AS3 metadata the compiler should
keep in the SWF.
|
void |
addConfiguration(File file)
Adds a file to the existing list of configuration files.
|
void |
addExtensionLibraries(File extension,
List<String> parameter) |
void |
addExternalLibraryPath(Collection<File> paths)
Adds to the existing list of SWC files.
|
void |
addExterns(Collection<String> definitions)
Adds a list of definitions to the existing list of definitions.
|
void |
addIncludeResourceBundles(Collection<String> bundles)
Adds a list of resource bundles to the existing list.
|
void |
addIncludes(Collection<String> definitions)
Adds a list of definitions to the existing list of definitions.
|
void |
addLibraryPath(Collection<File> paths)
Adds a list of SWC files or directories to the default library path.
|
void |
addLoadExterns(Collection<File> files)
Adds a list of files to the existing list of definitions to be omitted from linking.
|
void |
addLocales(Collection<String> locales)
Add to the existing list of locales without overriding and locales
settings in configuration files.
|
void |
addNamespaceMappings(Collection<IMXMLNamespaceMapping> namespaceMappings)
Adds to the existing list of namespace mappings.
|
void |
addRuntimeSharedLibraries(List<String> libraries)
Adds a list of runtime shared library URLs to the existing list.
|
void |
addRuntimeSharedLibraryPath(List<RSLSettings> rslSettings)
A list of RSLs to load, complete with all the settings on how to load
the RSLs.
|
void |
addSourcePath(Collection<File> paths)
Adds a list of path elements to the existing source path list.
|
void |
addTheme(List<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.
|
protected void |
applySourcePathRules(List<String> sourcePath)
Apply the follow source-path rules:
1.
|
boolean |
applyToProject(IFlexProject project)
Apply the current configuration settings to a given project.
|
protected void |
byPassConfigurationsRequiringFlexSDK()
By-pass the configurations that requires Flex SDK.
|
void |
checkActionScriptWarning(int warningCode,
boolean b)
Enables checking of ActionScript warnings.
|
Configurator |
clone() |
void |
compress(boolean b)
Enables ZLIB compression on SWF file.
|
protected Configuration |
createConfiguration()
Create a new configuration instance.
|
protected ConfigurationBuffer |
createConfigurationBuffer(Class<? extends Configuration> configurationClass)
Create a configuration buffer.
|
void |
enableAccessibility(boolean b)
Enables accessibility in the application.
|
void |
enableDebugging(boolean b,
String debugPassword)
Enables debugging in the application.
|
void |
enableDigestVerification(boolean verify)
Verifies the RSL loaded
has the same digest as the RSL specified when the application was compiled.
|
void |
enableIncludeLookupOnly(boolean include)
Controls whether manifest entries with lookupOnly=true are included in
the SWC catalog.
|
void |
enableStrictChecking(boolean b)
Runs the ActionScript compiler in strict error checking mode.
|
void |
enableVerboseStacktraces(boolean b)
Generates bytecodes that include line numbers.
|
ICompilerProblemSettings |
getCompilerProblemSettings()
Get the settings that control how compiler problems are reported.
|
Configuration |
getConfiguration() |
ConfigurationBuffer |
getConfigurationBuffer() |
Collection<ICompilerProblem> |
getConfigurationProblems()
Get the configuration problems.
|
Map<String,List<String>> |
getExtensions() |
List<String> |
getLoadedConfigurationFiles()
Get the list of configuration files that were loaded while processing
compiler settings.
|
List<String> |
getMissingConfigurationFiles()
Get the list of configuration files that were specified to be loaded but not found
while processing compiler settings.
|
protected String[] |
getOptions(Map<String,Object> args,
Map<String,Object> more,
String[] extras) |
static List<RSLSettings> |
getRSLSettingsFromConfiguration(Configuration configuration) |
ITargetSettings |
getTargetSettings(ITarget.TargetType targetType)
Get the settings that apply to a given type of target based on the
current state of the configuration.
|
protected void |
initializeConfiguration()
Initialize the configuration and the configuration buffer.
|
void |
keepAllTypeSelectors(boolean b)
Disables the pruning of unused type selectors.
|
boolean |
keepConfigurationReport() |
void |
keepConfigurationReport(boolean b)
Instructs the compiler to keep a report of the compiler configuration settings.
|
boolean |
keepLinkReport() |
void |
keepLinkReport(boolean b)
Instructs the linker to keep a report of the content that is included in the application.
|
boolean |
keepSizeReport() |
void |
keepSizeReport(boolean b)
Instructs the linker to keep a SWF size report.
|
protected boolean |
loadConfig()
Load configuration XML file specified in
-load-config option on
command-line. |
protected boolean |
loadConfigFromFile(ConfigurationBuffer buffer,
File fileSpec,
String context,
String rootElement,
boolean ignoreUnknownItems)
Load a configuration from file.
|
protected void |
loadDefaults(ConfigurationBuffer cfgbuf)
Load the default values into the passed in config buffer
|
protected boolean |
loadProjectConfig()
Load project specific configuration.
|
void |
optimize(boolean b)
Enables post-link optimization.
|
protected void |
overrideDefaults()
Override default values.
|
protected boolean |
processConfiguration()
Wrapper around the real processConfiguration.
|
protected boolean |
processConfiguration(String[] argsArray)
Does all the work to set the command line arguments info the
configuration object.
|
protected String[] |
processExtras(String[] extraOptions)
Do special case handling of extra arguments for Flash Builder.
|
void |
removeUnusedRuntimeSharedLibraryPaths(boolean b)
Enables the removal of RSLs associated with libraries
that are not used by an application.
|
protected void |
reportConfigurationException(ConfigurationException e)
Convert conifguration exceptions to problems and collect them for
reporting.
|
void |
reportMissingsLibraries(boolean b)
Instructs the compiler to report missing Libraries as a configuration error.
|
void |
setActionScriptFileEncoding(String encoding)
Sets the ActionScript file encoding.
|
void |
setASMetadataNames(String[] md)
Sets the AS3 metadata the compiler should keep in the SWF.
|
void |
setCompatibilityVersion(int major,
int minor,
int revision)
Sets the SDK compatibility version.
|
void |
setConfiguration(File file)
Loads a file containing configuration options.
|
void |
setConfiguration(String[] args,
String defaultVariable)
Sets the configuration parameters.
|
void |
setConfiguration(String[] args,
String defaultVariable,
boolean argsRequireDefaultVariable)
Sets the configuration parameters.
|
void |
setConfigurationPathResolver(IPathResolver pathResolver)
Set a path resolver for files used in the command line options and
configuration files.
|
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 (may be overridden by the application code).
|
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 (may be overridden by root attributes).
|
void |
setDefaultSize(int width,
int height)
Sets the default window size.
|
void |
setDefineDirectives(Map<String,String> defines)
Set global AS3 compiler configuration values and clear existing definitions.
|
void |
setExcludeNativeJSLibraries(boolean value)
Option to remove the Native JS libraries from external-library-path
and library-path as they shouldn't be any when compiling SWFs / SWCs.
|
void |
setExtensionLibraries(Map<File,List<String>> extensions)
Configures a list of many extensions mapped to a single Extension URI.
|
void |
setExternalLibraryPath(Collection<File> paths)
Sets the list of SWC files or directories to compile against but to omit from linking.
|
void |
setExterns(Collection<String> definitions)
Sets a list of definitions to omit from linking when building an application.
|
void |
setFlex(boolean value)
Option to enable or prevent various Flex compiler behaviors.
|
void |
setFrameLabel(String label,
Collection<String> classNames)
Sets a SWF frame label with a sequence of classnames that will be linked onto the frame.
|
void |
setIncludeClasses(Collection<String> classes)
Adds a class, function, variable, or namespace to the target library.
|
void |
setIncludeFiles(Map<String,File> files)
Adds a collection of files to the target library.
|
void |
setIncludeLibraries(Collection<File> libraries)
Includes a list of libraries (SWCs) to completely include in the application
This is equivalent to using
mxmlc/compc --compiler.include-libraries . |
void |
setIncludeNamespaces(Collection<String> namespaces)
Adds a collection of namespaces to include in this target library.
|
void |
setIncludeResourceBundles(Collection<String> bundles)
Sets a list of resource bundles to include in the swf.
|
void |
setIncludes(Collection<String> definitions)
Sets a list of definitions to always link in when building an application.
|
void |
setIncludeSources(Collection<File> sources)
A collection of source files or directories to add to the target library.
|
void |
setIncludeStyleSheet(Map<String,File> styleSheets)
Specifies a map of style sheets to add to the target library.
|
void |
setLibraryPath(Collection<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 has to validate before compiling.
|
void |
setLoadExterns(Collection<File> files)
Sets a list of definitions to omit from linking when building an application.
|
void |
setLocale(String[] locales)
Sets the locales that the compiler would use to replace
{locale} tokens that appear in some configuration values. |
void |
setLocales(Collection<String> locales)
Sets the locales that the compiler would use to replace
{locale} tokens that appear in some configuration values. |
void |
setMainDefinition(String name)
Set the class name of the main definition
|
void |
setNamespaceMappings(List<? extends IMXMLNamespaceMapping> namespaceMappings)
Sets the mappings from MXML namespace URI to manifest files, as specified
by -namespace options.
|
void |
setOutput(File output)
Set the output of the target.
|
void |
setRuntimeSharedLibraries(List<String> libraries)
Sets a list of runtime shared library URLs to be loaded before the application starts.
|
void |
setRuntimeSharedLibraryPath(List<RSLSettings> rslSettings)
A list of RSLs to load, complete with all the settings on how to load
the RSLs.
|
void |
setServicesXMLPath(String path,
String contextRoot)
Configure this project to use a services-config.xml file.
|
void |
setSourcePath(List<File> paths)
Sets a list of path elements that form the roots of ActionScript class hierarchies.
|
void |
setStaticLinkRuntimeSharedLibraries(boolean b)
Enable or disable runtime shared libraries in the application.
|
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(List<File> files)
Sets a list of CSS or SWC files to apply as a theme.
|
void |
setToken(String name,
String value)
Defines a token. mxmlc and compc support token substitutions.
|
protected void |
setupCompatibilityVersion(FlexProject project)
Setup
-compatibility-version level. |
protected void |
setupConfigVariables(IFlexProject project) |
protected void |
setupLocaleSettings(IFlexProject project)
Setups the locale related settings.
|
protected void |
setupNamespaces(IFlexProject project) |
protected boolean |
setupProjectLibraries(IFlexProject project)
Collect all of the different library paths and set them in the project.
|
protected void |
setupServices(FlexProject project)
Transfers configuration settings to the project.
|
protected boolean |
setupSources(IFlexProject project)
Setup the source paths.
|
protected void |
setupThemeFiles(FlexProject project)
Setup theme files.
|
void |
setWarnOnFlexOnlyOptionUsage(boolean value)
Controls if the compiler warns when "Flex only" configuration options
are used in the compiler.
|
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 |
showMultipleDefinitionWarnings(boolean b)
Toggles whether warnings generated from two code files with the same name are displayed.
|
void |
showUnusedTypeSelectorWarnings(boolean b)
Toggles whether warnings generated from unused type selectors are displayed.
|
static List<File> |
toFileList(List<String> paths)
Convert file path strings to
File objects. |
static List<File> |
toFiles(List<String> paths)
Convert file path strings to
File objects. |
static List<IFileSpecification> |
toFileSpecifications(List<String> paths,
Workspace workspace)
Resolve a list of normalized paths to
IFileSpecification objects
from the given workspace . |
static String[] |
toPaths(File[] files)
Convert
File objects to String , where each String is
the absolute file path of the file. |
String |
toString() |
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.
|
Collection<ICompilerProblem> |
validateConfiguration(String[] args,
ITarget.TargetType targetType)
Validates that the specified compiler options are syntactically correct.
|
protected void |
validateSWCConfiguration()
Do the validatation that the old COMPCConfiguration used to do.
|
protected void |
validateSWCInputs()
Basic validation of compc options.
|
public Configurator()
public Configurator(Class<? extends Configuration> configurationClass)
public static List<File> toFiles(List<String> paths)
File
objects. Null values are
discarded.paths
- List of file pathspublic static List<File> toFileList(List<String> paths)
File
objects. Null values are
discarded.paths
- List of file pathspublic static String[] toPaths(File[] files)
File
objects to String
, where each String
is
the absolute file path of the file. Null values are discarded.files
- file specificationspublic static List<IFileSpecification> toFileSpecifications(List<String> paths, Workspace workspace)
IFileSpecification
objects
from the given workspace
.paths
- A list of normalized paths.workspace
- Workspace.public List<String> getLoadedConfigurationFiles()
IConfigurator
getLoadedConfigurationFiles
in interface IConfigurator
public List<String> getMissingConfigurationFiles()
IConfigurator
getMissingConfigurationFiles
in interface IConfigurator
public boolean applyToProject(IFlexProject project)
IConfigurator
applyToProject
in interface IConfigurator
project
- The project to apply the configuration settings to.public ITargetSettings getTargetSettings(ITarget.TargetType targetType)
IConfigurator
getTargetSettings
in interface IConfigurator
public ICompilerProblemSettings getCompilerProblemSettings()
IConfigurator
getCompilerProblemSettings
in interface IConfigurator
public Collection<ICompilerProblem> validateConfiguration(String[] args, ITarget.TargetType targetType)
IConfigurator
validateConfiguration
in interface IConfigurator
args
- An array of compiler options. May not be null.targetType
- the target for which the configuration will be applied.public Collection<ICompilerProblem> getConfigurationProblems()
IConfigurator
The problems in this list contain both errors and warnings.
getConfigurationProblems
in interface IConfigurator
public void setConfigurationPathResolver(IPathResolver pathResolver)
IConfigurator
setConfigurationPathResolver
in interface IConfigurator
pathResolver
- a path resolver for configuration files.public Configuration getConfiguration()
public ConfigurationBuffer getConfigurationBuffer()
protected Configuration createConfiguration()
protected void initializeConfiguration()
protected ConfigurationBuffer createConfigurationBuffer(Class<? extends Configuration> configurationClass)
configurationClass
- The Configuration objectprotected void setupThemeFiles(FlexProject project)
protected boolean setupProjectLibraries(IFlexProject project)
Libraries are ordered highest to lowest priority:
project
- protected void setupCompatibilityVersion(FlexProject project)
-compatibility-version
level. Falcon only support Flex 3+.project
- protected void setupServices(FlexProject project)
protected boolean setupSources(IFlexProject project)
protected void applySourcePathRules(List<String> sourcePath)
sourcePath
- the source path to apply the rules to.protected void setupConfigVariables(IFlexProject project)
protected void setupNamespaces(IFlexProject project)
protected void setupLocaleSettings(IFlexProject project)
public static List<RSLSettings> getRSLSettingsFromConfiguration(Configuration configuration)
protected boolean processConfiguration()
protected boolean processConfiguration(String[] argsArray)
argsArray
- - command line argumentsprotected void loadDefaults(ConfigurationBuffer cfgbuf) throws ConfigurationException
cfgbuf
- the config buffer to set the default values inConfigurationException
protected void validateSWCConfiguration() throws ConfigurationException
ConfigurationException
protected void validateSWCInputs() throws ConfigurationException
ConfigurationException
protected void byPassConfigurationsRequiringFlexSDK() throws ConfigurationException
ConfigurationException
protected void overrideDefaults() throws ConfigurationException
ConfigurationException
protected boolean loadConfig()
-load-config
option on
command-line.protected final boolean loadConfigFromFile(ConfigurationBuffer buffer, File fileSpec, String context, String rootElement, boolean ignoreUnknownItems)
FileConfigurator.load()
is
wrapped in this method because we want to print a message after loading
using MXMLC.println(String)
.protected void reportConfigurationException(ConfigurationException e)
e
- protected boolean loadProjectConfig()
protected String[] getOptions(Map<String,Object> args, Map<String,Object> more, String[] extras)
protected String[] processExtras(String[] extraOptions) throws ConfigurationException
extraOptions
- ConfigurationException
public void enableAccessibility(boolean b)
mxmlc/compc --compiler.accessible
.By default, this is disabled.
enableAccessibility
in interface ICompilerSettings
b
- boolean valuepublic void setActionScriptFileEncoding(String encoding)
mxmlc/compc --compiler.actionscript-file-encoding
.
By default, the encoding is UTF-8
.
setActionScriptFileEncoding
in interface IWriteOnlyProjectSettings
encoding
- charactere encoding, e.g. UTF-8
, Big5
public void allowSourcePathOverlap(boolean b)
mxmlc/compc --compiler.allow-source-path-overlap
.By default, this is disabled.
In some J2EE settings, directory overlapping should be allowed. For example,
wwwroot/MyAppRoot wwwroot/WEB-INF/flex/source_path1
allowSourcePathOverlap
in interface ICompilerSettings
b
- boolean valuepublic 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.
setContextRoot
in interface ICompilerSettings
path
- An instance of String.public void enableDebugging(boolean b, String debugPassword)
mxmlc/compc --compiler.debug
and --debug-password
.
By default, debug is false
and the debug password is "".
enableDebugging
in interface ICompilerSettings
b
- boolean valuedebugPassword
- a password that is embedded in the application.public void setStaticLinkRuntimeSharedLibraries(boolean b)
mxmlc --static-link-runtime-shared-libraries
.b
- boolean valuepublic void setDefaultCSS(File url)
mxmlc/compc --compiler.defaults-css-url
.url
- an instance of java.io.File
.public void setExternalLibraryPath(Collection<File> paths)
mxmlc/compc --compiler.external-library-path
.setExternalLibraryPath
in interface ICompilerSettings
paths
- File.isDirectory()
should return true
or File
instances should represent SWC files.public void addExternalLibraryPath(Collection<File> paths)
addExternalLibraryPath
in interface ICompilerSettings
paths
- File.isDirectory()
should return true
or File
instances should represent SWC files.setExternalLibraryPath(java.util.Collection<java.io.File>)
public void setASMetadataNames(String[] md)
mxmlc --compiler.keep-as3-metadata
.
The default value is {Bindable, Managed, ChangeEvent, NonCommittingChangeEvent, Transient}
.
md
- an array of AS3 metadata namespublic void addASMetadataNames(Collection<String> md)
md
- an array of AS3 metadata namespublic void keepAllTypeSelectors(boolean b)
mxmlc/compc --compiler.keep-all-type-selectors
.
By default, it is set to false
.b
- boolean valuepublic void keepLinkReport(boolean b)
Report.writeLinkReport()
to retrieve the linker report.b
- boolean valuepublic boolean keepLinkReport()
public void keepSizeReport(boolean b)
Report.writeSizeReport()
to retrieve the size report.b
- boolean valuepublic boolean keepSizeReport()
public void keepConfigurationReport(boolean b)
Report.writeConfigurationReport()
to retrieve the configuration report.b
- boolean valuepublic boolean keepConfigurationReport()
public void reportMissingsLibraries(boolean b)
b
- boolean valuepublic void setWarnOnFlexOnlyOptionUsage(boolean value)
value
- True to enable warnings, false to disable warnings. The
default is to not warn.public void setIncludeLibraries(Collection<File> libraries)
mxmlc/compc --compiler.include-libraries
.setIncludeLibraries
in interface ICompilerSettings
libraries
- a collection of java.io.File
(File.isDirectory()
should return true
or instances must represent SWC files).public void setIncludeResourceBundles(Collection<String> bundles)
mxmlc/compc --include-resource-bundle
.setIncludeResourceBundles
in interface ICompilerSettings
bundles
- an array of java.lang.String
public void addIncludeResourceBundles(Collection<String> bundles)
bundles
- an array of java.lang.String
setIncludeResourceBundles(java.util.Collection<java.lang.String>)
public void setLibraryPath(Collection<File> paths)
mxmlc/compc --compiler.library-path
.setLibraryPath
in interface ICompilerSettings
paths
- an array of File
. File.isDirectory()
should return true
or instances must represent SWC files.public void addLibraryPath(Collection<File> paths)
paths
- an array of File
. File.isDirectory()
should return true
or instances must represent SWC files.setLibraryPath(java.util.Collection<java.io.File>)
public void setLocale(String[] locales)
{locale}
tokens that appear in some configuration values.
This is equivalent to using mxmlc/compc --compiler.locale
.
For example,
addSourcePath(new File[] { "locale/{locale}" }); addLocale(new String[] { "en_US" });The
locale/en_US
directory will be added to the source path.public void setNamespaceMappings(List<? extends IMXMLNamespaceMapping> namespaceMappings)
IWriteOnlyProjectSettings
setNamespaceMappings
in interface IWriteOnlyProjectSettings
namespaceMappings
- An array of MXMLNamespaceMapping
objects.public void addNamespaceMappings(Collection<IMXMLNamespaceMapping> namespaceMappings)
ICompilerSettings
addNamespaceMappings
in interface ICompilerSettings
public void optimize(boolean b)
mxmlc/compc --compiler.optimize
.
Application sizes are usually smaller with this option enabled.
By default, it is set to true
.optimize
in interface ICompilerSettings
b
- boolean valuepublic void compress(boolean b)
ICompilerSettings
compiler.compress
option of the
mxmlc or compc compilers. Application sizes are usually smaller with this option enabled.compress
in interface ICompilerSettings
b
- Boolean value.public void setServicesXMLPath(String path, String contextRoot)
IWriteOnlyProjectSettings
mxmlc/compc --services
and
--context-root
.
setServicesXMLPath
in interface IWriteOnlyProjectSettings
path
- an absolute path to the services-config.xml file.contextRoot
- sets the value of the {context.root} token, which is
often used in channel definitions in the services-config.xml file.public void showActionScriptWarnings(boolean b)
mxmlc/compc --compiler.show-actionscript-warnings
.
By default, it is set to true
.showActionScriptWarnings
in interface ICompilerSettings
b
- boolean valuecheckActionScriptWarning(int, boolean)
public void showBindingWarnings(boolean b)
mxmlc/compc --compiler.show-binding-warnings
.
By default, it is set to true
.showBindingWarnings
in interface ICompilerSettings
b
- boolean valuepublic void showDeprecationWarnings(boolean b)
mxmlc/compc --compiler.show-deprecation-warnings
.
By default, it is set to true
.showDeprecationWarnings
in interface ICompilerSettings
b
- boolean valuepublic void showUnusedTypeSelectorWarnings(boolean b)
mxmlc/compc --compiler.show-unused-type-selector-warnings
.
By default, it is set to true
.showUnusedTypeSelectorWarnings
in interface ICompilerSettings
b
- boolean valuepublic void showMultipleDefinitionWarnings(boolean b)
ICompilerSettings
compiler.show-multiple-definition-warnings
option of the mxmlc or compc
compilers.
The default value is true
.
showMultipleDefinitionWarnings
in interface ICompilerSettings
b
- Boolean value.public void setSourcePath(List<File> paths)
mxmlc/compc --compiler.source-path
.setSourcePath
in interface IWriteOnlyProjectSettings
paths
- an array of java.io.File
(File.isDirectory()
must return true
).public void addSourcePath(Collection<File> paths)
addSourcePath
in interface ICompilerSettings
paths
- an array of java.io.File
(File.isDirectory()
must return true
).setSourcePath(java.util.List<java.io.File>)
public void enableStrictChecking(boolean b)
mxmlc/compc --compiler.strict
.
By default, it is set to true
.enableStrictChecking
in interface ICompilerSettings
b
- boolean valuepublic void setTheme(List<File> files)
mxmlc/compc --compiler.theme
.setTheme
in interface ICompilerSettings
files
- an array of java.io.File
public void addTheme(List<File> files)
addTheme
in interface ICompilerSettings
files
- an array of java.io.File
setTheme(java.util.List<java.io.File>)
public void useResourceBundleMetaData(boolean b)
mxmlc/compc --compiler.use-resource-bundle-metadata
.
By default, it is set to true
.useResourceBundleMetaData
in interface ICompilerSettings
b
- boolean valuepublic void enableVerboseStacktraces(boolean b)
mxmlc/compc --compiler.verbose-stacktraces
.
By default, it is set to false
.b
- boolean valuepublic void removeUnusedRuntimeSharedLibraryPaths(boolean b)
remove-unused-rsls
option of the mxmlc compiler.
The default value is false
.
removeUnusedRuntimeSharedLibraryPaths
in interface ICompilerSettings
b
- Boolean value that enables or disables the removal.public 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
checkActionScriptWarning
in interface ICompilerSettings
warningCode
- warning codeb
- boolean valueICompilerSettings.WARN_ARRAY_TO_STRING_CHANGES
,
ICompilerSettings.WARN_ASSIGNMENT_WITHIN_CONDITIONAL
,
ICompilerSettings.WARN_BAD_ARRAY_CAST
,
ICompilerSettings.WARN_BAD_BOOLEAN_ASSIGNMENT
,
ICompilerSettings.WARN_BAD_DATE_CAST
,
ICompilerSettings.WARN_BAD_ES3_TYPE_METHOD
,
ICompilerSettings.WARN_BAD_ES3_TYPE_PROP
,
ICompilerSettings.WARN_BAD_NAN_COMPARISON
,
ICompilerSettings.WARN_BAD_NULL_ASSIGNMENT
,
ICompilerSettings.WARN_BAD_NULL_COMPARISON
,
ICompilerSettings.WARN_BAD_UNDEFINED_COMPARISON
,
ICompilerSettings.WARN_BOOLEAN_CONSTRUCTOR_WITH_NO_ARGS
,
ICompilerSettings.WARN_CHANGES_IN_RESOLVE
,
ICompilerSettings.WARN_CLASS_IS_SEALED
,
ICompilerSettings.WARN_CONST_NOT_INITIALIZED
,
ICompilerSettings.WARN_CONSTRUCTOR_RETURNS_VALUE
,
ICompilerSettings.WARN_DEPRECATED_EVENT_HANDLER_ERROR
,
ICompilerSettings.WARN_DEPRECATED_FUNCTION_ERROR
,
ICompilerSettings.WARN_DEPRECATED_PROPERTY_ERROR
,
ICompilerSettings.WARN_DUPLICATE_ARGUMENT_NAMES
,
ICompilerSettings.WARN_DUPLICATE_VARIABLE_DEF
,
ICompilerSettings.WARN_FOR_VAR_IN_CHANGES
,
ICompilerSettings.WARN_IMPORT_HIDES_CLASS
,
ICompilerSettings.WARN_INSTANCEOF_CHANGES
,
ICompilerSettings.WARN_INTERNAL_ERROR
,
ICompilerSettings.WARN_LEVEL_NOT_SUPPORTED
,
ICompilerSettings.WARN_MISSING_NAMESPACE_DECL
,
ICompilerSettings.WARN_NEGATIVE_UINT_LITERAL
,
ICompilerSettings.WARN_NO_CONSTRUCTOR
,
ICompilerSettings.WARN_NO_EXPLICIT_SUPER_CALL_IN_CONSTRUCTOR
,
ICompilerSettings.WARN_NO_TYPE_DECL
,
ICompilerSettings.WARN_NUMBER_FROM_STRING_CHANGES
,
ICompilerSettings.WARN_SCOPING_CHANGE_IN_THIS
,
ICompilerSettings.WARN_SLOW_TEXTFIELD_ADDITION
,
ICompilerSettings.WARN_UNLIKELY_FUNCTION_VALUE
,
ICompilerSettings.WARN_XML_CLASS_HAS_CHANGED
public void setDefaultBackgroundColor(int color)
mxmlc/compc --default-background-color
.
The default value is 0x869CA7
.color
- RGB valuepublic void setDefaultFrameRate(int rate)
mxmlc/compc --default-frame-rate
.
The default value is 24
.rate
- frames per secondpublic void setDefaultScriptLimits(int maxRecursionDepth, int maxExecutionTime)
mxmlc/compc --default-script-limits
.
The default maximum recursion depth is 1000
.
The default maximum execution time is 60
.maxRecursionDepth
- recursion depthmaxExecutionTime
- execution time in seconds.public void setDefaultSize(int width, int height)
mxmlc/compc --default-size
.
The default width is 500
.
The default height is 375
.width
- width in pixelsheight
- height in pixelspublic void setExterns(Collection<String> definitions)
mxmlc/compc --externs
.setExterns
in interface ICompilerSettings
definitions
- An array of definitions (e.g. classes, functions, variables, namespaces, etc.)public void addExterns(Collection<String> definitions)
definitions
- an array of definitions (e.g. classes, functions, variables, namespaces, etc.)setExterns(java.util.Collection<java.lang.String>)
public void setConfiguration(File file)
flex-config.xml
.
This is equivalent to using mxmlc/compc --load-config
.file
- an instance of java.io.File
public void addConfiguration(File file)
file
- a configuration filesetConfiguration(File)
public void setConfiguration(String[] args, String defaultVariable)
mxmlc/compc
command-line arguments.args
- mxmlc/compc
command-line argumentsdefaultVariable
- the default variable of the configuration.public void setConfiguration(String[] args, String defaultVariable, boolean argsRequireDefaultVariable)
mxmlc/compc
command-line arguments.
args
- mxmlc/compc
command-line argumentsdefaultVariable
- the default variable of the configuration.argsRequireDefaultVariable
- true if the default variable must be
set in order to parse the args, false otherwise.public void setLoadExterns(Collection<File> files)
mxmlc/compc --load-externs
.
This option is similar to setExterns(String[])
. 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
public void addLoadExterns(Collection<File> files)
files
- an array of java.io.File
.setLoadExterns(java.util.Collection<java.io.File>)
,
setExterns(java.util.Collection<java.lang.String>)
public void setFrameLabel(String label, Collection<String> classNames)
mxmlc/compc --frames.frame
.label
- A stringclassNames
- a collection of class namespublic void setIncludes(Collection<String> definitions)
mxmlc/compc --includes
.definitions
- an array of definitions (e.g. classes, functions, variables, namespaces, etc).public void addIncludes(Collection<String> definitions)
definitions
- an array of definitions (e.g. classes, functions, variables, namespaces, etc.)setIncludes(java.util.Collection<java.lang.String>)
public void setLicense(String productName, String serialNumber)
mxmlc/compc --licenses.license
productName
- a stringserialNumber
- a serial numberpublic void setSWFMetadata(int field, Object value)
mxmlc/compc
command-line options:
--metadata.contributor --metadata.creator --metadata.date --metadata.description --metadata.language --metadata.localized-description --metadata.localized-title --metadata.publisher --metadata.titleThe 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", "Apache Flex 4.8.0 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);
setSWFMetadata
in interface ICompilerSettings
field
- CONTRIBUTOR, CREATOR, DATE, DESCRIPTION, TITLE, LANGUAGE, PUBLISHERvalue
- String, Date or MapICompilerSettings.CONTRIBUTOR
,
ICompilerSettings.CREATOR
,
ICompilerSettings.DATE
,
ICompilerSettings.DESCRIPTION
,
ICompilerSettings.TITLE
,
ICompilerSettings.LANGUAGE
,
ICompilerSettings.PUBLISHER
public void setSWFMetadata(String xml)
mxmlc/compc --raw-metadata
.
This option overrides everything set by the setSWFMetaData
method.setSWFMetadata
in interface ICompilerSettings
xml
- a well-formed XML fragmentsetSWFMetadata(int, Object)
public void setRuntimeSharedLibraries(List<String> libraries)
mxmlc/compc --runtime-shared-libraries
.setRuntimeSharedLibraries
in interface ICompilerSettings
libraries
- an array of java.lang.String
.public void addRuntimeSharedLibraries(List<String> libraries)
libraries
- an array of java.lang.String
setRuntimeSharedLibraries(java.util.List<java.lang.String>)
public void useNetwork(boolean b)
mxmlc/compc --use-network
.
By default, it is set to true
.b
- boolean valuepublic void setToken(String name, String value)
mxmlc +flexlib=path1 +foo=bar --var=${foo}
var=bar
after the substitution of ${foo}
.setToken
in interface ICompilerSettings
name
- The name of the token.value
- The value of the token.public void setMainDefinition(String name)
name
- of the main definitionpublic void setTargetPlayer(int major, int minor, int revision)
ICompilerSettings
setTargetPlayer
in interface ICompilerSettings
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.public void setCompatibilityVersion(int major, int minor, int revision)
IWriteOnlyProjectSettings
setCompatibilityVersion
in interface IWriteOnlyProjectSettings
major
- The major version.minor
- The minor version.revision
- The revision component of the version.public void enableDigestVerification(boolean verify)
ICompilerSettings
verify-digests
option in the mxmlc compiler.
The default value is true
enableDigestVerification
in interface ICompilerSettings
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.public void setDefineDirectives(Map<String,String> defines)
IWriteOnlyProjectSettings
mxmlc/compc --define
option
once for each definition in the map.setDefineDirectives
in interface IWriteOnlyProjectSettings
defines
- A map of qualified names/configuration constants, e.g. "CONFIG::debugging" or "APP::version",
to value constants, e.g. "true" or "!CONFIG::release" or "3.0". Null clears
the existing definitions.public void setExtensionLibraries(Map<File,List<String>> extensions)
IWriteOnlyProjectSettings
setExtensionLibraries
in interface IWriteOnlyProjectSettings
extensions
- a map of extension element files to extension paths.public Configurator clone()
public void setRuntimeSharedLibraryPath(List<RSLSettings> rslSettings)
ICompilerSettings
runtime-shared-library-path
application-domain
force-rsls
rslSettings
is null, then all existing RSL settings are
removed. It will have the effect of removing the RSL related options
from the command line which will allow settings from configuration files
to be applied to the configuration.setRuntimeSharedLibraryPath
in interface ICompilerSettings
rslSettings
- A list of RSLSettings
.public void addRuntimeSharedLibraryPath(List<RSLSettings> rslSettings)
ICompilerSettings
runtime-shared-library-path+=
application-domain+=
force-rsls+=
addRuntimeSharedLibraryPath
in interface ICompilerSettings
rslSettings
- A list of RSLSettings
. May not be null.public void setLocales(Collection<String> locales)
IWriteOnlyProjectSettings
{locale}
tokens that appear in some configuration values.
This is equivalent to using mxmlc/compc --compiler.locale
.
For example,
The locale/en_US
directory will be added to the source path.setLocales
in interface IWriteOnlyProjectSettings
public void addLocales(Collection<String> locales)
ICompilerSettings
locale/en_US
directory will be added to the source path.addLocales
in interface ICompilerSettings
public void setOutput(File output)
ICompilerSettings
setOutput
in interface ICompilerSettings
output
- File that specifies the where the target should be
created.public void setIncludeClasses(Collection<String> classes)
ICompilerSettings
include-classes
option of
the compc compiler.setIncludeClasses
in interface ICompilerSettings
classes
- a collection of fully-qualified class names.public void setIncludeFiles(Map<String,File> files)
ICompilerSettings
include-file
option of the compc compiler.
Each entry in the map represents a file to include in the target
library. The key is the name of the file in the target library and the
value is the file that will be added to the library.setIncludeFiles
in interface ICompilerSettings
files
- The collection of files to be added.public void setIncludeNamespaces(Collection<String> namespaces)
ICompilerSettings
include-namespaces
option of the
compc compiler.setIncludeNamespaces
in interface ICompilerSettings
namespaces
- A collection of Strings where each String is a
namespace URI.public void setIncludeSources(Collection<File> sources)
IWriteOnlyProjectSettings
include-sources
option of the
compc
compiler.setIncludeSources
in interface IWriteOnlyProjectSettings
sources
- A collection of source files or directories.public void setIncludeStyleSheet(Map<String,File> styleSheets)
ICompilerSettings
setIncludeStyleSheet
in interface ICompilerSettings
styleSheets
- a map of names to Files to include in the target
library.public void enableIncludeLookupOnly(boolean include)
ICompilerSettings
enableIncludeLookupOnly
in interface ICompilerSettings
include
- true only manifest entries with lookupOnly=true are included in
the SWC catalog, false otherwise.public void setFlex(boolean value)
IWriteOnlyProjectSettings
setFlex
in interface IWriteOnlyProjectSettings
value
- true to turn on Flex behaviors, false otherwise.public void setExcludeNativeJSLibraries(boolean value)
IWriteOnlyProjectSettings
setExcludeNativeJSLibraries
in interface IWriteOnlyProjectSettings
value
- true to turn on the behaviors, false otherwise.Copyright © 2016 The Apache Software Foundation. All rights reserved.