public interface Builder
Builder interface lists the common configuration and build-cycle methods.
The Application and Library classes both implement this interface.Application,
Library| Modifier and Type | Field and Description |
|---|---|
static int |
FAIL
Application.compile() or Library.compile() failed to compile. |
static int |
LINK
Application.compile() or Library.compile() did not compile but advise
the caller to link again. |
static int |
OK
Application.compile() or Library.compile() compiled successfully. |
static int |
SKIP
Application.compile() or Library.compile() did not compile anything. |
| Modifier and Type | Method and Description |
|---|---|
long |
build(boolean incremental)
Builds the object.
|
long |
build(OutputStream out,
boolean incremental)
Builds the object.
|
void |
clean()
If you called the
setOutput() method, this method
deletes the Application or Library
file. |
Benchmark |
getBenchmark()
Gets the overall performance data for the last build.
|
Map<String,PerformanceData[]> |
getCompilerBenchmarks()
Gets the performance data for each compiler phase for the last build.
|
Configuration |
getConfiguration()
Gets the compiler options for this object.
|
Configuration |
getDefaultConfiguration()
Gets the default compiler options.
|
Logger |
getLogger()
Gets the logger for this object.
|
File |
getOutput() |
Report |
getReport()
Reports information about the current compilation.
|
void |
load(InputStream in)
Loads compilation data from a previous compilation.
|
long |
save(OutputStream out)
Saves the current compilation data.
|
void |
setApplicationCache(ApplicationCache applicationCache)
Sets the application cache to be shared by all the applications
and libraries in the current workspace.
|
void |
setConfiguration(Configuration configuration)
Sets the compiler options for this object.
|
void |
setLogger(Logger logger)
Sets the logger for this object.
|
void |
setPathResolver(PathResolver resolver)
Sets the path resolver for this object.
|
void |
setProgressMeter(ProgressMeter meter)
Sets the progress meter for this object.
|
void |
setSupportedFileExtensions(String mimeType,
String[] extensions)
Sets the custom file extensions for this object.
|
void |
setSwcCache(LibraryCache libraryCache)
Sets the library cache to be shared by all the applications and
libraries in the current project.
|
void |
stop()
Stops the compilation.
|
static final int SKIP
Application.compile() or Library.compile() did not compile anything.static final int LINK
Application.compile() or Library.compile() did not compile but advise
the caller to link again.static final int OK
Application.compile() or Library.compile() compiled successfully.static final int FAIL
Application.compile() or Library.compile() failed to compile.void setConfiguration(Configuration configuration)
getDefaultConfiguration() method to get a Configuration object.configuration - An instance of an object that implements the Configuration interface.ConfigurationConfiguration getDefaultConfiguration()
flex-config.xml
file. You can override the default values by using methods of the Configuration interface.
This method returns the default compiler options in new Configuration objects.
Configuration interface.ConfigurationConfiguration getConfiguration()
getDefaultConfiguration() method,
this method returns null if the setConfiguration() method was not called.Configuration interface.ConfigurationMap<String,PerformanceData[]> getCompilerBenchmarks()
Benchmark getBenchmark()
void setLogger(Logger logger)
logger - An object that implements the Logger interface.LoggerLogger getLogger()
null if the setLogger()
method was not called.Logger interface.Loggervoid setSupportedFileExtensions(String mimeType, String[] extensions)
setSupportedFileExtensions(flex2.compiler.util.MimeMappings.MXML, new String[] {".foo"});
This example instructs the compiler to treat files with the *.foo extension as MXML documents.
The supported MIME types are specified in the flex2.compiler.util.MimeMappings class as constants.mimeType - MIME type.extensions - An array of file extensions.void setProgressMeter(ProgressMeter meter)
meter - An object that implements the ProgressMeter interface.ProgressMetervoid setPathResolver(PathResolver resolver)
resolver - A path resolverPathResolvervoid setApplicationCache(ApplicationCache applicationCache)
applicationCache - The cache.void setSwcCache(LibraryCache libraryCache)
libraryCache - The cache.long build(boolean incremental)
throws IOException
incremental input argument is false,
this method recompiles all parts of the object. If the incremental
input argument is true,
this method compiles only the parts of the object that have changed since the last compilation.
You must call the setOutput() method before calling this method. The result is saved to the location
specified by the getOutput() method. If there is no output destination specified, this method
does nothing and returns 0.
incremental - If true, build incrementally; if false, rebuild.IOException - Thrown when an I/O error occurs during compilation.Application,
Librarylong build(OutputStream out, boolean incremental) throws IOException
incremental input argument is false,
this method recompiles all parts of the object.
If the incremental input argument is true,
this method compiles only the parts of the object that have changed since the last compilation.
This method only outputs to the specified OutputStream. For better performance, the OutputStream
should be buffered. This method does not output
to the destination specified by the setOutput() method.
out - The OutputStream.incremental - If true, build incrementally; if false, rebuild.0 if the object fails to compile.IOException - Thrown when an I/O error occurs during compilation.void stop()
void clean()
setOutput() method, this method
deletes the Application or Library
file. Calls to the build() method trigger a full
recompilation.
The clean() method does not remove compiler options or reset the output location.
void load(InputStream in) throws IOException
build() method.in - The InputStream.IOException - Thrown when an I/O error occurs while loading the compilation data.long save(OutputStream out) throws IOException
build() method.
Do not use this to create a SWF or SWC file. Use the build() method instead.
out - The OutputStream.IOException - Thrown when an I/O error occurs while saving the compilation data.Report getReport()
null
if you have not yet called the build(boolean), build(OutputStream, boolean), or
compile(boolean) methods.
The Report object includes the following information:
Application or Library.
You must call the getReport() method to get a new report after each
call to the build() method.
Report interface.File getOutput()
Copyright © 2016 The Apache Software Foundation. All rights reserved.