flashsdk 1.0.1.pre
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +9 -0
- data/README.textile +0 -0
- data/VERSION +1 -0
- data/bin/sprout-as3 +9 -0
- data/flashsdk.gemspec +23 -0
- data/lib/flashplayer/clix_flash_player.rb +91 -0
- data/lib/flashplayer/clix_wrapper.rb +22 -0
- data/lib/flashplayer/errors.rb +12 -0
- data/lib/flashplayer/log_file.rb +95 -0
- data/lib/flashplayer/mm_config.rb +96 -0
- data/lib/flashplayer/module.rb +50 -0
- data/lib/flashplayer/specification.rb +32 -0
- data/lib/flashplayer/task.legacy.rb +293 -0
- data/lib/flashplayer/task.rb +137 -0
- data/lib/flashplayer/trust.rb +45 -0
- data/lib/flashplayer.rb +8 -0
- data/lib/flashsdk/generators/class_generator.rb +43 -0
- data/lib/flashsdk/generators/flash_helper.rb +48 -0
- data/lib/flashsdk/generators/project_generator.rb +53 -0
- data/lib/flashsdk/generators/templates/ActionScript3Class.as +9 -0
- data/lib/flashsdk/generators/templates/ActionScript3MainClass.as +11 -0
- data/lib/flashsdk/generators/templates/DefaultProjectImage.png +0 -0
- data/lib/flashsdk/generators/templates/Gemfile +6 -0
- data/lib/flashsdk/generators/templates/rakefile.rb +17 -0
- data/lib/flashsdk/module.rb +9 -0
- data/lib/flashsdk/tasks/mxmlc.rb +687 -0
- data/lib/flashsdk/tasks/mxmlc_legacy.rb +135 -0
- data/lib/flashsdk.rb +12 -0
- data/lib/flex3.rb +53 -0
- data/lib/flex4.rb +58 -0
- data/rakefile.rb +20 -0
- data/test/fixtures/mxmlc/simple/SomeFile.as +11 -0
- data/test/unit/class_generator_test.rb +50 -0
- data/test/unit/flash_helper_test.rb +27 -0
- data/test/unit/flashplayer_test.rb +56 -0
- data/test/unit/log_file_test.rb +47 -0
- data/test/unit/mm_config_test.rb +74 -0
- data/test/unit/mxmlc_test.rb +45 -0
- data/test/unit/project_generator_test.rb +53 -0
- data/test/unit/task_test.rb +93 -0
- data/test/unit/test_helper.rb +16 -0
- data/test/unit/trust_test.rb +30 -0
- metadata +145 -0
@@ -0,0 +1,687 @@
|
|
1
|
+
module FlashSDK
|
2
|
+
|
3
|
+
# The MXMLC task provides a rake front end to the Flex MXMLC command line compiler.
|
4
|
+
# This task is integrated with the LibraryTask so that if any dependencies are
|
5
|
+
# library tasks, they will be automatically added to the library_path or source_path
|
6
|
+
# depending on whether they provide a swc or sources.
|
7
|
+
#
|
8
|
+
# The entire MXMLC advanced interface has been provided here. All parameter names should be
|
9
|
+
# identical to what is available on the regular compiler except dashes have been replaced
|
10
|
+
# by underscores.
|
11
|
+
#
|
12
|
+
# The following example can be pasted in a file named 'rakefile.rb' which should be placed in
|
13
|
+
# the same folder as an ActionScript 3.0 class named 'SomeProject.as' that extends
|
14
|
+
# flash.display.Sprite.
|
15
|
+
#
|
16
|
+
# # Create a remote library dependency on the corelib swc.
|
17
|
+
# library :corelib
|
18
|
+
#
|
19
|
+
# # Alias the compilation task with one that is easier to type
|
20
|
+
# task :compile => 'SomeProject.swf'
|
21
|
+
#
|
22
|
+
# # Create an MXMLC named for the output file that it creates. This task depends on the
|
23
|
+
# # corelib library and will automatically add the corelib.swc to it's library_path
|
24
|
+
# mxmlc 'SomeProject.swf' => :corelib do |t|
|
25
|
+
# t.input = 'SomeProject.as'
|
26
|
+
# t.default_size = '800 600'
|
27
|
+
# t.default_background_color = "#FFFFFF"
|
28
|
+
# end
|
29
|
+
#
|
30
|
+
# Note: Be sure to check out the features of the Executable to learn more about gem_version and preprocessor
|
31
|
+
#
|
32
|
+
# Interface and descriptions found here:
|
33
|
+
# http://livedocs.adobe.com/flex/2/docs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00001481.html
|
34
|
+
#
|
35
|
+
class MXMLC
|
36
|
+
include Sprout::Executable
|
37
|
+
|
38
|
+
##
|
39
|
+
# Enables accessibility features when compiling the Flex application or SWC file. The default value is false.
|
40
|
+
#
|
41
|
+
add_param :accessible, Boolean, { :hidden_value => true }
|
42
|
+
|
43
|
+
##
|
44
|
+
# Sets the file encoding for ActionScript files. For more information see: http://livedocs.adobe.com/flex/2/docs/00001503.html#149244
|
45
|
+
#
|
46
|
+
add_param :actionscript_file_encoding, String
|
47
|
+
|
48
|
+
##
|
49
|
+
# Checks if a source-path entry is a subdirectory of another source-path entry. It helps make the package names of MXML components unambiguous. This is an advanced option.
|
50
|
+
#
|
51
|
+
add_param :allow_source_path_overlap, Boolean, { :hidden_value => true }
|
52
|
+
|
53
|
+
##
|
54
|
+
# 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.
|
55
|
+
#
|
56
|
+
# The default value is true. If you set this value to false, you must set the es option to true.
|
57
|
+
#
|
58
|
+
# This is an advanced option.
|
59
|
+
add_param :as3, Boolean, { :default => true, :show_on_false => true }
|
60
|
+
|
61
|
+
##
|
62
|
+
# Prints detailed compile times to the standard output. The default value is true.
|
63
|
+
#
|
64
|
+
add_param :benchmark, Boolean, { :default => true, :show_on_false => true }
|
65
|
+
|
66
|
+
##
|
67
|
+
# Sets the value of the {context.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.
|
68
|
+
#
|
69
|
+
# For more information on using the {context.root} token, see http://livedocs.adobe.com/flex/2/docs/00001446.html#205687.
|
70
|
+
#
|
71
|
+
add_param :context_root, Path
|
72
|
+
|
73
|
+
##
|
74
|
+
# Sets metadata in the resulting SWF file. For more information, see Adding metadata to SWF files (http://livedocs.adobe.com/flex/2/docs/00001502.html#145380).
|
75
|
+
#
|
76
|
+
add_param :contributor, String
|
77
|
+
|
78
|
+
##
|
79
|
+
# Sets metadata in the resulting SWF file. For more information, see Adding metadata to SWF files. (http://livedocs.adobe.com/flex/2/docs/00001502.html#145380)
|
80
|
+
#
|
81
|
+
add_param :creator, String
|
82
|
+
|
83
|
+
##
|
84
|
+
# Sets metadata in the resulting SWF file. For more information, see Adding metadata to SWF files. (http://livedocs.adobe.com/flex/2/docs/00001502.html#145380)
|
85
|
+
#
|
86
|
+
add_param :date, String
|
87
|
+
|
88
|
+
##
|
89
|
+
# 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.
|
90
|
+
#
|
91
|
+
# For the mxmlc compiler, the default value is false. For the compc compiler, the default value is true.
|
92
|
+
#
|
93
|
+
# 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.
|
94
|
+
#
|
95
|
+
# For information about the command-line debugger, see Using the Command-Line Debugger (http://livedocs.adobe.com/flex/2/docs/00001540.html#181846).
|
96
|
+
#
|
97
|
+
# Flex also uses the verbose-stacktraces setting to determine whether line numbers are added to the stacktrace.
|
98
|
+
#
|
99
|
+
add_param :debug, Boolean, { :hidden_value => true }
|
100
|
+
|
101
|
+
##
|
102
|
+
# Lets you engage in remote debugging sessions with the Flash IDE. This is an advanced option.
|
103
|
+
#
|
104
|
+
add_param :debug_password, String
|
105
|
+
|
106
|
+
##
|
107
|
+
# Sets the application's background color. You use the 0x notation to set the color, as the following example shows:
|
108
|
+
#
|
109
|
+
# -default-background-color=0xCCCCFF
|
110
|
+
#
|
111
|
+
# The default value is null. The default background of a Flex application is an image of a gray gradient. You must override this image for the value of the default-background-color option to be visible. For more information, see Editing application settings (http://livedocs.adobe.com/flex/2/docs/00001504.html#138781).
|
112
|
+
#
|
113
|
+
# This is an advanced option.
|
114
|
+
#
|
115
|
+
add_param :default_background_color, String
|
116
|
+
|
117
|
+
##
|
118
|
+
# Sets the application's frame rate. The default value is 24. This is an advanced option.
|
119
|
+
#
|
120
|
+
add_param :default_frame_rate, Number
|
121
|
+
|
122
|
+
##
|
123
|
+
# Defines the application's script execution limits.
|
124
|
+
#
|
125
|
+
# 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.
|
126
|
+
#
|
127
|
+
# 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.
|
128
|
+
#
|
129
|
+
# Example:
|
130
|
+
#
|
131
|
+
# # 900 is new max-recursion-depth
|
132
|
+
# # 20 is new max-execution-time
|
133
|
+
# t.default_script_limits = '900 20'
|
134
|
+
#
|
135
|
+
# You can override these settings in the application.
|
136
|
+
#
|
137
|
+
# This is an advanced option.
|
138
|
+
#
|
139
|
+
add_param :default_script_limits, String
|
140
|
+
|
141
|
+
##
|
142
|
+
# Defines the default application size, in pixels for example: default_size = '950 550'. This is an advanced option.
|
143
|
+
#
|
144
|
+
add_param :default_size, String, { :delimiter => ' ' }
|
145
|
+
|
146
|
+
##
|
147
|
+
# 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.
|
148
|
+
#
|
149
|
+
# For more information on the defaults.css file, see Using Styles and Themes (http://livedocs.adobe.com/flex/2/docs/00000751.html#241755) in Flex 2 Developer's Guide.
|
150
|
+
#
|
151
|
+
# This is an advanced option.
|
152
|
+
#
|
153
|
+
add_param :default_css_url, Url
|
154
|
+
|
155
|
+
##
|
156
|
+
# This parameter is normally called 'define' but thanks to scoping issues with Sprouts and Rake, we needed to rename it and chose: 'define_conditional'.
|
157
|
+
#
|
158
|
+
# Define a global AS3 conditional compilation definition, e.g. -define=CONFIG::debugging,true or -define+=CONFIG::debugging,true (to append to existing definitions in flex-config.xml) (advanced, repeatable)
|
159
|
+
#
|
160
|
+
add_param :define_conditional, Strings, { :shell_name => "-define" }
|
161
|
+
|
162
|
+
##
|
163
|
+
# Sets metadata in the resulting SWF file. For more information, see Adding metadata to SWF files (http://livedocs.adobe.com/flex/2/docs/00001502.html#145380).
|
164
|
+
#
|
165
|
+
add_param :description, String
|
166
|
+
|
167
|
+
##
|
168
|
+
# Outputs the compiler options in the flex-config.xml file to the target path; for example:
|
169
|
+
#
|
170
|
+
# mxmlc -dump-config myapp-config.xml
|
171
|
+
#
|
172
|
+
# This is an advanced option.
|
173
|
+
#
|
174
|
+
add_param :dump_config, File
|
175
|
+
|
176
|
+
##
|
177
|
+
# 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.
|
178
|
+
#
|
179
|
+
# 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.
|
180
|
+
#
|
181
|
+
# The default value is false. If you set this option to true, you must set the es3 option to false.
|
182
|
+
#
|
183
|
+
# This is an advanced option.
|
184
|
+
#
|
185
|
+
add_param :es, Boolean
|
186
|
+
|
187
|
+
##
|
188
|
+
# Sets a list of symbols to exclude from linking when compiling a SWF file.
|
189
|
+
#
|
190
|
+
# This option provides compile-time link checking for external references that are dynamically linked.
|
191
|
+
#
|
192
|
+
# For more information about dynamic linking, see About linking (http://livedocs.adobe.com/flex/2/docs/00001521.html#205852).
|
193
|
+
#
|
194
|
+
# This is an advanced option.
|
195
|
+
#
|
196
|
+
add_param :externs, Strings
|
197
|
+
|
198
|
+
##
|
199
|
+
# 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.
|
200
|
+
#
|
201
|
+
# For more information about dynamic linking, see About linking (http://livedocs.adobe.com/flex/2/docs/00001521.html#205852).
|
202
|
+
#
|
203
|
+
# You can use the += operator to append the new SWC file to the list of external libraries.
|
204
|
+
#
|
205
|
+
# This parameter has been aliased as +el+.
|
206
|
+
#
|
207
|
+
add_param :external_library_path, Files
|
208
|
+
|
209
|
+
##
|
210
|
+
# Alias for external_library_path
|
211
|
+
#
|
212
|
+
add_param_alias :el, :external_library_path
|
213
|
+
|
214
|
+
##
|
215
|
+
# Specifies source files to compile. This is the default option for the mxmlc compiler.
|
216
|
+
#
|
217
|
+
add_param :file_specs, Files
|
218
|
+
|
219
|
+
##
|
220
|
+
# Specifies the range of Unicode settings for that language. For more information, see Using Styles and Themes (http://livedocs.adobe.com/flex/2/docs/00000751.html#241755) in Flex 2 Developer's Guide.
|
221
|
+
#
|
222
|
+
# This is an advanced option.
|
223
|
+
#
|
224
|
+
add_param :fonts_languages_language_range, String, { :shell_name => "-compiler.fonts.languages.language-range" }
|
225
|
+
|
226
|
+
##
|
227
|
+
# Defines the font manager. The default is flash.fonts.JREFontManager. You can also use the flash.fonts.BatikFontManager. For more information, see Using Styles and Themes in Flex 2 Developer's Guide (http://livedocs.adobe.com/flex/2/docs/00000751.html#241755).
|
228
|
+
#
|
229
|
+
# This is an advanced option.
|
230
|
+
#
|
231
|
+
add_param :fonts_managers, Strings
|
232
|
+
|
233
|
+
##
|
234
|
+
# Sets the maximum number of fonts to keep in the server cache. For more information, see Caching fonts and glyphs (http://livedocs.adobe.com/flex/2/docs/00001469.html#208457).
|
235
|
+
#
|
236
|
+
# This is an advanced option.
|
237
|
+
#
|
238
|
+
add_param :fonts_max_cached_fonts, Number
|
239
|
+
|
240
|
+
##
|
241
|
+
# Sets the maximum number of character glyph-outlines to keep in the server cache for each font face. For more information, see Caching fonts and glyphs (http://livedocs.adobe.com/flex/2/docs/00001469.html#208457).
|
242
|
+
#
|
243
|
+
# This is an advanced option.
|
244
|
+
#
|
245
|
+
add_param :fonts_max_glyphs_per_face, Number
|
246
|
+
|
247
|
+
##
|
248
|
+
# Specifies a SWF file frame label with a sequence of class names that are linked onto the frame.
|
249
|
+
#
|
250
|
+
# For example: frames_frame = 'someLabel MyProject OtherProject FoodProject'
|
251
|
+
#
|
252
|
+
# This is an advanced option.
|
253
|
+
#
|
254
|
+
add_param :frames_frame, String, { :shell_name => '-frames.frame' }
|
255
|
+
|
256
|
+
##
|
257
|
+
# Toggles the generation of an IFlexBootstrap-derived loader class.
|
258
|
+
#
|
259
|
+
# This is an advanced option.
|
260
|
+
#
|
261
|
+
add_param :generate_frame_loader, Boolean
|
262
|
+
|
263
|
+
##
|
264
|
+
# Enables the headless implementation of the Flex compiler. This sets the following:
|
265
|
+
#
|
266
|
+
# System.setProperty('java.awt.headless', 'true')
|
267
|
+
#
|
268
|
+
# The headless setting (java.awt.headless=true) is required to use fonts and SVG on UNIX systems without X Windows.
|
269
|
+
#
|
270
|
+
# This is an advanced option.
|
271
|
+
#
|
272
|
+
add_param :headless_server, Boolean
|
273
|
+
|
274
|
+
##
|
275
|
+
# Links all classes inside a SWC file to the resulting application SWF file, regardless of whether or not they are used.
|
276
|
+
#
|
277
|
+
# Contrast this option with the library-path option that includes only those classes that are referenced at compile time.
|
278
|
+
#
|
279
|
+
# To link one or more classes whether or not they are used and not an entire SWC file, use the includes option.
|
280
|
+
#
|
281
|
+
# This option is commonly used to specify resource bundles.
|
282
|
+
#
|
283
|
+
add_param :include_libraries, Files
|
284
|
+
|
285
|
+
##
|
286
|
+
# Links one or more classes to the resulting application SWF file, whether or not those classes are required at compile time.
|
287
|
+
#
|
288
|
+
# To link an entire SWC file rather than individual classes, use the include-libraries option.
|
289
|
+
#
|
290
|
+
add_param :includes, Strings
|
291
|
+
|
292
|
+
##
|
293
|
+
# 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
|
294
|
+
# be included in the SWF regardless of whether they are imported or not.
|
295
|
+
add_param :include_path, Paths
|
296
|
+
|
297
|
+
##
|
298
|
+
# Enables incremental compilation. For more information, see About incremental compilation (http://livedocs.adobe.com/flex/2/docs/00001506.html#153980).
|
299
|
+
#
|
300
|
+
# 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.
|
301
|
+
#
|
302
|
+
add_param :incremental, Boolean
|
303
|
+
|
304
|
+
##
|
305
|
+
# Keep the specified metadata in the SWF (advanced, repeatable).
|
306
|
+
#
|
307
|
+
# Example:
|
308
|
+
#
|
309
|
+
# Rakefile:
|
310
|
+
#
|
311
|
+
# mxmlc 'bin/SomeProject.swf' do |t|
|
312
|
+
# t.keep_as3_metadata << 'Orange'
|
313
|
+
# end
|
314
|
+
#
|
315
|
+
# Source Code:
|
316
|
+
#
|
317
|
+
# [Orange(isTasty=true)]
|
318
|
+
# public function eatOranges():void {
|
319
|
+
# // do something
|
320
|
+
# }
|
321
|
+
#
|
322
|
+
add_param :keep_as3_metadata, Strings
|
323
|
+
|
324
|
+
##
|
325
|
+
# Determines whether to keep the generated ActionScript class files.
|
326
|
+
#
|
327
|
+
# The generated class files include stubs and classes that are generated by the compiler and used to build the SWF file.
|
328
|
+
#
|
329
|
+
# 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.
|
330
|
+
#
|
331
|
+
# The default names of the primary generated class files are filename-generated.as and filename-interface.as.
|
332
|
+
#
|
333
|
+
# The default value is false.\nThis is an advanced option.
|
334
|
+
#
|
335
|
+
add_param :keep_generated_actionscript, Boolean
|
336
|
+
|
337
|
+
##
|
338
|
+
# Sets metadata in the resulting SWF file. For more information, see Adding metadata to SWF files (http://livedocs.adobe.com/flex/2/docs/00001502.html#145380).
|
339
|
+
#
|
340
|
+
add_param :language, String
|
341
|
+
|
342
|
+
##
|
343
|
+
# Enables ABC bytecode lazy initialization.
|
344
|
+
#
|
345
|
+
# The default value is false.
|
346
|
+
#
|
347
|
+
# This is an advanced option.
|
348
|
+
#
|
349
|
+
add_param :lazy_init, Boolean
|
350
|
+
|
351
|
+
|
352
|
+
##
|
353
|
+
# <product> <serial-number>
|
354
|
+
#
|
355
|
+
# Specifies a product and a serial number. (repeatable)
|
356
|
+
#
|
357
|
+
# This is an advanced option.
|
358
|
+
#
|
359
|
+
add_param :license, String
|
360
|
+
|
361
|
+
##
|
362
|
+
# Links SWC files to the resulting application SWF file. The compiler only links in those classes for the SWC file that are required.
|
363
|
+
#
|
364
|
+
# The default value of the library-path option includes all SWC files in the libs directory and the current locale. These are required.
|
365
|
+
#
|
366
|
+
# To point to individual classes or packages rather than entire SWC files, use the source-path option.
|
367
|
+
#
|
368
|
+
# If you set the value of the library_path using the '=' operator, you must also explicitly add the framework.swc and
|
369
|
+
# locale SWC files. Your new entry is not appended to the library-path but replaces it.
|
370
|
+
#
|
371
|
+
# mxmlc 'bin/SomeProject.swf' do |t|
|
372
|
+
# t.input = 'src/SomeProject.as'
|
373
|
+
# t.library_path = ['lib/SomeLib.swc']
|
374
|
+
# end
|
375
|
+
#
|
376
|
+
# You can use the << operator to append the new argument to the list of existing SWC files.
|
377
|
+
#
|
378
|
+
# mxmlc 'bin/SomeProject.swf' do |t|
|
379
|
+
# t.input = 'src/SomeProject.as'
|
380
|
+
# t.library_path << 'lib/SomeLib.swc'
|
381
|
+
# end
|
382
|
+
#
|
383
|
+
# 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.
|
384
|
+
#
|
385
|
+
add_param :library_path, Files
|
386
|
+
|
387
|
+
##
|
388
|
+
# Alias to library_path
|
389
|
+
#
|
390
|
+
add_param_alias :l, :library_path
|
391
|
+
|
392
|
+
##
|
393
|
+
# Prints linking information to the specified output file.
|
394
|
+
# This file is an XML file that contains
|
395
|
+
#
|
396
|
+
# <def>, <pre>, and <ext>
|
397
|
+
#
|
398
|
+
# symbols showing linker dependencies in the final SWF file.
|
399
|
+
#
|
400
|
+
# The file format output by this command can be used to write a file for input to the load-externs option.
|
401
|
+
#
|
402
|
+
# For more information on the report, see Examining linker dependencies (http://livedocs.adobe.com/flex/2/docs/00001394.html#211202).
|
403
|
+
#
|
404
|
+
# This is an advanced option.
|
405
|
+
#
|
406
|
+
add_param :link_report, File
|
407
|
+
|
408
|
+
##
|
409
|
+
# Specifies the location of the configuration file that defines compiler options.
|
410
|
+
#
|
411
|
+
# If you specify a configuration file, you can override individual options by setting them on the command line.
|
412
|
+
#
|
413
|
+
# All relative paths in the configuration file are relative to the location of the configuration file itself.
|
414
|
+
#
|
415
|
+
# Use the += operator to chain this configuration file to other configuration files.
|
416
|
+
#
|
417
|
+
# For more information on using configuration files to provide options to the command-line compilers, see About configuration files (http://livedocs.adobe.com/flex/2/docs/00001490.html#138195).
|
418
|
+
#
|
419
|
+
add_param :load_config, Files
|
420
|
+
|
421
|
+
##
|
422
|
+
# Specifies the location of an XML file that contains
|
423
|
+
#
|
424
|
+
# <def>, <pre>, and <ext>
|
425
|
+
#
|
426
|
+
# symbols to omit from linking when compiling a SWF file.
|
427
|
+
#
|
428
|
+
# The XML file uses the same syntax as the one produced by the link-report option.
|
429
|
+
#
|
430
|
+
# For more information on the report, see Examining linker dependencies (http://livedocs.adobe.com/flex/2/docs/00001394.html#211202).
|
431
|
+
#
|
432
|
+
# This option provides compile-time link checking for external components that are dynamically linked.
|
433
|
+
#
|
434
|
+
# For more information about dynamic linking, see About linking (http://livedocs.adobe.com/flex/2/docs/00001521.html#205852).
|
435
|
+
#
|
436
|
+
# This is an advanced option.
|
437
|
+
#
|
438
|
+
add_param :load_externs, File
|
439
|
+
|
440
|
+
##
|
441
|
+
# Specifies the locale that should be packaged in the SWF file (for example, en_EN).
|
442
|
+
#
|
443
|
+
# You run the mxmlc compiler multiple times to create SWF files for more than one locale,
|
444
|
+
# with only the locale option changing.
|
445
|
+
#
|
446
|
+
# You must also include the parent directory of the individual locale directories,
|
447
|
+
# plus the token {locale}, in the source-path; for example:
|
448
|
+
#
|
449
|
+
# mxmlc -locale en_EN -source-path locale/{locale} -file-specs MainApp.mxml
|
450
|
+
#
|
451
|
+
# For more information, see Localizing Flex Applicationsin (http://livedocs.adobe.com/flex/2/docs/00000898.html#129288) Flex 2 Developer's Guide.
|
452
|
+
#
|
453
|
+
add_param :locale, String
|
454
|
+
|
455
|
+
##
|
456
|
+
# Sets metadata in the resulting SWF file. For more information, see Adding metadata to SWF files (http://livedocs.adobe.com/flex/2/docs/00001502.html#145380).
|
457
|
+
#
|
458
|
+
add_param :localized_description, String
|
459
|
+
|
460
|
+
##
|
461
|
+
# Sets metadata in the resulting SWF file. For more information, see Adding metadata to SWF files (http://livedocs.adobe.com/flex/2/docs/00001502.html#145380)."
|
462
|
+
#
|
463
|
+
add_param :localized_title, String
|
464
|
+
|
465
|
+
##
|
466
|
+
# 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.
|
467
|
+
#
|
468
|
+
# For more information about manifest files, see About manifest files (http://livedocs.adobe.com/flex/2/docs/00001519.html#134676).
|
469
|
+
#
|
470
|
+
add_param :namespaces_namespace, String
|
471
|
+
|
472
|
+
##
|
473
|
+
# Enables the ActionScript optimizer. This optimizer reduces file size and increases performance by optimizing the SWF file's bytecode.
|
474
|
+
#
|
475
|
+
# The default value is false.
|
476
|
+
#
|
477
|
+
add_param :optimize, Boolean
|
478
|
+
|
479
|
+
##
|
480
|
+
# 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.
|
481
|
+
#
|
482
|
+
# The default SWF filename matches the target filename, but with a SWF file extension.
|
483
|
+
#
|
484
|
+
# If you use a relative path to define the filename, it is always relative to the current working directory, not the target MXML application root.
|
485
|
+
#
|
486
|
+
# The compiler creates extra directories based on the specified filename if those directories are not present.
|
487
|
+
#
|
488
|
+
# When using this option with the component compiler, the output is a SWC file rather than a SWF file.
|
489
|
+
#
|
490
|
+
add_param :output, File, { :file_task_name => true }
|
491
|
+
|
492
|
+
##
|
493
|
+
# Sets metadata in the resulting SWF file. For more information, see Adding metadata to SWF files (http://livedocs.adobe.com/flex/2/docs/00001502.html#145380).
|
494
|
+
#
|
495
|
+
add_param :publisher, String
|
496
|
+
|
497
|
+
##
|
498
|
+
# XML text to store in the SWF metadata (overrides metadata.* configuration) (advanced)
|
499
|
+
#
|
500
|
+
add_param :raw_metadata, String
|
501
|
+
|
502
|
+
##
|
503
|
+
# 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.
|
504
|
+
#
|
505
|
+
# For more information, see Localizing Flex Applications (http://livedocs.adobe.com/flex/2/docs/00000898.html#129288) in Flex 2 Developer's Guide.
|
506
|
+
#
|
507
|
+
add_param :resource_bundle_list, File
|
508
|
+
|
509
|
+
##
|
510
|
+
# Specifies a list of run-time shared libraries (RSLs) to use for this application. RSLs are dynamically-linked at run time.
|
511
|
+
#
|
512
|
+
# 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.
|
513
|
+
#
|
514
|
+
# For more information about RSLs, see Using Runtime Shared Libraries. (http://livedocs.adobe.com/flex/2/docs/00001520.html#168690)
|
515
|
+
#
|
516
|
+
add_param :runtime_shared_libraries, Strings
|
517
|
+
|
518
|
+
##
|
519
|
+
# Alias for runtime_shared_libraries
|
520
|
+
#
|
521
|
+
add_param_alias :rsl, :runtime_shared_libraries
|
522
|
+
|
523
|
+
##
|
524
|
+
# [path-element] [rsl-url] [policy-file-url] [rsl-url] [policy-file-url]
|
525
|
+
# alias -rslp
|
526
|
+
# (repeatable)
|
527
|
+
add_param :runtime_shared_library_path, Strings
|
528
|
+
|
529
|
+
##
|
530
|
+
# Alias for runtime_shared_library_path
|
531
|
+
#
|
532
|
+
add_param_alias :rslp, :runtime_shared_library_path
|
533
|
+
|
534
|
+
##
|
535
|
+
# Specifies the location of the services-config.xml file. This file is used by Flex Data Services.
|
536
|
+
#
|
537
|
+
add_param :services, File
|
538
|
+
|
539
|
+
##
|
540
|
+
# Shows warnings for ActionScript classes.
|
541
|
+
#
|
542
|
+
# The default value is true.
|
543
|
+
#
|
544
|
+
# For more information about viewing warnings and errors, see Viewing warnings and errors (http://livedocs.adobe.com/flex/2/docs/00001517.html#182413).
|
545
|
+
#
|
546
|
+
add_param :show_actionscript_warnings, Boolean, { :default => true, :show_on_false => true }
|
547
|
+
|
548
|
+
##
|
549
|
+
# Shows a warning when Flash Player cannot detect changes to a bound property.
|
550
|
+
#
|
551
|
+
# The default value is true.
|
552
|
+
#
|
553
|
+
# For more information about compiler warnings, see Using SWC files (http://livedocs.adobe.com/flex/2/docs/00001505.html#158337).
|
554
|
+
#
|
555
|
+
add_param :show_binding_warnings, Boolean, { :default => true, :show_on_false => true }
|
556
|
+
|
557
|
+
##
|
558
|
+
# Shows deprecation warnings for Flex components. To see warnings for ActionScript classes, use the show-actionscript-warnings option.
|
559
|
+
#
|
560
|
+
# The default value is true.
|
561
|
+
#
|
562
|
+
# For more information about viewing warnings and errors, see Viewing warnings and errors.
|
563
|
+
#
|
564
|
+
add_param :show_deprecation_warnings, Boolean, { :default => true, :show_on_false => true }
|
565
|
+
|
566
|
+
##
|
567
|
+
# Adds directories or files to the source path. The Flex compiler searches directories in the source path for MXML or AS source files that are used in your Flex applications and includes those that are required at compile time.
|
568
|
+
#
|
569
|
+
# You can use wildcards to include all files and subdirectories of a directory.
|
570
|
+
#
|
571
|
+
# To link an entire library SWC file and not individual classes or directories, use the library-path option.
|
572
|
+
#
|
573
|
+
# The source path is also used as the search path for the component compiler's include-classes and include-resource-bundles options.
|
574
|
+
#
|
575
|
+
# You can also use the += operator to append the new argument to the list of existing source path entries.
|
576
|
+
#
|
577
|
+
add_param :source_path, Paths
|
578
|
+
|
579
|
+
add_param_alias :sp, :source_path
|
580
|
+
|
581
|
+
##
|
582
|
+
# Statically link the libraries specified by the -runtime-shared-libraries-path option.
|
583
|
+
#
|
584
|
+
# alias -static-rsls
|
585
|
+
#
|
586
|
+
add_param :static_link_runtime_shared_libraries, Boolean
|
587
|
+
|
588
|
+
##
|
589
|
+
# Alias for static_link_runtime_shared_libraries
|
590
|
+
#
|
591
|
+
add_param_alias :static_rsls, :static_link_runtime_shared_libraries
|
592
|
+
|
593
|
+
##
|
594
|
+
# Prints undefined property and function calls; also performs compile-time type checking on assignments and options supplied to method calls.
|
595
|
+
#
|
596
|
+
# The default value is true.
|
597
|
+
#
|
598
|
+
# For more information about viewing warnings and errors, see Viewing warnings and errors (http://livedocs.adobe.com/flex/2/docs/00001517.html#182413).
|
599
|
+
#
|
600
|
+
add_param :strict, Boolean, { :default => true, :show_on_false => true }
|
601
|
+
|
602
|
+
##
|
603
|
+
# Specifies the version of the player the application is targeting.
|
604
|
+
#
|
605
|
+
# Features requiring a later version will not be compiled into the application. The minimum value supported is "9.0.0".
|
606
|
+
#
|
607
|
+
add_param :target_player, String
|
608
|
+
|
609
|
+
##
|
610
|
+
# 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.
|
611
|
+
#
|
612
|
+
# For information on compiling a SWC theme file, see Using Styles and Themes (http://livedocs.adobe.com/flex/2/docs/00000751.html#241755) in Flex 2 Developer's Guide.
|
613
|
+
#
|
614
|
+
add_param :theme, Files
|
615
|
+
|
616
|
+
##
|
617
|
+
# Sets metadata in the resulting SWF file. For more information, see Adding metadata to SWF files (http://livedocs.adobe.com/flex/2/docs/00001502.html#145380).
|
618
|
+
#
|
619
|
+
add_param :title, String
|
620
|
+
|
621
|
+
##
|
622
|
+
# Specifies that the current application uses network services.
|
623
|
+
#
|
624
|
+
# The default value is true.
|
625
|
+
#
|
626
|
+
# 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.
|
627
|
+
#
|
628
|
+
# For more information about the use-network property, see Applying Flex Security (http://livedocs.adobe.com/flex/2/docs/00001328.html#137544).
|
629
|
+
#
|
630
|
+
add_param :use_network, Boolean, { :default => true, :show_on_false => true }
|
631
|
+
|
632
|
+
##
|
633
|
+
# Generates source code that includes line numbers. When a run-time error occurs, the stacktrace shows these line numbers.
|
634
|
+
#
|
635
|
+
# Enabling this option generates larger SWF files.\nThe default value is false.
|
636
|
+
#
|
637
|
+
add_param :verbose_stacktraces, Boolean
|
638
|
+
|
639
|
+
##
|
640
|
+
# Verifies the libraries loaded at runtime are the correct ones.
|
641
|
+
#
|
642
|
+
add_param :verify_digests, Boolean
|
643
|
+
|
644
|
+
##
|
645
|
+
# Enables specified warnings. For more information, see Viewing warnings and errors (http://livedocs.adobe.com/flex/2/docs/00001517.html#182413).
|
646
|
+
#
|
647
|
+
add_param :warn_warning_type, Boolean
|
648
|
+
|
649
|
+
##
|
650
|
+
# Enables all warnings. Set to false to disable all warnings. This option overrides the warn-warning_type options.
|
651
|
+
#
|
652
|
+
# The default value is true.
|
653
|
+
#
|
654
|
+
add_param :warnings, Boolean
|
655
|
+
|
656
|
+
##
|
657
|
+
# Main source file to send compiler"
|
658
|
+
# This must be the last item in this list
|
659
|
+
add_param :input, File, { :required => true, :hidden_name => true }
|
660
|
+
|
661
|
+
set :default_prefix, '-'
|
662
|
+
|
663
|
+
##
|
664
|
+
# The default gem name is sprout-flex3sdk
|
665
|
+
#
|
666
|
+
set :pkg_name, 'flex3'
|
667
|
+
|
668
|
+
##
|
669
|
+
# The default gem version
|
670
|
+
#
|
671
|
+
set :pkg_version, '>= 1.0.0.pre'
|
672
|
+
|
673
|
+
##
|
674
|
+
# The default executable target
|
675
|
+
#
|
676
|
+
set :executable, :mxmlc
|
677
|
+
|
678
|
+
end
|
679
|
+
end
|
680
|
+
|
681
|
+
# TODO: Assign mxmlc.output = args || args.first_key
|
682
|
+
def mxmlc args, &block
|
683
|
+
mxmlc_tool = FlashSDK::MXMLC.new
|
684
|
+
mxmlc_tool.to_rake(args, &block)
|
685
|
+
mxmlc_tool
|
686
|
+
end
|
687
|
+
|