Class: FlashSDK::CompilerBase Abstract
- Inherits:
-
Sprout::Executable::Base
- Object
- Sprout::Executable::Base
- FlashSDK::CompilerBase
- Defined in:
- lib/flashsdk/compiler_base.rb
Overview
Instance Attribute Summary collapse
-
#fcsh_port ⇒ Object
The FCSH port to use for connections.
-
#use_fcsh ⇒ Object
Set to true in order to compile with the Flex Compiler Shell (FCSH).
Instance Method Summary collapse
-
#accessible ⇒ Object
Enables accessibility features when compiling the Flex application or SWC file.
-
#actionscript_file_encoding ⇒ Object
Sets the file encoding for ActionScript files.
-
#allow_source_path_overlap ⇒ Object
Checks if a source-path entry is a subdirectory of another source-path entry.
-
#as3 ⇒ Object
Use the ActionScript 3.0 class-based object model for greater performance and better error reporting.
-
#benchmark ⇒ Object
Prints detailed compile times to the standard output.
-
#context_root ⇒ Object
Sets the value of the contextcontext.root token in channel definitions in the flex-services.xml file.
-
#contributor ⇒ Object
Sets metadata in the resulting SWF file.
-
#creator ⇒ Object
Sets metadata in the resulting SWF file.
-
#date ⇒ Object
Sets metadata in the resulting SWF file.
-
#debug ⇒ Object
Generates a debug SWF file.
-
#debug_password ⇒ Object
Lets you engage in remote debugging sessions with the Flash IDE.
-
#default_background_color ⇒ Object
Sets the SWF background color.
-
#default_css_url ⇒ Object
Defines the location of the default style sheet.
-
#default_frame_rate ⇒ Object
Sets the application’s frame rate.
-
#default_script_limits ⇒ Object
Defines the application’s script execution limits.
-
#default_size ⇒ Object
Defines the default application size, in pixels as a String.
-
#define_conditional ⇒ Object
This parameter is normally called ‘define’ but thanks to scoping issues with Sprouts and Rake, we needed to rename it and chose: ‘define_conditional’.
-
#description ⇒ Object
Sets metadata in the resulting SWF file.
-
#dump_config ⇒ Object
Outputs the compiler options in the flex-config.xml file to the target path; for example:.
-
#el ⇒ Object
Alias for #external_library_path.
-
#es ⇒ Object
Use the ECMAScript edition 3 prototype-based object model to allow dynamic overriding of prototype properties.
-
#execute ⇒ Object
Temporary override while waiting for integration of next version! TODO: Remove this method override.
-
#external_library_path ⇒ Object
Specifies a list of SWC files or directories to exclude from linking when compiling a SWF file.
-
#externs ⇒ Object
Sets a list of symbols to exclude from linking when compiling a SWF file.
-
#file_specs ⇒ Object
Specifies source files to compile.
-
#fonts_languages_language_range ⇒ Object
Specifies the range of Unicode settings for that language.
-
#fonts_managers ⇒ Object
Defines the font manager.
-
#fonts_max_cached_fonts ⇒ Object
Sets the maximum number of fonts to keep in the server cache.
-
#fonts_max_glyphs_per_face ⇒ Object
Sets the maximum number of character glyph-outlines to keep in the server cache for each font face.
-
#frames_frame ⇒ Object
Specifies a SWF file frame label with a sequence of one or more class names that will be linked onto the frame.
-
#generate_frame_loader ⇒ Object
Toggles the generation of an IFlexBootstrap-derived loader class.
-
#headless_server ⇒ Object
Enables the headless implementation of the Flex compiler.
-
#include_libraries ⇒ Object
Links all classes inside a SWC file to the resulting application SWF file, regardless of whether or not they are used.
-
#include_path ⇒ Object
Define one or more directory paths for include processing.
-
#includes ⇒ Object
Links one or more classes to the resulting application SWF file, whether or not those classes are required at compile time.
-
#incremental ⇒ Object
Enables incremental compilation.
-
#keep_as3_metadata ⇒ Object
Keep the specified metadata in the SWF (advanced, repeatable).
-
#keep_generated_actionscript ⇒ Object
Determines whether to keep the generated ActionScript class files.
-
#l ⇒ Object
Alias to library_path.
-
#language ⇒ Object
Sets metadata in the resulting SWF file.
-
#lazy_init ⇒ Object
Enables ABC bytecode lazy initialization.
-
#library_path ⇒ Object
Links SWC files to the resulting application SWF file.
-
#license ⇒ Object
<product> <serial-number>.
-
#link_report ⇒ Object
Prints linking information to the specified output file.
-
#load_config ⇒ Object
Specifies the location of the configuration file that defines compiler options.
-
#load_externs ⇒ Object
Specifies the location of an XML file that contains .
-
#locale ⇒ Object
Specifies the locale that should be packaged in the SWF file (for example, en_EN).
-
#localized_description ⇒ Object
Sets metadata in the resulting SWF file.
-
#localized_title ⇒ Object
Sets metadata in the resulting SWF file.
-
#namespaces_namespace ⇒ Object
Specifies a namespace for the MXML file.
-
#optimize ⇒ Object
Enables the ActionScript optimizer.
-
#output ⇒ Object
Specifies the output path and filename for the resulting file.
-
#publisher ⇒ Object
Sets metadata in the resulting SWF file.
-
#raw_metadata ⇒ Object
XML text to store in the SWF metadata (overrides metadata.* configuration) (advanced).
-
#resource_bundle_list ⇒ Object
Prints a list of resource bundles to input to the compc compiler to create a resource bundle SWC file.
-
#rsl ⇒ Object
Alias for #runtime_shared_libraries.
-
#rslp ⇒ Object
Alias for #runtime_shared_library_path.
-
#runtime_shared_libraries ⇒ Object
Specifies a list of run-time shared libraries (RSLs) to use for this application.
-
#runtime_shared_library_path ⇒ Object
Setting up Runtime Shared Libraries (RSLs) is extremely complicated and usually not worth doing unless you’re using the Flex framework.
-
#services ⇒ Object
Specifies the location of the services-config.xml file.
-
#show_actionscript_warnings ⇒ Object
Shows warnings for ActionScript classes.
-
#show_binding_warnings ⇒ Object
Shows a warning when Flash Player cannot detect changes to a bound property.
-
#show_deprecation_warnings ⇒ Object
Shows deprecation warnings for Flex components.
-
#show_shadowed_device_font_warnings ⇒ Object
Shows warnings when you try to embed a font with a family name that is the same as the operating system font name.
-
#show_unused_type_selector_warnings ⇒ Object
Shows warnings when a type selector in a style sheet or <mx:Style> block is not used by any components in the application.
-
#source_path ⇒ Object
Adds directories to the source path.
-
#static_link_runtime_shared_libraries ⇒ Object
Statically link the libraries specified by the #runtime_shared_libraries option.
-
#static_rsls ⇒ Object
Alias for #static_link_runtime_shared_libraries.
-
#strict ⇒ Object
Prints undefined property and function calls; also performs compile-time type checking on assignments and options supplied to method calls.
-
#target_player ⇒ Object
Specifies the version of the player the application is targeting.
-
#theme ⇒ Object
Specifies a list of theme files to use with this application.
-
#title ⇒ Object
Sets metadata in the resulting SWF file.
-
#use_network ⇒ Object
Specifies that the current application uses network services.
-
#use_resource_bundle_metadata ⇒ Object
Enables resource bundles.
-
#verbose_stacktraces ⇒ Object
Generates source code that includes source files and line numbers.
-
#verify_digests ⇒ Object
Verifies the libraries loaded at runtime are the correct ones.
-
#warn_warning_type ⇒ Object
Enables specified warnings.
-
#warnings ⇒ Object
Enables all warnings.
Instance Attribute Details
#fcsh_port ⇒ Object
The FCSH port to use for connections. If you are building from multiple different directories, you will need to start up the FCSH servers on different ports. This can be done like:
rake fcsh:start FCSH_PORT=12322
and in another terminal:
rake fcsh mxmlc FCSH_PORT=12322
1069 1070 1071 |
# File 'lib/flashsdk/compiler_base.rb', line 1069 def fcsh_port @fcsh_port end |
#use_fcsh ⇒ Object
Set to true in order to compile with the Flex Compiler Shell (FCSH).
You can set this value directly on a single compiler instance like:
mxmlc 'bin/SomeProject.swf' do |t|
t.input = 'src/SomeProject.as'
t.use_fcsh = true
end
This value can also be set to true by sending it into Ruby as an environment variable like:
rake test USE_FCSH=true
If you always want to use FCSH, you can set this value in your .bashrc or .bash_profile like:
export USE_FCSH=true
There is also an :fcsh helper rake task that will set this value simply by executing it before your build tasks. You can do this from the terminal like:
rake fcsh test
Or:
rake fcsh debug
Or you can make it a prerequisite to any other build task like:
mxmlc 'bin/SomeProject.swf' => :fcsh do |t|
...
end
1056 1057 1058 |
# File 'lib/flashsdk/compiler_base.rb', line 1056 def use_fcsh @use_fcsh end |
Instance Method Details
#accessible ⇒ Object
Enables accessibility features when compiling the Flex application or SWC file. The default value is false.
desc "Compile the Application"
mxmlc 'bin/SomeProject.swf' do |t|
t.input = 'src/SomeProject.as'
t.source_path << 'src'
t.accessible = true
end
22 |
# File 'lib/flashsdk/compiler_base.rb', line 22 add_param :accessible, Boolean, { :hidden_value => true } |
#actionscript_file_encoding ⇒ Object
Sets the file encoding for ActionScript files.
27 |
# File 'lib/flashsdk/compiler_base.rb', line 27 add_param :actionscript_file_encoding, String |
#allow_source_path_overlap ⇒ Object
Checks if a source-path entry is a subdirectory of another source-path entry. It helps make the package names of MXML components unambiguous.
desc "Compile the Application"
mxmlc 'bin/SomeProject.swf' do |t|
t.input = 'src/SomeProject.as'
t.source_path << 'src'
t.source_path << 'src/com/foo'
t.allow_source_path_overlap = true
end
40 |
# File 'lib/flashsdk/compiler_base.rb', line 40 add_param :allow_source_path_overlap, Boolean, { :hidden_value => true } |
#as3 ⇒ Object
Use the ActionScript 3.0 class-based object model for greater performance and better error reporting. In the class-based object model, most built-in functions are implemented as fixed methods of classes.
Setting this value to false will switch the compiler into a more ECMA-compatible mode.
The default value is true. If you set this value to false, you must set the es option to true.
desc "Compile the Application"
mxmlc 'bin/SomeProject.swf' do |t|
t.input = 'src/SomeProject.as'
t.source_path << 'src'
t.as3 = false
end
56 |
# File 'lib/flashsdk/compiler_base.rb', line 56 add_param :as3, Boolean, { :default => true, :show_on_false => true, :hidden_value => false, :delimiter => '=' } |
#benchmark ⇒ Object
Prints detailed compile times to the standard output. The default value is true.
desc "Compile the Application"
mxmlc 'bin/SomeProject.swf' do |t|
t.input = 'src/SomeProject.as'
t.source_path << 'src'
t.benchmark = true
end
68 |
# File 'lib/flashsdk/compiler_base.rb', line 68 add_param :benchmark, Boolean, { :default => true, :show_on_false => true, :hidden_value => false, :delimiter => '=' } |
#context_root ⇒ Object
Sets the value of the FlashSDK::CompilerBase.contextcontext.root token in channel definitions in the flex-services.xml file. If you do not specify the value of this option, Flex uses an empty string.
73 |
# File 'lib/flashsdk/compiler_base.rb', line 73 add_param :context_root, Path |
#contributor ⇒ Object
Sets metadata in the resulting SWF file.
78 |
# File 'lib/flashsdk/compiler_base.rb', line 78 add_param :contributor, String |
#creator ⇒ Object
Sets metadata in the resulting SWF file.
83 |
# File 'lib/flashsdk/compiler_base.rb', line 83 add_param :creator, String |
#date ⇒ Object
Sets metadata in the resulting SWF file.
88 |
# File 'lib/flashsdk/compiler_base.rb', line 88 add_param :date, String |
#debug ⇒ Object
Generates a debug SWF file. This file includes line numbers and filenames of all the source files. When a run-time error occurs, the stacktrace shows these line numbers and filenames. This information is also used by the command-line debugger and the Flex Builder debugger. Enabling the debug option generates larger SWF files.
For the mxmlc compiler, the default value is false. For the compc compiler, the default value is true.
For SWC files generated with the compc compiler, set this value to true, unless the target SWC file is an RSL. In that case, set the debug option to false.
For information about the command-line debugger, see Using the Command-Line Debugger (livedocs.adobe.com/flex/2/docs/00001540.html#181846).
Flex also uses the verbose-stacktraces setting to determine whether line numbers are added to the stacktrace.
desc "Compile the Application"
mxmlc 'bin/SomeProject.swf' do |t|
t.input = 'src/SomeProject.as'
t.source_path << 'src'
t.debug = true
end
111 |
# File 'lib/flashsdk/compiler_base.rb', line 111 add_param :debug, Boolean, { :hidden_value => true } |
#debug_password ⇒ Object
Lets you engage in remote debugging sessions with the Flash IDE.
116 |
# File 'lib/flashsdk/compiler_base.rb', line 116 add_param :debug_password, String |
#default_background_color ⇒ Object
Sets the SWF background color.
If you’re using the Flex framework, the default background IMAGE is that sickly, horrendous, blue-green-grey gradient.
If you want to see the background color that you set here, you will also need to override the backgroundImage
property in your Flex Application document.
You can also set the background color (and other values) using the [Embed]
metadata directive directly in your Document Root class.
[SWF(width='400', height='300', backgroundColor='#ffffff', frameRate='30')]
To set the background color from a Rake task, use the 0x notation, as the following example shows:
desc "Compile the Application"
mxmlc 'bin/SomeProject.swf' do |t|
t.input = 'src/SomeProject.as'
t.source_path << 'src'
t.default_background_color = '0xffcc00'
end
139 |
# File 'lib/flashsdk/compiler_base.rb', line 139 add_param :default_background_color, String |
#default_css_url ⇒ Object
Defines the location of the default style sheet. Setting this option overrides the implicit use of the defaults.css style sheet in the framework.swc file.
201 |
# File 'lib/flashsdk/compiler_base.rb', line 201 add_param :default_css_url, Url |
#default_frame_rate ⇒ Object
Sets the application’s frame rate. The default value is 24.
desc "Compile the Application"
mxmlc 'bin/SomeProject.swf' do |t|
t.input = 'src/SomeProject.as'
t.source_path << 'src'
t.default_frame_rate = 24
end
151 |
# File 'lib/flashsdk/compiler_base.rb', line 151 add_param :default_frame_rate, Number |
#default_script_limits ⇒ Object
Defines the application’s script execution limits.
The max-recursion-depth value specifies the maximum depth of Adobe Flash Player call stack before Flash Player stops. This is essentially the stack overflow limit. The default value is 1000.
The max-execution-time value specifies the maximum duration, in seconds, that an ActionScript event handler can execute before Flash Player assumes that it is hung, and aborts it. The default value is 60 seconds. You cannot set this value above 60 seconds.
Example:
desc "Compile the Application"
mxmlc 'bin/SomeProject.swf' do |t|
t.input = 'src/SomeProject.as'
t.source_path << 'src'
# 900 is new max-recursion-depth
# 20 is new max-execution-time
t.default_script_limits = '900 20'
end
You can override these settings in the application.
173 |
# File 'lib/flashsdk/compiler_base.rb', line 173 add_param :default_script_limits, String |
#default_size ⇒ Object
Defines the default application size, in pixels as a String.
If you’re using the Flex 4 SDK, these values should be comma-delimited like:
desc "Compile the Application"
mxmlc 'bin/SomeProject.swf' do |t|
t.input = 'src/SomeProject.as'
t.source_path << 'src'
t.default_size = '950,550'
end
If you’re using the Flex 3 SDK, these values should be space-delimited like:
desc "Compile the Application"
mxmlc 'bin/SomeProject.swf' do |t|
t.input = 'src/SomeProject.as'
t.source_path << 'src'
t.default_size = '950 550'
end
196 |
# File 'lib/flashsdk/compiler_base.rb', line 196 add_param :default_size, String |
#define_conditional ⇒ Object
This parameter is normally called ‘define’ but thanks to scoping issues with Sprouts and Rake, we needed to rename it and chose: ‘define_conditional’.
The format of each String value is “namespace::variable_name,value”, for example, if I wanted an Environment named ‘production’ available to conditional compilation statements, I might do the following:
Define a global AS3 conditional compilation definition:
desc "Compile the Application"
mxmlc 'bin/SomeProject.swf' do |t|
t.input = 'src/SomeProject.as'
t.source_path << 'src'
t.define_conditional << 'CONFIG::environment,production'
end
Then, in any given ActionScript class, we might add the following:
public static const environent:String = CONFIG::environment
This value would be available to code at runtime where we can then branch on different environments.
We can also use IFDEF like statements to completely remove or add code based on a conditional value. This is (sadly) done with Boolean conditionals as follows:
desc "Compile the Application"
mxmlc 'bin/SomeProject.swf' do |t|
t.input = 'src/SomeProject.as'
t.source_path << 'src'
t.define_conditional << 'CONFIG::release,true'
t.define_conditional << 'CONFIG::debug,false'
end
Then, in any given ActionScript class, we might add the following:
CONFIG::release
public function getValue():String {
return value;
}
CONFIG::debug
public function getValue():String {
return value + " : " + debugInfo;
}
Note how the CONFIG:: statement precedes an ActionScript statement, but doesn’t need to enclose it brackets or anything. This can go in front of any ActionScript statement (functions, classes, variables, etc).
For more information, please read Adobe’s documentation on conditional compilation.
255 |
# File 'lib/flashsdk/compiler_base.rb', line 255 add_param :define_conditional, Strings, { :shell_name => "-define" } |
#description ⇒ Object
Sets metadata in the resulting SWF file.
desc "Compile the Application"
mxmlc 'bin/SomeProject.swf' do |t|
t.input = 'src/SomeProject.as'
t.source_path << 'src'
t.description = "This SWF was built with Project Sprouts!"
end
267 |
# File 'lib/flashsdk/compiler_base.rb', line 267 add_param :description, String |
#dump_config ⇒ Object
Outputs the compiler options in the flex-config.xml file to the target path; for example:
desc "Compile the Application"
mxmlc 'bin/SomeProject.swf' do |t|
t.input = 'src/SomeProject.as'
t.source_path << 'src'
t.dump_config = 'mxmlc-config.xml'
end
281 |
# File 'lib/flashsdk/compiler_base.rb', line 281 add_param :dump_config, File |
#el ⇒ Object
Alias for #external_library_path
338 |
# File 'lib/flashsdk/compiler_base.rb', line 338 add_param_alias :el, :external_library_path |
#es ⇒ Object
Use the ECMAScript edition 3 prototype-based object model to allow dynamic overriding of prototype properties. In the prototype-based object model, built-in functions are implemented as dynamic properties of prototype objects.
You can set the strict option to true when you use this model, but it might result in compiler errors for references to dynamic properties.
The default value is false. If you set this option to true, you must set the as3 option to false.
desc "Compile the Application"
mxmlc 'bin/SomeProject.swf' do |t|
t.input = 'src/SomeProject.as'
t.source_path << 'src'
t.es = true
t.as3 = false
end
298 |
# File 'lib/flashsdk/compiler_base.rb', line 298 add_param :es, Boolean |
#execute ⇒ Object
Temporary override while waiting for integration of next version! TODO: Remove this method override.
1074 1075 1076 1077 |
# File 'lib/flashsdk/compiler_base.rb', line 1074 def execute prepare super end |
#external_library_path ⇒ Object
Specifies a list of SWC files or directories to exclude from linking when compiling a SWF file.
This option provides compile-time link checking for external components that are dynamically linked.
desc "Compile the Application"
mxmlc 'bin/SomeProject.swf' do |t|
t.input = 'src/SomeProject.as'
t.source_path << 'src'
t.external_library_path << 'src/com/domain/project/SomeClass.as'
t.external_library_path << 'lib/somelib/'
t.external_library_path << 'lib/otherlib/OtherLibrary.swc'
end
To dynamically link against classes instead of files, folders or SWCs, see #externs.
333 |
# File 'lib/flashsdk/compiler_base.rb', line 333 add_param :external_library_path, Files |
#externs ⇒ Object
Sets a list of symbols to exclude from linking when compiling a SWF file.
This option provides compile-time link checking for external references that are dynamically linked.
desc "Compile the Application"
mxmlc 'bin/SomeProject.swf' do |t|
t.input = 'src/SomeProject.as'
t.source_path << 'src'
t.externs << 'com.somedomain.SomeClass'
t.externs << 'com.otherdomain.OtherClass'
end
To dynamically link against files, folders or SWCs instead of classes, see #external_library_path.
315 |
# File 'lib/flashsdk/compiler_base.rb', line 315 add_param :externs, Strings |
#file_specs ⇒ Object
Specifies source files to compile. This is the default option for the mxmlc compiler.
343 |
# File 'lib/flashsdk/compiler_base.rb', line 343 add_param :file_specs, Files |
#fonts_languages_language_range ⇒ Object
Specifies the range of Unicode settings for that language.
348 |
# File 'lib/flashsdk/compiler_base.rb', line 348 add_param :fonts_languages_language_range, String, { :shell_name => "-compiler.fonts.languages.language-range" } |
#fonts_managers ⇒ Object
Defines the font manager. The default is flash.fonts.JREFontManager. You can also use the flash.fonts.BatikFontManager.
353 |
# File 'lib/flashsdk/compiler_base.rb', line 353 add_param :fonts_managers, Strings, { :shell_name => "-compiler.fonts.managers" } |
#fonts_max_cached_fonts ⇒ Object
Sets the maximum number of fonts to keep in the server cache.
358 |
# File 'lib/flashsdk/compiler_base.rb', line 358 add_param :fonts_max_cached_fonts, Number, { :shell_name => "-compiler.fonts.max.cached.fonts" } |
#fonts_max_glyphs_per_face ⇒ Object
Sets the maximum number of character glyph-outlines to keep in the server cache for each font face.
363 |
# File 'lib/flashsdk/compiler_base.rb', line 363 add_param :fonts_max_glyphs_per_face, Number, { :shell_name => "-compiler.fonts.max.glyphs.per.face" } |
#frames_frame ⇒ Object
Specifies a SWF file frame label with a sequence of one or more class names that will be linked onto the frame.
desc "Compile the Application"
mxmlc 'bin/SomeProject.swf' do |t|
t.input = 'src/SomeProject.as'
t.source_path << 'src'
t.frames_frame << 'someFrameLabel SomeClass OtherClass AnotherClass'
t.frames_frame << 'anotherFrameLabel YetAnotherClass'
end
376 |
# File 'lib/flashsdk/compiler_base.rb', line 376 add_param :frames_frame, Strings, { :shell_name => '-frames.frame' } |
#generate_frame_loader ⇒ Object
Toggles the generation of an IFlexBootstrap-derived loader class.
desc "Compile the Application"
mxmlc 'bin/SomeProject.swf' do |t|
t.input = 'src/SomeProject.as'
t.source_path << 'src'
t.generate_frame_loader = false
end
-
Might be deprecated?
390 |
# File 'lib/flashsdk/compiler_base.rb', line 390 add_param :generate_frame_loader, Boolean |
#headless_server ⇒ Object
Enables the headless implementation of the Flex compiler.
This sets the following (in Java):
System.setProperty('java.awt.headless', 'true')
The headless setting (java.awt.headless=true) is required to compile SWFs that use fonts and SVG on UNIX systems that aren’t running X Windows.
403 |
# File 'lib/flashsdk/compiler_base.rb', line 403 add_param :headless_server, Boolean |
#include_libraries ⇒ Object
Links all classes inside a SWC file to the resulting application SWF file, regardless of whether or not they are used.
Contrast this option with the #library_path option that includes only those classes that are referenced at compile time.
To link one or more classes whether or not they are used and not an entire SWC file, use the #includes option.
This option is commonly used to specify resource bundles.
desc "Compile the Application"
mxmlc 'bin/SomeProject.swf' do |t|
t.input = 'src/SomeProject.as'
t.source_path << 'src'
t.include_libraries << 'lib/somelib/SomeLib.swc'
end
425 |
# File 'lib/flashsdk/compiler_base.rb', line 425 add_param :include_libraries, Files |
#include_path ⇒ Object
Define one or more directory paths for include processing. For each path that is provided, all .as and .mxml files found forward of that path will be included in the SWF regardless of whether they are referenced elsewhere.
desc "Compile the Application"
mxmlc 'bin/SomeProject.swf' do |t|
t.input = 'src/SomeProject.as'
t.source_path << 'src'
t.source_path << 'lib/somelib'
t.include_path << 'lib/somelib/com/somelib/net'
end
462 |
# File 'lib/flashsdk/compiler_base.rb', line 462 add_param :include_path, Paths |
#includes ⇒ Object
Links one or more classes to the resulting application SWF file, whether or not those classes are required at compile time.
To link an entire SWC file rather than individual classes, use the #include_libraries option.
desc "Compile the Application"
mxmlc 'bin/SomeProject.swf' do |t|
t.input = 'src/SomeProject.as'
t.source_path << 'src'
t.source_path << 'lib/somelib'
t.includes << 'com.domain.SomeClass'
end
444 |
# File 'lib/flashsdk/compiler_base.rb', line 444 add_param :includes, Strings |
#incremental ⇒ Object
Enables incremental compilation.
This option is true by default for the Flex Builder application compiler.
For the command-line compiler, the default is false.
The web-tier compiler does not support incremental compilation.
473 |
# File 'lib/flashsdk/compiler_base.rb', line 473 add_param :incremental, Boolean |
#keep_as3_metadata ⇒ Object
Keep the specified metadata in the SWF (advanced, repeatable). This parameter must be set if you attempt to define new metadata tags.
If you define metadata tags and use this parameter to include them when building a SWC, consumers of your SWC library will not also need to re-include the same metadata tags.
Following is an example Rakefile that is setting this property:
desc "Compile the Application"
mxmlc 'bin/SomeProject.swf' do |t|
t.input = 'src/SomeProject.as'
t.source_path << 'src'
t. << 'Orange'
end
There could be a class somewhere that defines this metadata tag:
[Orange(isTasty=true)]
public function eatOranges():void {
// do something
}
There would normally be another class that does some kind of reflection to perform some special operation on all entities that declare themselves as [Orange].
501 |
# File 'lib/flashsdk/compiler_base.rb', line 501 add_param :keep_as3_metadata, Strings |
#keep_generated_actionscript ⇒ Object
Determines whether to keep the generated ActionScript class files.
The generated class files include stubs and classes that are generated by the compiler and used to build the SWF file.
The default location of the files is the /generated subdirectory, which is directly below the target MXML file. If the /generated directory does not exist, the compiler creates one.
The default names of the primary generated class files are filename-generated.as and filename-interface.as.
The default value is false.
514 |
# File 'lib/flashsdk/compiler_base.rb', line 514 add_param :keep_generated_actionscript, Boolean |
#l ⇒ Object
Alias to library_path
574 |
# File 'lib/flashsdk/compiler_base.rb', line 574 add_param_alias :l, :library_path |
#language ⇒ Object
Sets metadata in the resulting SWF file.
519 |
# File 'lib/flashsdk/compiler_base.rb', line 519 add_param :language, String |
#lazy_init ⇒ Object
Enables ABC bytecode lazy initialization.
The default value is false.
526 |
# File 'lib/flashsdk/compiler_base.rb', line 526 add_param :lazy_init, Boolean |
#library_path ⇒ Object
Links SWC files to the resulting application SWF file. The compiler only links in those classes for the SWC file that are referenced from your Document Root, or another class that it references.
The default value of the #library_path option includes all SWC files in the libs directory and the current locale. These are required.
To point to individual classes or packages rather than entire SWC files, use the #source_path option.
You can use the << operator to append the new argument to the list of existing library paths:
desc "Compile the Application"
mxmlc 'bin/SomeProject.swf' do |t|
t.input = 'src/SomeProject.as'
t.library_path << 'lib/somelib/SomeLib.swc'
end
If you set the value of the library_path using the ‘=’ operator, you must set the entire Array.
You may also need to explicitly add the framework.swc and locale SWC files. Your new entry is not appended to the #library_path but replaces it. Once the value has been set, you can use the ‘<<’ operator for subsequent applications.
desc "Compile the Application"
mxmlc 'bin/SomeProject.swf' do |t|
t.input = 'src/SomeProject.as'
t.source_path << 'src'
t.library_path = ['lib/somelib/SomeLib.swc']
end
In a configuration file, you can set the append attribute of the library-path tag to true to indicate that the values should be appended to the library path rather than replace it.
569 |
# File 'lib/flashsdk/compiler_base.rb', line 569 add_param :library_path, Files |
#license ⇒ Object
<product> <serial-number>
Specifies a product and a serial number. (repeatable)
534 |
# File 'lib/flashsdk/compiler_base.rb', line 534 add_param :license, String |
#link_report ⇒ Object
Prints linking information to the specified output file. This file is an XML file that contains
<def>, <pre>, and <ext>
Symbols showing linker dependencies in the final SWF file.
The file format output by this command can be used to write a file for input to the #load_externs option.
desc "Compile the Application"
mxmlc 'bin/SomeProject.swf' do |t|
t.input = 'src/SomeProject.as'
t.source_path << 'src'
t.link_report = 'ext/link-report.xml'
end
595 |
# File 'lib/flashsdk/compiler_base.rb', line 595 add_param :link_report, String |
#load_config ⇒ Object
Specifies the location of the configuration file that defines compiler options.
If you specify a configuration file, you can still override individual options by setting them on the command line.
All relative paths in the configuration file are relative to the location of the configuration file itself.
desc "Compile the Application"
mxmlc 'bin/SomeProject.swf' do |t|
t.input = 'src/SomeProject.as'
t.source_path << 'src'
t.load_config << 'mxmlc-config.xml'
end
If you would like to see this file for your current configuration, you can set the #dump_config parameter and run your rake task.
615 |
# File 'lib/flashsdk/compiler_base.rb', line 615 add_param :load_config, Files |
#load_externs ⇒ Object
Specifies the location of an XML file that contains
<def>, <pre>, and <ext>
symbols to omit from linking when compiling a SWF file.
The XML file uses the same syntax as the one produced by the link-report option.
This option provides compile-time link checking for external components that are dynamically linked.
desc "Compile the Application"
mxmlc 'bin/SomeProject.swf' do |t|
t.input = 'src/SomeProject.as'
t.source_path << 'src'
t.load_externs = 'framework-link-report.xml'
end
The input for this parameter is often the output of another build task that is set up to emit a #link_report, for example, the previous example might be loading a #link_report from a task that looks like:
desc "Compile the Application"
compc 'bin/rsls' do |t|
t.directory = true
t.include_sources << 'lib/framework'
t.link_report = 'framework-link-report.xml'
end
647 |
# File 'lib/flashsdk/compiler_base.rb', line 647 add_param :load_externs, File |
#locale ⇒ Object
Specifies the locale that should be packaged in the SWF file (for example, en_EN).
You run the mxmlc compiler multiple times to create SWF files for more than one locale, with only the locale option changing.
You must also include the parent directory of the individual locale directories, plus the token #locale, in the source-path.
One way to do this with Rake might be as follows:
# Create a new, empty task to asseble the locale-specific
# build tasks:
desc 'Build localized SWF files'
task :build_locales
# For each supported locale, create a new build task:
['en_US', 'en_EN', 'es_ES'].each do |locale|
swf = "bin/SomeProject-#{locale}.swf"
mxmlc swf do |t|
t.input = 'src/SomeProject.as'
t.source_path << 'src'
t.source_path << "locale/#{locale}"
t.locale = locale
end
# Add the localized build task as a prerequisite
# to the aggregate task:
task :build_locales => swf
end
If the previous code was in a Rake file, you could build all localized SWFs with:
rake build_locales
You could also build a single locale with:
rake bin/SomeProject-en_US.swf
691 |
# File 'lib/flashsdk/compiler_base.rb', line 691 add_param :locale, String |
#localized_description ⇒ Object
Sets metadata in the resulting SWF file.
696 |
# File 'lib/flashsdk/compiler_base.rb', line 696 add_param :localized_description, String |
#localized_title ⇒ Object
Sets metadata in the resulting SWF file.
701 |
# File 'lib/flashsdk/compiler_base.rb', line 701 add_param :localized_title, String |
#namespaces_namespace ⇒ Object
Specifies a namespace for the MXML file. You must include a URI and the location of the manifest file that defines the contents of this namespace. This path is relative to the MXML file.
706 |
# File 'lib/flashsdk/compiler_base.rb', line 706 add_param :namespaces_namespace, String |
#optimize ⇒ Object
Enables the ActionScript optimizer. This optimizer reduces file size and increases performance by optimizing the SWF file’s bytecode, but takes slightly longer to compile. This should usually be set to true for any SWF files that are headed to production.
desc "Compile the Application"
mxmlc 'bin/SomeProject.swf' do |t|
t.input = 'src/SomeProject.as'
t.source_path << 'src'
t.optimize = true
end
721 |
# File 'lib/flashsdk/compiler_base.rb', line 721 add_param :optimize, Boolean, { :default => true, :show_on_false => true, :hidden_value => false, :delimiter => '=' } |
#output ⇒ Object
Specifies the output path and filename for the resulting file.
If you omit this option, the compiler saves the SWF file to the directory where the target file is located. The default SWF filename matches the target filename, but with a SWF file extension. When using this option with the component compiler (compc), the output is a SWC file rather than a SWF file.
The compiler creates extra directories based on the specified filename if those directories are not present.
The #mxmlc Rake task uses a Rake::File task under the covers, and will automatically set this value with the string passed into the task name.
738 |
# File 'lib/flashsdk/compiler_base.rb', line 738 add_param :output, File, { :file_task_name => true } |
#publisher ⇒ Object
Sets metadata in the resulting SWF file.
743 |
# File 'lib/flashsdk/compiler_base.rb', line 743 add_param :publisher, String |
#raw_metadata ⇒ Object
XML text to store in the SWF metadata (overrides metadata.* configuration) (advanced)
748 |
# File 'lib/flashsdk/compiler_base.rb', line 748 add_param :raw_metadata, String |
#resource_bundle_list ⇒ Object
Prints a list of resource bundles to input to the compc compiler to create a resource bundle SWC file. The filename argument is the name of the file that contains the list of bundles.
753 |
# File 'lib/flashsdk/compiler_base.rb', line 753 add_param :resource_bundle_list, File |
#rsl ⇒ Object
Alias for #runtime_shared_libraries
769 |
# File 'lib/flashsdk/compiler_base.rb', line 769 add_param_alias :rsl, :runtime_shared_libraries |
#rslp ⇒ Object
Alias for #runtime_shared_library_path
807 |
# File 'lib/flashsdk/compiler_base.rb', line 807 add_param_alias :rslp, :runtime_shared_library_path |
#runtime_shared_libraries ⇒ Object
Specifies a list of run-time shared libraries (RSLs) to use for this application. RSLs are dynamically-linked at run time.
You specify the location of the SWF file relative to the deployment location of the application. For example, if you store a file named library.swf file in the web_root/libraries directory on the web server, and the application in the web root, you specify libraries/library.swf.
764 |
# File 'lib/flashsdk/compiler_base.rb', line 764 add_param :runtime_shared_libraries, Strings |
#runtime_shared_library_path ⇒ Object
Setting up Runtime Shared Libraries (RSLs) is extremely complicated and usually not worth doing unless you’re using the Flex framework.
Following are some URLs where you might learn more about using RSLs:
-
blogs.adobe.com/rgonzalez/2006/06/modular_applications_part_2.html
-
flexscript.wordpress.com/2008/11/15/using-runtime-shared-libraries-utilizing-flash-player-cache/
If you’re not using the Flex framework, the most difficult thing you’ll need to do is set up a Preloader and figure out how to determine which urls to load the RSLs from.
If you are setting up RSLs with the Flex framework, you should be able to create a build task something like the following:
version = '4.1.0.16076'
rsls_dir = 'lib/rsls'
crossdomain = ''
host = 'http://yourdomain.com'
desc "Compile the Application"
mxmlc "bin/SomeProject.swf" do |t|
t.source_path << 'src'
t.input = 'src/SomeProject.mxml'
t.pkg_version = version
t.runtime_shared_library_path << "lib/framework_#{version}.swc,#{host}#{rsls_dir}/framework_#{version}.swz,#{crossdomain},#{host}#{rsls_dir}/framework_#{version}.swf"
t.runtime_shared_library_path << "lib/rpc_#{version}.swc,#{host}#{rsls_dir}/rpc_#{version}.swz,#{crossdomain},#{host}#{rsls_dir}/rpc_#{version}.swf"
end
802 |
# File 'lib/flashsdk/compiler_base.rb', line 802 add_param :runtime_shared_library_path, Strings |
#services ⇒ Object
Specifies the location of the services-config.xml file. This file is used by Flex Data Services.
812 |
# File 'lib/flashsdk/compiler_base.rb', line 812 add_param :services, File |
#show_actionscript_warnings ⇒ Object
Shows warnings for ActionScript classes.
The default value is true.
desc "Compile the Application"
mxmlc 'bin/SomeProject.swf' do |t|
t.input = 'src/SomeProject.as'
t.source_path << 'src'
t.show_actionscript_warnings = false
end
826 |
# File 'lib/flashsdk/compiler_base.rb', line 826 add_param :show_actionscript_warnings, Boolean, { :default => true, :show_on_false => true, :hidden_value => false, :delimiter => '=' } |
#show_binding_warnings ⇒ Object
Shows a warning when Flash Player cannot detect changes to a bound property.
The default value is true.
desc "Compile the Application"
mxmlc 'bin/SomeProject.swf' do |t|
t.input = 'src/SomeProject.mxml'
t.source_path << 'src'
t.show_binding_warnings = false
end
840 |
# File 'lib/flashsdk/compiler_base.rb', line 840 add_param :show_binding_warnings, Boolean, { :default => true, :show_on_false => true, :hidden_value => false, :delimiter => '=' } |
#show_deprecation_warnings ⇒ Object
Shows deprecation warnings for Flex components. To see warnings for ActionScript classes, use the show-actionscript-warnings option.
The default value is true.
desc "Compile the Application"
mxmlc 'bin/SomeProject.swf' do |t|
t.input = 'src/SomeProject.mxml'
t.source_path << 'src'
t.show_deprecation_warnings = false
end
883 |
# File 'lib/flashsdk/compiler_base.rb', line 883 add_param :show_deprecation_warnings, Boolean, { :default => true, :show_on_false => true } |
#show_shadowed_device_font_warnings ⇒ Object
Shows warnings when you try to embed a font with a family name that is the same as the operating system font name. The compiler normally warns you that you are shadowing a system font. Set this option to false to disable the warnings.
The default value is true.
desc "Compile the Application"
mxmlc 'bin/SomeProject.swf' do |t|
t.input = 'src/SomeProject.mxml'
t.source_path << 'src'
t.show_shadowed_device_font_warnings = false
end
855 |
# File 'lib/flashsdk/compiler_base.rb', line 855 add_param :show_shadowed_device_font_warnings, Boolean, { :default => true, :show_on_false => true, :hidden_value => false, :delimiter => '=' } |
#show_unused_type_selector_warnings ⇒ Object
Shows warnings when a type selector in a style sheet or <mx:Style> block is not used by any components in the application.
The default value is true.
desc "Compile the Application"
mxmlc 'bin/SomeProject.swf' do |t|
t.input = 'src/SomeProject.mxml'
t.source_path << 'src'
t.show_unused_type_selector_warnings = false
end
869 |
# File 'lib/flashsdk/compiler_base.rb', line 869 add_param :show_unused_type_selector_warnings, Boolean, { :default => true, :show_on_false => true, :hidden_value => false, :delimiter => '=' } |
#source_path ⇒ Object
Adds directories to the source path. The compiler searches directories in the source path for MXML or AS source files based on import statements and type references.
Only those files that have been referenced will be included in a compiled SWF or SWC file.
To add the contents of a SWC file to the entity search, use the #library_path option.
The source path is also used as the search path for the component compiler’s #includes and #resource_bundle_list options.
desc "Compile the Application"
mxmlc 'bin/SomeProject.swf' do |t|
t.input = 'src/SomeProject.mxml'
t.source_path << 'src'
t.source_path << 'lib/othersrc'
t.source_path << 'lib/anothersrc'
end
907 |
# File 'lib/flashsdk/compiler_base.rb', line 907 add_param :source_path, Paths |
#static_link_runtime_shared_libraries ⇒ Object
Statically link the libraries specified by the #runtime_shared_libraries option.
Default changed to false in Flex 4: opensource.adobe.com/wiki/display/flexsdk/Linking+RSLs+by+Default
We respect this new default.
920 |
# File 'lib/flashsdk/compiler_base.rb', line 920 add_param :static_link_runtime_shared_libraries, Boolean, { :default => false, :hidden_value => false, :delimiter => '=' } |
#static_rsls ⇒ Object
Alias for #static_link_runtime_shared_libraries
926 |
# File 'lib/flashsdk/compiler_base.rb', line 926 add_param_alias :static_rsls, :static_link_runtime_shared_libraries |
#strict ⇒ Object
Prints undefined property and function calls; also performs compile-time type checking on assignments and options supplied to method calls.
Turning of strict typing will essentially enable Duck-Typing in the Flash Player.
The default value is true.
desc "Compile the Application"
mxmlc 'bin/SomeProject.swf' do |t|
t.input = 'src/SomeProject.mxml'
t.source_path << 'src'
t.strict = false
end
942 |
# File 'lib/flashsdk/compiler_base.rb', line 942 add_param :strict, Boolean, { :default => true, :show_on_false => true, :hidden_value => false, :delimiter => '=' } |
#target_player ⇒ Object
Specifies the version of the player the application is targeting.
Features requiring a later version will not be compiled into the application. The minimum value supported is “9.0.0”.
Be aware that this value is a String.
desc "Compile the Application"
mxmlc 'bin/SomeProject.swf' do |t|
t.input = 'src/SomeProject.mxml'
t.source_path << 'src'
t.target_player = '10'
end
958 |
# File 'lib/flashsdk/compiler_base.rb', line 958 add_param :target_player, String |
#theme ⇒ Object
Specifies a list of theme files to use with this application. Theme files can be SWC files with CSS files inside them or CSS files.
For information on compiling a SWC theme file, see Using Styles and Themes (livedocs.adobe.com/flex/2/docs/00000751.html#241755) in Flex 2 Developer’s Guide.
965 |
# File 'lib/flashsdk/compiler_base.rb', line 965 add_param :theme, Files |
#title ⇒ Object
Sets metadata in the resulting SWF file.
970 |
# File 'lib/flashsdk/compiler_base.rb', line 970 add_param :title, String |
#use_network ⇒ Object
Specifies that the current application uses network services.
The default value is true.
When the use-network property is set to false, the application can access the local filesystem (for example, use the XML.load() method with file: URLs) but not network services. In most circumstances, the value of this property should be true.
982 |
# File 'lib/flashsdk/compiler_base.rb', line 982 add_param :use_network, Boolean, { :default => true, :show_on_false => true, :hidden_value => false, :delimiter => '=' } |
#use_resource_bundle_metadata ⇒ Object
Enables resource bundles. Set to true to instruct the compiler to process the contents of the [ResourceBundle] metadata tag.
The default value is true.
989 |
# File 'lib/flashsdk/compiler_base.rb', line 989 add_param :use_resource_bundle_metadata, Boolean, { :default => true, :show_on_false => true, :hidden_value => false, :delimiter => '=' } |
#verbose_stacktraces ⇒ Object
Generates source code that includes source files and line numbers. When a run-time error occurs, the stacktrace shows these line numbers.
Enabling this option generates larger SWF files.
The default value is false.
1001 |
# File 'lib/flashsdk/compiler_base.rb', line 1001 add_param :verbose_stacktraces, Boolean |
#verify_digests ⇒ Object
Verifies the libraries loaded at runtime are the correct ones.
1006 |
# File 'lib/flashsdk/compiler_base.rb', line 1006 add_param :verify_digests, Boolean |
#warn_warning_type ⇒ Object
Enables specified warnings.
1011 |
# File 'lib/flashsdk/compiler_base.rb', line 1011 add_param :warn_warning_type, Boolean |
#warnings ⇒ Object
Enables all warnings. Set to false to disable all warnings. This option overrides the warn-warning_type options.
The default value is true.
1018 |
# File 'lib/flashsdk/compiler_base.rb', line 1018 add_param :warnings, Boolean, { :default => true, :show_on_false => true, :hidden_value => false, :delimiter => '=' } |