flashsdk 1.0.21.pre → 1.0.22.pre
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/lib/flashsdk/asdoc.rb +15 -1
- data/lib/flashsdk/compiler_base.rb +488 -110
- data/lib/flashsdk/generators/class_generator.rb +4 -0
- data/lib/flashsdk/generators/templates/rakefile.rb +22 -11
- data/lib/flashsdk/mxmlc.rb +40 -0
- metadata +3 -8
- data/doc/adl-list.txt +0 -4
- data/doc/adt-list.txt +0 -12
- data/doc/compc-list.txt +0 -130
- data/doc/mxmlc-advanced-list.txt +0 -122
- data/doc/mxmlc-list.txt +0 -55
@@ -3,6 +3,8 @@ module FlashSDK
|
|
3
3
|
##
|
4
4
|
# This is the abstract base class that defines common fields for ActionScript compilers like {FlashSDK::MXMLC} and {FlashSDK::COMPC}.
|
5
5
|
#
|
6
|
+
# Examples provided below will assume {MXMLC} is being used, but should generally be applicable for any subclass.
|
7
|
+
#
|
6
8
|
# @abstract
|
7
9
|
#
|
8
10
|
class CompilerBase < Sprout::Executable::Base
|
@@ -10,7 +12,12 @@ module FlashSDK
|
|
10
12
|
##
|
11
13
|
# Enables accessibility features when compiling the Flex application or SWC file. The default value is false.
|
12
14
|
#
|
13
|
-
#
|
15
|
+
# desc "Compile the Application"
|
16
|
+
# mxmlc 'bin/SomeProject.swf' do |t|
|
17
|
+
# t.input = 'src/SomeProject.as'
|
18
|
+
# t.source_path << 'src'
|
19
|
+
# t.accessible = true
|
20
|
+
# end
|
14
21
|
#
|
15
22
|
add_param :accessible, Boolean, { :hidden_value => true }
|
16
23
|
|
@@ -20,20 +27,43 @@ module FlashSDK
|
|
20
27
|
add_param :actionscript_file_encoding, String
|
21
28
|
|
22
29
|
##
|
23
|
-
# Checks if a source-path entry is a subdirectory of another source-path entry. It helps make the package names of MXML components unambiguous.
|
30
|
+
# Checks if a source-path entry is a subdirectory of another source-path entry. It helps make the package names of MXML components unambiguous.
|
31
|
+
#
|
32
|
+
# desc "Compile the Application"
|
33
|
+
# mxmlc 'bin/SomeProject.swf' do |t|
|
34
|
+
# t.input = 'src/SomeProject.as'
|
35
|
+
# t.source_path << 'src'
|
36
|
+
# t.source_path << 'src/com/foo'
|
37
|
+
# t.allow_source_path_overlap = true
|
38
|
+
# end
|
24
39
|
#
|
25
40
|
add_param :allow_source_path_overlap, Boolean, { :hidden_value => true }
|
26
41
|
|
27
42
|
##
|
28
43
|
# 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.
|
29
44
|
#
|
45
|
+
# Setting this value to false will switch the compiler into a more ECMA-compatible mode.
|
46
|
+
#
|
30
47
|
# The default value is true. If you set this value to false, you must set the es option to true.
|
31
48
|
#
|
32
|
-
#
|
49
|
+
# desc "Compile the Application"
|
50
|
+
# mxmlc 'bin/SomeProject.swf' do |t|
|
51
|
+
# t.input = 'src/SomeProject.as'
|
52
|
+
# t.source_path << 'src'
|
53
|
+
# t.as3 = false
|
54
|
+
# end
|
55
|
+
#
|
33
56
|
add_param :as3, Boolean, { :default => true, :show_on_false => true }
|
34
57
|
|
35
58
|
##
|
36
|
-
# Prints detailed compile times to the standard output. The default value is true.
|
59
|
+
# Prints detailed compile times to the standard output. The default value is true.
|
60
|
+
#
|
61
|
+
# desc "Compile the Application"
|
62
|
+
# mxmlc 'bin/SomeProject.swf' do |t|
|
63
|
+
# t.input = 'src/SomeProject.as'
|
64
|
+
# t.source_path << 'src'
|
65
|
+
# t.benchmark = true
|
66
|
+
# end
|
37
67
|
#
|
38
68
|
add_param :benchmark, Boolean, { :default => true, :show_on_false => true }
|
39
69
|
|
@@ -68,26 +98,55 @@ module FlashSDK
|
|
68
98
|
#
|
69
99
|
# Flex also uses the verbose-stacktraces setting to determine whether line numbers are added to the stacktrace.
|
70
100
|
#
|
101
|
+
# desc "Compile the Application"
|
102
|
+
# mxmlc 'bin/SomeProject.swf' do |t|
|
103
|
+
# t.input = 'src/SomeProject.as'
|
104
|
+
# t.source_path << 'src'
|
105
|
+
# t.debug = true
|
106
|
+
# end
|
107
|
+
#
|
108
|
+
# @see #optimize
|
109
|
+
# @see #verbose_stacktraces
|
110
|
+
#
|
71
111
|
add_param :debug, Boolean, { :hidden_value => true }
|
72
112
|
|
73
113
|
##
|
74
|
-
# Lets you engage in remote debugging sessions with the Flash IDE.
|
114
|
+
# Lets you engage in remote debugging sessions with the Flash IDE.
|
75
115
|
#
|
76
116
|
add_param :debug_password, String
|
77
117
|
|
78
118
|
##
|
79
|
-
# Sets the
|
119
|
+
# Sets the SWF background color.
|
80
120
|
#
|
81
|
-
#
|
121
|
+
# If you're using the Flex framework, the default background IMAGE is that sickly, horrendous, blue-green-grey gradient.
|
82
122
|
#
|
83
|
-
#
|
123
|
+
# If you want to see the background color that you set here, you will also need to override the +backgroundImage+ property
|
124
|
+
# in your Flex Application document.
|
125
|
+
#
|
126
|
+
# You can also set the background color (and other values) using the +[Embed]+ metadata directive directly in your Document Root class.
|
127
|
+
#
|
128
|
+
# [SWF(width='400', height='300', backgroundColor='#ffffff', frameRate='30')]
|
129
|
+
#
|
130
|
+
# To set the background color from a Rake task, use the 0x notation, as the following example shows:
|
131
|
+
#
|
132
|
+
# desc "Compile the Application"
|
133
|
+
# mxmlc 'bin/SomeProject.swf' do |t|
|
134
|
+
# t.input = 'src/SomeProject.as'
|
135
|
+
# t.source_path << 'src'
|
136
|
+
# t.default_background_color = '0xffcc00'
|
137
|
+
# end
|
84
138
|
#
|
85
|
-
# This is an advanced option.
|
86
|
-
#
|
87
139
|
add_param :default_background_color, String
|
88
140
|
|
89
141
|
##
|
90
|
-
# Sets the application's frame rate. The default value is 24.
|
142
|
+
# Sets the application's frame rate. The default value is 24.
|
143
|
+
#
|
144
|
+
# desc "Compile the Application"
|
145
|
+
# mxmlc 'bin/SomeProject.swf' do |t|
|
146
|
+
# t.input = 'src/SomeProject.as'
|
147
|
+
# t.source_path << 'src'
|
148
|
+
# t.default_frame_rate = 24
|
149
|
+
# end
|
91
150
|
#
|
92
151
|
add_param :default_frame_rate, Number
|
93
152
|
|
@@ -100,26 +159,39 @@ module FlashSDK
|
|
100
159
|
#
|
101
160
|
# Example:
|
102
161
|
#
|
162
|
+
# desc "Compile the Application"
|
163
|
+
# mxmlc 'bin/SomeProject.swf' do |t|
|
164
|
+
# t.input = 'src/SomeProject.as'
|
165
|
+
# t.source_path << 'src'
|
103
166
|
# # 900 is new max-recursion-depth
|
104
167
|
# # 20 is new max-execution-time
|
105
168
|
# t.default_script_limits = '900 20'
|
169
|
+
# end
|
106
170
|
#
|
107
171
|
# You can override these settings in the application.
|
108
172
|
#
|
109
|
-
# This is an advanced option.
|
110
|
-
#
|
111
173
|
add_param :default_script_limits, String
|
112
174
|
|
113
175
|
##
|
114
|
-
# Defines the default application size, in pixels
|
176
|
+
# Defines the default application size, in pixels as a String.
|
115
177
|
#
|
116
|
-
#
|
178
|
+
# If you're using the Flex 4 SDK, these values should be comma-delimited like:
|
117
179
|
#
|
118
|
-
#
|
180
|
+
# desc "Compile the Application"
|
181
|
+
# mxmlc 'bin/SomeProject.swf' do |t|
|
182
|
+
# t.input = 'src/SomeProject.as'
|
183
|
+
# t.source_path << 'src'
|
184
|
+
# t.default_size = '950,550'
|
185
|
+
# end
|
119
186
|
#
|
120
|
-
#
|
187
|
+
# If you're using the Flex 3 SDK, these values should be space-delimited like:
|
121
188
|
#
|
122
|
-
#
|
189
|
+
# desc "Compile the Application"
|
190
|
+
# mxmlc 'bin/SomeProject.swf' do |t|
|
191
|
+
# t.input = 'src/SomeProject.as'
|
192
|
+
# t.source_path << 'src'
|
193
|
+
# t.default_size = '950 550'
|
194
|
+
# end
|
123
195
|
#
|
124
196
|
add_param :default_size, String
|
125
197
|
|
@@ -129,23 +201,82 @@ module FlashSDK
|
|
129
201
|
add_param :default_css_url, Url
|
130
202
|
|
131
203
|
##
|
132
|
-
# This parameter is normally called 'define' but thanks to scoping issues
|
204
|
+
# This parameter is normally called 'define' but thanks to scoping issues
|
205
|
+
# with Sprouts and Rake, we needed to rename it and chose: 'define_conditional'.
|
133
206
|
#
|
134
|
-
#
|
207
|
+
# The format of each String value is "namespace::variable_name,value", for
|
208
|
+
# example, if I wanted an Environment named 'production' available to
|
209
|
+
# conditional compilation statements, I might do the following:
|
210
|
+
#
|
211
|
+
# Define a global AS3 conditional compilation definition:
|
212
|
+
#
|
213
|
+
# desc "Compile the Application"
|
214
|
+
# mxmlc 'bin/SomeProject.swf' do |t|
|
215
|
+
# t.input = 'src/SomeProject.as'
|
216
|
+
# t.source_path << 'src'
|
217
|
+
# t.define_conditional << 'CONFIG::environment,production'
|
218
|
+
# end
|
219
|
+
#
|
220
|
+
# Then, in any given ActionScript class, we might add the following:
|
221
|
+
#
|
222
|
+
# public static const environent:String = CONFIG::environment
|
223
|
+
#
|
224
|
+
# This value would be available to code at runtime where we can then
|
225
|
+
# branch on different environments.
|
226
|
+
#
|
227
|
+
# We can also use IFDEF like statements to completely remove or add code based
|
228
|
+
# on a conditional value. This is (sadly) done with Boolean conditionals as follows:
|
229
|
+
#
|
230
|
+
# desc "Compile the Application"
|
231
|
+
# mxmlc 'bin/SomeProject.swf' do |t|
|
232
|
+
# t.input = 'src/SomeProject.as'
|
233
|
+
# t.source_path << 'src'
|
234
|
+
# t.define_conditional << 'CONFIG::release,true'
|
235
|
+
# t.define_conditional << 'CONFIG::debug,false'
|
236
|
+
# end
|
237
|
+
#
|
238
|
+
# Then, in any given ActionScript class, we might add the following:
|
239
|
+
#
|
240
|
+
# CONFIG::release
|
241
|
+
# public function getValue():String {
|
242
|
+
# return value;
|
243
|
+
# }
|
244
|
+
#
|
245
|
+
# CONFIG::debug
|
246
|
+
# public function getValue():String {
|
247
|
+
# return value + " : " + debugInfo;
|
248
|
+
# }
|
249
|
+
#
|
250
|
+
# Note how the CONFIG::[name] statement precedes an ActionScript statement, but doesn't need to enclose it brackets or anything. This can
|
251
|
+
# go in front of any ActionScript statement (functions, classes, variables, etc).
|
252
|
+
#
|
253
|
+
# For more information, please read {Adobe's documentation}[http://livedocs.adobe.com/flex/3/html/compilers_21.html] on conditional compilation.
|
135
254
|
#
|
136
255
|
add_param :define_conditional, Strings, { :shell_name => "-define" }
|
137
256
|
|
138
257
|
##
|
139
258
|
# Sets metadata in the resulting SWF file.
|
140
259
|
#
|
260
|
+
# desc "Compile the Application"
|
261
|
+
# mxmlc 'bin/SomeProject.swf' do |t|
|
262
|
+
# t.input = 'src/SomeProject.as'
|
263
|
+
# t.source_path << 'src'
|
264
|
+
# t.description = "This SWF was built with Project Sprouts!"
|
265
|
+
# end
|
266
|
+
#
|
141
267
|
add_param :description, String
|
142
268
|
|
143
269
|
##
|
144
270
|
# Outputs the compiler options in the flex-config.xml file to the target path; for example:
|
145
271
|
#
|
146
|
-
#
|
272
|
+
# desc "Compile the Application"
|
273
|
+
# mxmlc 'bin/SomeProject.swf' do |t|
|
274
|
+
# t.input = 'src/SomeProject.as'
|
275
|
+
# t.source_path << 'src'
|
276
|
+
# t.dump_config = 'mxmlc-config.xml'
|
277
|
+
# end
|
147
278
|
#
|
148
|
-
#
|
279
|
+
# @see #load_config
|
149
280
|
#
|
150
281
|
add_param :dump_config, File
|
151
282
|
|
@@ -154,9 +285,15 @@ module FlashSDK
|
|
154
285
|
#
|
155
286
|
# 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.
|
156
287
|
#
|
157
|
-
# The default value is false. If you set this option to true, you must set the
|
288
|
+
# The default value is false. If you set this option to true, you must set the as3 option to false.
|
158
289
|
#
|
159
|
-
#
|
290
|
+
# desc "Compile the Application"
|
291
|
+
# mxmlc 'bin/SomeProject.swf' do |t|
|
292
|
+
# t.input = 'src/SomeProject.as'
|
293
|
+
# t.source_path << 'src'
|
294
|
+
# t.es = true
|
295
|
+
# t.as3 = false
|
296
|
+
# end
|
160
297
|
#
|
161
298
|
add_param :es, Boolean
|
162
299
|
|
@@ -165,21 +302,38 @@ module FlashSDK
|
|
165
302
|
#
|
166
303
|
# This option provides compile-time link checking for external references that are dynamically linked.
|
167
304
|
#
|
168
|
-
#
|
169
|
-
#
|
305
|
+
# desc "Compile the Application"
|
306
|
+
# mxmlc 'bin/SomeProject.swf' do |t|
|
307
|
+
# t.input = 'src/SomeProject.as'
|
308
|
+
# t.source_path << 'src'
|
309
|
+
# t.externs << 'com.somedomain.SomeClass'
|
310
|
+
# t.externs << 'com.otherdomain.OtherClass'
|
311
|
+
# end
|
312
|
+
#
|
313
|
+
# To dynamically link against files, folders or SWCs instead of classes, see {#external_library_path}.
|
314
|
+
#
|
170
315
|
add_param :externs, Strings
|
171
316
|
|
172
317
|
##
|
173
|
-
# Specifies a list of SWC files or directories to exclude from linking when compiling a SWF file.
|
318
|
+
# Specifies a list of SWC files or directories to exclude from linking when compiling a SWF file.
|
319
|
+
#
|
320
|
+
# This option provides compile-time link checking for external components that are dynamically linked.
|
174
321
|
#
|
175
|
-
#
|
322
|
+
# desc "Compile the Application"
|
323
|
+
# mxmlc 'bin/SomeProject.swf' do |t|
|
324
|
+
# t.input = 'src/SomeProject.as'
|
325
|
+
# t.source_path << 'src'
|
326
|
+
# t.external_library_path << 'src/com/domain/project/SomeClass.as'
|
327
|
+
# t.external_library_path << 'lib/somelib/'
|
328
|
+
# t.external_library_path << 'lib/otherlib/OtherLibrary.swc'
|
329
|
+
# end
|
176
330
|
#
|
177
|
-
#
|
331
|
+
# To dynamically link against classes instead of files, folders or SWCs, see {#externs}.
|
178
332
|
#
|
179
333
|
add_param :external_library_path, Files
|
180
334
|
|
181
335
|
##
|
182
|
-
# Alias for external_library_path
|
336
|
+
# Alias for {#external_library_path}
|
183
337
|
#
|
184
338
|
add_param_alias :el, :external_library_path
|
185
339
|
|
@@ -191,105 +345,158 @@ module FlashSDK
|
|
191
345
|
##
|
192
346
|
# Specifies the range of Unicode settings for that language.
|
193
347
|
#
|
194
|
-
# This is an advanced option.
|
195
|
-
#
|
196
348
|
add_param :fonts_languages_language_range, String, { :shell_name => "-compiler.fonts.languages.language-range" }
|
197
349
|
|
198
350
|
##
|
199
351
|
# Defines the font manager. The default is flash.fonts.JREFontManager. You can also use the flash.fonts.BatikFontManager.
|
200
352
|
#
|
201
|
-
# This is an advanced option.
|
202
|
-
#
|
203
353
|
add_param :fonts_managers, Strings
|
204
354
|
|
205
355
|
##
|
206
356
|
# Sets the maximum number of fonts to keep in the server cache.
|
207
357
|
#
|
208
|
-
# This is an advanced option.
|
209
|
-
#
|
210
358
|
add_param :fonts_max_cached_fonts, Number
|
211
359
|
|
212
360
|
##
|
213
361
|
# Sets the maximum number of character glyph-outlines to keep in the server cache for each font face.
|
214
362
|
#
|
215
|
-
# This is an advanced option.
|
216
|
-
#
|
217
363
|
add_param :fonts_max_glyphs_per_face, Number
|
218
364
|
|
219
365
|
##
|
220
|
-
# Specifies a SWF file frame label with a sequence of class names that
|
366
|
+
# Specifies a SWF file frame label with a sequence of one or more class names that will be linked onto the frame.
|
221
367
|
#
|
222
|
-
#
|
368
|
+
# desc "Compile the Application"
|
369
|
+
# mxmlc 'bin/SomeProject.swf' do |t|
|
370
|
+
# t.input = 'src/SomeProject.as'
|
371
|
+
# t.source_path << 'src'
|
372
|
+
# t.frames_frame << 'someFrameLabel SomeClass OtherClass AnotherClass'
|
373
|
+
# t.frames_frame << 'anotherFrameLabel YetAnotherClass'
|
374
|
+
# end
|
223
375
|
#
|
224
|
-
|
225
|
-
#
|
226
|
-
add_param :frames_frame, String, { :shell_name => '-frames.frame' }
|
376
|
+
add_param :frames_frame, Strings, { :shell_name => '-frames.frame' }
|
227
377
|
|
228
378
|
##
|
229
379
|
# Toggles the generation of an IFlexBootstrap-derived loader class.
|
230
380
|
#
|
231
|
-
#
|
381
|
+
# desc "Compile the Application"
|
382
|
+
# mxmlc 'bin/SomeProject.swf' do |t|
|
383
|
+
# t.input = 'src/SomeProject.as'
|
384
|
+
# t.source_path << 'src'
|
385
|
+
# t.generate_frame_loader = false
|
386
|
+
# end
|
387
|
+
#
|
388
|
+
# * Might be deprecated?
|
232
389
|
#
|
233
390
|
add_param :generate_frame_loader, Boolean
|
234
391
|
|
235
392
|
##
|
236
|
-
# Enables the headless implementation of the Flex compiler.
|
393
|
+
# Enables the headless implementation of the Flex compiler.
|
237
394
|
#
|
238
|
-
#
|
395
|
+
# This sets the following (in Java):
|
239
396
|
#
|
240
|
-
#
|
397
|
+
# System.setProperty('java.awt.headless', 'true')
|
241
398
|
#
|
242
|
-
#
|
399
|
+
# The headless setting (java.awt.headless=true) is required to
|
400
|
+
# compile SWFs that use fonts and SVG on UNIX systems that aren't
|
401
|
+
# running X Windows.
|
243
402
|
#
|
244
403
|
add_param :headless_server, Boolean
|
245
404
|
|
246
405
|
##
|
247
406
|
# Links all classes inside a SWC file to the resulting application SWF file, regardless of whether or not they are used.
|
248
407
|
#
|
249
|
-
# Contrast this option with the
|
408
|
+
# Contrast this option with the {#library_path} option that includes only those classes that are referenced at compile time.
|
250
409
|
#
|
251
|
-
# To link one or more classes whether or not they are used and not an entire SWC file, use the includes option.
|
410
|
+
# To link one or more classes whether or not they are used and not an entire SWC file, use the {#includes} option.
|
252
411
|
#
|
253
412
|
# This option is commonly used to specify resource bundles.
|
254
413
|
#
|
414
|
+
# desc "Compile the Application"
|
415
|
+
# mxmlc 'bin/SomeProject.swf' do |t|
|
416
|
+
# t.input = 'src/SomeProject.as'
|
417
|
+
# t.source_path << 'src'
|
418
|
+
# t.include_libraries << 'lib/somelib/SomeLib.swc'
|
419
|
+
# end
|
420
|
+
#
|
421
|
+
# @see #include_path
|
422
|
+
# @see #includes
|
423
|
+
# @see #library_path
|
424
|
+
#
|
255
425
|
add_param :include_libraries, Files
|
256
426
|
|
257
427
|
##
|
258
428
|
# Links one or more classes to the resulting application SWF file, whether or not those classes are required at compile time.
|
259
429
|
#
|
260
|
-
# To link an entire SWC file rather than individual classes, use the
|
430
|
+
# To link an entire SWC file rather than individual classes, use the {#include_libraries} option.
|
431
|
+
#
|
432
|
+
# desc "Compile the Application"
|
433
|
+
# mxmlc 'bin/SomeProject.swf' do |t|
|
434
|
+
# t.input = 'src/SomeProject.as'
|
435
|
+
# t.source_path << 'src'
|
436
|
+
# t.source_path << 'lib/somelib'
|
437
|
+
# t.includes << 'com.domain.SomeClass'
|
438
|
+
# end
|
439
|
+
#
|
440
|
+
# @see #include_libraries
|
441
|
+
# @see #include_path
|
442
|
+
# @see #library_path
|
261
443
|
#
|
262
444
|
add_param :includes, Strings
|
263
445
|
|
264
446
|
##
|
265
447
|
# 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
|
266
|
-
# be included in the SWF regardless of whether they are
|
448
|
+
# be included in the SWF regardless of whether they are referenced elsewhere.
|
449
|
+
#
|
450
|
+
# desc "Compile the Application"
|
451
|
+
# mxmlc 'bin/SomeProject.swf' do |t|
|
452
|
+
# t.input = 'src/SomeProject.as'
|
453
|
+
# t.source_path << 'src'
|
454
|
+
# t.source_path << 'lib/somelib'
|
455
|
+
# t.include_path << 'lib/somelib/com/somelib/net'
|
456
|
+
# end
|
457
|
+
#
|
458
|
+
# @see #include_libraries
|
459
|
+
# @see #includes
|
460
|
+
# @see #library_path
|
461
|
+
#
|
267
462
|
add_param :include_path, Paths
|
268
463
|
|
269
464
|
##
|
270
465
|
# Enables incremental compilation.
|
271
466
|
#
|
272
|
-
# This option is true by default for the Flex Builder application compiler.
|
467
|
+
# This option is true by default for the Flex Builder application compiler.
|
468
|
+
#
|
469
|
+
# For the command-line compiler, the default is false.
|
470
|
+
#
|
471
|
+
# The web-tier compiler does not support incremental compilation.
|
273
472
|
#
|
274
473
|
add_param :incremental, Boolean
|
275
474
|
|
276
475
|
##
|
277
|
-
# Keep the specified metadata in the SWF (advanced, repeatable).
|
476
|
+
# Keep the specified metadata in the SWF (advanced, repeatable). This parameter must be set
|
477
|
+
# if you attempt to define new metadata tags.
|
278
478
|
#
|
279
|
-
#
|
479
|
+
# If you define metadata tags and use this parameter to include them when building a SWC,
|
480
|
+
# consumers of your SWC library will not also need to re-include the same metadata tags.
|
280
481
|
#
|
281
|
-
# Rakefile:
|
482
|
+
# Following is an example Rakefile that is setting this property:
|
282
483
|
#
|
283
|
-
#
|
284
|
-
#
|
285
|
-
#
|
484
|
+
# desc "Compile the Application"
|
485
|
+
# mxmlc 'bin/SomeProject.swf' do |t|
|
486
|
+
# t.input = 'src/SomeProject.as'
|
487
|
+
# t.source_path << 'src'
|
488
|
+
# t.keep_as3_metadata << 'Orange'
|
489
|
+
# end
|
490
|
+
#
|
491
|
+
# There could be a class somewhere that defines this metadata tag:
|
286
492
|
#
|
287
|
-
#
|
493
|
+
# [Orange(isTasty=true)]
|
494
|
+
# public function eatOranges():void {
|
495
|
+
# // do something
|
496
|
+
# }
|
288
497
|
#
|
289
|
-
#
|
290
|
-
#
|
291
|
-
# // do something
|
292
|
-
# }
|
498
|
+
# There would normally be another class that does some kind of reflection to perform
|
499
|
+
# some special operation on all entities that declare themselves as [Orange].
|
293
500
|
#
|
294
501
|
add_param :keep_as3_metadata, Strings
|
295
502
|
|
@@ -302,7 +509,7 @@ module FlashSDK
|
|
302
509
|
#
|
303
510
|
# The default names of the primary generated class files are filename-generated.as and filename-interface.as.
|
304
511
|
#
|
305
|
-
# The default value is false
|
512
|
+
# The default value is false.
|
306
513
|
#
|
307
514
|
add_param :keep_generated_actionscript, Boolean
|
308
515
|
|
@@ -316,8 +523,6 @@ module FlashSDK
|
|
316
523
|
#
|
317
524
|
# The default value is false.
|
318
525
|
#
|
319
|
-
# This is an advanced option.
|
320
|
-
#
|
321
526
|
add_param :lazy_init, Boolean
|
322
527
|
|
323
528
|
|
@@ -326,34 +531,41 @@ module FlashSDK
|
|
326
531
|
#
|
327
532
|
# Specifies a product and a serial number. (repeatable)
|
328
533
|
#
|
329
|
-
# This is an advanced option.
|
330
|
-
#
|
331
534
|
add_param :license, String
|
332
535
|
|
333
536
|
##
|
334
|
-
# Links SWC files to the resulting application SWF file. The compiler only links in those classes for the SWC file that are
|
537
|
+
# Links SWC files to the resulting application SWF file. The compiler only links in those classes for the SWC file that are referenced from
|
538
|
+
# your Document Root, or another class that it references.
|
335
539
|
#
|
336
|
-
# The default value of the
|
540
|
+
# The default value of the {#library_path} option includes all SWC files in the libs directory and the current locale. These are required.
|
337
541
|
#
|
338
|
-
# To point to individual classes or packages rather than entire SWC files, use the
|
542
|
+
# To point to individual classes or packages rather than entire SWC files, use the {#source_path} option.
|
339
543
|
#
|
340
|
-
#
|
341
|
-
# locale SWC files. Your new entry is not appended to the library-path but replaces it.
|
544
|
+
# You can use the << operator to append the new argument to the list of existing library paths:
|
342
545
|
#
|
546
|
+
# desc "Compile the Application"
|
343
547
|
# mxmlc 'bin/SomeProject.swf' do |t|
|
344
548
|
# t.input = 'src/SomeProject.as'
|
345
|
-
# t.library_path
|
549
|
+
# t.library_path << 'lib/somelib/SomeLib.swc'
|
346
550
|
# end
|
347
551
|
#
|
348
|
-
#
|
552
|
+
# If you set the value of the library_path using the '=' operator, you must set the entire Array.
|
553
|
+
#
|
554
|
+
# You may also need to explicitly add the framework.swc and locale SWC files. Your new entry is
|
555
|
+
# not appended to the {#library_path} but replaces it. Once the value has been set, you can use
|
556
|
+
# the '<<' operator for subsequent applications.
|
349
557
|
#
|
558
|
+
# desc "Compile the Application"
|
350
559
|
# mxmlc 'bin/SomeProject.swf' do |t|
|
351
560
|
# t.input = 'src/SomeProject.as'
|
352
|
-
# t.
|
561
|
+
# t.source_path << 'src'
|
562
|
+
# t.library_path = ['lib/somelib/SomeLib.swc']
|
353
563
|
# end
|
354
564
|
#
|
355
565
|
# 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.
|
356
566
|
#
|
567
|
+
# @see {#source_path}
|
568
|
+
#
|
357
569
|
add_param :library_path, Files
|
358
570
|
|
359
571
|
##
|
@@ -367,22 +579,38 @@ module FlashSDK
|
|
367
579
|
#
|
368
580
|
# <def>, <pre>, and <ext>
|
369
581
|
#
|
370
|
-
#
|
582
|
+
# Symbols showing linker dependencies in the final SWF file.
|
371
583
|
#
|
372
|
-
# The file format output by this command can be used to write a file for input to the
|
584
|
+
# The file format output by this command can be used to write a file for input to the {#load_externs} option.
|
373
585
|
#
|
374
|
-
#
|
586
|
+
# desc "Compile the Application"
|
587
|
+
# mxmlc 'bin/SomeProject.swf' do |t|
|
588
|
+
# t.input = 'src/SomeProject.as'
|
589
|
+
# t.source_path << 'src'
|
590
|
+
# t.link_report = 'ext/link-report.xml'
|
591
|
+
# end
|
592
|
+
#
|
593
|
+
# @see #load_externs
|
375
594
|
#
|
376
|
-
add_param :link_report, File
|
595
|
+
add_param :link_report, String # SHOULD be a String - File types become prerequisites.
|
377
596
|
|
378
597
|
##
|
379
598
|
# Specifies the location of the configuration file that defines compiler options.
|
380
599
|
#
|
381
|
-
# If you specify a configuration file, you can override individual options by setting them on the command line.
|
600
|
+
# If you specify a configuration file, you can still override individual options by setting them on the command line.
|
382
601
|
#
|
383
602
|
# All relative paths in the configuration file are relative to the location of the configuration file itself.
|
603
|
+
#
|
604
|
+
# desc "Compile the Application"
|
605
|
+
# mxmlc 'bin/SomeProject.swf' do |t|
|
606
|
+
# t.input = 'src/SomeProject.as'
|
607
|
+
# t.source_path << 'src'
|
608
|
+
# t.load_config << 'mxmlc-config.xml'
|
609
|
+
# end
|
384
610
|
#
|
385
|
-
#
|
611
|
+
# If you would like to see this file for your current configuration, you can set the {#dump_config} parameter and run your rake task.
|
612
|
+
#
|
613
|
+
# @see #dump_config
|
386
614
|
#
|
387
615
|
add_param :load_config, Files
|
388
616
|
|
@@ -397,6 +625,25 @@ module FlashSDK
|
|
397
625
|
#
|
398
626
|
# This option provides compile-time link checking for external components that are dynamically linked.
|
399
627
|
#
|
628
|
+
# desc "Compile the Application"
|
629
|
+
# mxmlc 'bin/SomeProject.swf' do |t|
|
630
|
+
# t.input = 'src/SomeProject.as'
|
631
|
+
# t.source_path << 'src'
|
632
|
+
# t.load_externs = 'framework-link-report.xml'
|
633
|
+
# end
|
634
|
+
#
|
635
|
+
# The input for this parameter is often the output of another build task that is set up to emit a {#link_report},
|
636
|
+
# for example, the previous example might be loading a {#link_report} from a task that looks like:
|
637
|
+
#
|
638
|
+
# desc "Compile the Application"
|
639
|
+
# compc 'bin/rsls' do |t|
|
640
|
+
# t.directory = true
|
641
|
+
# t.include_sources << 'lib/framework'
|
642
|
+
# t.link_report = 'framework-link-report.xml'
|
643
|
+
# end
|
644
|
+
#
|
645
|
+
# @see #link_report
|
646
|
+
#
|
400
647
|
add_param :load_externs, File
|
401
648
|
|
402
649
|
##
|
@@ -406,9 +653,40 @@ module FlashSDK
|
|
406
653
|
# with only the locale option changing.
|
407
654
|
#
|
408
655
|
# You must also include the parent directory of the individual locale directories,
|
409
|
-
# plus the token {locale}, in the source-path
|
656
|
+
# plus the token \{locale\}, in the source-path.
|
657
|
+
#
|
658
|
+
# One way to do this with Rake might be as follows:
|
659
|
+
#
|
660
|
+
# # Create a new, empty task to asseble the locale-specific
|
661
|
+
# # build tasks:
|
662
|
+
# desc 'Build localized SWF files'
|
663
|
+
# task :build_locales
|
664
|
+
#
|
665
|
+
# # For each supported locale, create a new build task:
|
666
|
+
# ['en_US', 'en_EN', 'es_ES'].each do |locale|
|
667
|
+
#
|
668
|
+
# swf = "bin/SomeProject-#{locale}.swf"
|
669
|
+
#
|
670
|
+
# mxmlc swf do |t|
|
671
|
+
# t.input = 'src/SomeProject.as'
|
672
|
+
# t.source_path << 'src'
|
673
|
+
# t.source_path << "locale/#{locale}"
|
674
|
+
# t.locale = locale
|
675
|
+
# end
|
676
|
+
#
|
677
|
+
# # Add the localized build task as a prerequisite
|
678
|
+
# # to the aggregate task:
|
679
|
+
# task :build_locales => swf
|
680
|
+
# end
|
410
681
|
#
|
411
|
-
#
|
682
|
+
# If the previous code was in a Rake file, you could
|
683
|
+
# build all localized SWFs with:
|
684
|
+
#
|
685
|
+
# rake build_locales
|
686
|
+
#
|
687
|
+
# You could also build a single locale with:
|
688
|
+
#
|
689
|
+
# rake bin/SomeProject-en_US.swf
|
412
690
|
#
|
413
691
|
add_param :locale, String
|
414
692
|
|
@@ -428,22 +706,36 @@ module FlashSDK
|
|
428
706
|
add_param :namespaces_namespace, String
|
429
707
|
|
430
708
|
##
|
431
|
-
# Enables the ActionScript optimizer. This optimizer reduces file size and increases performance by optimizing the SWF file's bytecode
|
709
|
+
# Enables the ActionScript optimizer. This optimizer reduces file size and increases performance by optimizing the SWF file's bytecode, but
|
710
|
+
# takes slightly longer to compile. This should usually be set to true for any SWF files that are headed to production.
|
432
711
|
#
|
433
|
-
#
|
712
|
+
# desc "Compile the Application"
|
713
|
+
# mxmlc 'bin/SomeProject.swf' do |t|
|
714
|
+
# t.input = 'src/SomeProject.as'
|
715
|
+
# t.source_path << 'src'
|
716
|
+
# t.optimize = true
|
717
|
+
# end
|
718
|
+
#
|
719
|
+
# @see #debug
|
434
720
|
#
|
435
721
|
add_param :optimize, Boolean
|
436
722
|
|
437
723
|
##
|
438
|
-
# Specifies the output path and filename for the resulting file.
|
724
|
+
# Specifies the output path and filename for the resulting file.
|
439
725
|
#
|
440
|
-
#
|
726
|
+
# If you omit this option, the compiler saves the SWF file to the
|
727
|
+
# directory where the target file is located. The default SWF
|
728
|
+
# filename matches the target filename, but with a SWF file extension. When
|
729
|
+
# using this option with the component compiler (compc), the output is a
|
730
|
+
# SWC file rather than a SWF file.
|
441
731
|
#
|
442
|
-
#
|
732
|
+
# The compiler creates extra directories based on the specified filename
|
733
|
+
# if those directories are not present.
|
443
734
|
#
|
444
|
-
# The
|
735
|
+
# The {#mxmlc} Rake task uses a Rake::File task under the covers, and
|
736
|
+
# will automatically set this value with the string passed into the task name.
|
445
737
|
#
|
446
|
-
#
|
738
|
+
# This parameter should not be set directly within the task body.
|
447
739
|
#
|
448
740
|
add_param :output, File, { :file_task_name => true }
|
449
741
|
|
@@ -463,28 +755,56 @@ module FlashSDK
|
|
463
755
|
add_param :resource_bundle_list, File
|
464
756
|
|
465
757
|
##
|
466
|
-
# Specifies a list of run-time shared libraries (RSLs)
|
758
|
+
# Specifies a list of run-time shared libraries (RSLs)
|
759
|
+
# to use for this application. RSLs are dynamically-linked at run time.
|
467
760
|
#
|
468
|
-
# You specify the location of the SWF file relative to the deployment
|
761
|
+
# You specify the location of the SWF file relative to the deployment
|
762
|
+
# location of the application. For example, if you store a file named
|
763
|
+
# library.swf file in the web_root/libraries directory on the web server,
|
764
|
+
# and the application in the web root, you specify libraries/library.swf.
|
469
765
|
#
|
470
766
|
add_param :runtime_shared_libraries, Strings
|
471
767
|
|
472
768
|
##
|
473
|
-
# Alias for runtime_shared_libraries
|
769
|
+
# Alias for {#runtime_shared_libraries}
|
474
770
|
#
|
475
771
|
add_param_alias :rsl, :runtime_shared_libraries
|
476
772
|
|
477
773
|
##
|
478
|
-
# Runtime
|
774
|
+
# Setting up Runtime Shared Libraries (RSLs) is extremely complicated and usually
|
775
|
+
# not worth doing unless you're using the Flex framework.
|
479
776
|
#
|
480
|
-
#
|
777
|
+
# Following are some URLs where you might learn more about using RSLs:
|
481
778
|
#
|
482
|
-
#
|
779
|
+
# * http://www.newtriks.com/?p=802
|
780
|
+
# * http://blogs.adobe.com/rgonzalez/2006/06/modular_applications_part_2.html
|
781
|
+
# * http://code.google.com/p/maashaack/wiki/Metadata
|
782
|
+
# * http://flexscript.wordpress.com/2008/11/15/using-runtime-shared-libraries-utilizing-flash-player-cache/
|
783
|
+
#
|
784
|
+
# If you're not using the Flex framework, the most difficult thing you'll need to do
|
785
|
+
# is set up a Preloader and figure out how to determine which urls to load the RSLs from.
|
786
|
+
#
|
787
|
+
# If you are setting up RSLs with the Flex framework, you should be able to create
|
788
|
+
# a build task something like the following:
|
789
|
+
#
|
790
|
+
# version = '4.1.0.16076'
|
791
|
+
# rsls_dir = 'lib/rsls'
|
792
|
+
# crossdomain = ''
|
793
|
+
# host = 'http://yourdomain.com'
|
794
|
+
#
|
795
|
+
# desc "Compile the Application"
|
796
|
+
# mxmlc "bin/SomeProject.swf" do |t|
|
797
|
+
# t.source_path << 'src'
|
798
|
+
# t.input = 'src/SomeProject.mxml'
|
799
|
+
# t.pkg_version = version
|
800
|
+
# t.runtime_shared_library_path << "lib/framework_#{version}.swc,#{host}#{rsls_dir}/framework_#{version}.swz,#{crossdomain},#{host}#{rsls_dir}/framework_#{version}.swf"
|
801
|
+
# t.runtime_shared_library_path << "lib/rpc_#{version}.swc,#{host}#{rsls_dir}/rpc_#{version}.swz,#{crossdomain},#{host}#{rsls_dir}/rpc_#{version}.swf"
|
802
|
+
# end
|
483
803
|
#
|
484
804
|
add_param :runtime_shared_library_path, Strings
|
485
805
|
|
486
806
|
##
|
487
|
-
# Alias for runtime_shared_library_path
|
807
|
+
# Alias for {#runtime_shared_library_path}
|
488
808
|
#
|
489
809
|
add_param_alias :rslp, :runtime_shared_library_path
|
490
810
|
|
@@ -498,6 +818,13 @@ module FlashSDK
|
|
498
818
|
#
|
499
819
|
# The default value is true.
|
500
820
|
#
|
821
|
+
# desc "Compile the Application"
|
822
|
+
# mxmlc 'bin/SomeProject.swf' do |t|
|
823
|
+
# t.input = 'src/SomeProject.as'
|
824
|
+
# t.source_path << 'src'
|
825
|
+
# t.show_actionscript_warnings = false
|
826
|
+
# end
|
827
|
+
#
|
501
828
|
add_param :show_actionscript_warnings, Boolean, { :default => true, :show_on_false => true }
|
502
829
|
|
503
830
|
##
|
@@ -505,6 +832,13 @@ module FlashSDK
|
|
505
832
|
#
|
506
833
|
# The default value is true.
|
507
834
|
#
|
835
|
+
# desc "Compile the Application"
|
836
|
+
# mxmlc 'bin/SomeProject.swf' do |t|
|
837
|
+
# t.input = 'src/SomeProject.mxml'
|
838
|
+
# t.source_path << 'src'
|
839
|
+
# t.show_binding_warnings = false
|
840
|
+
# end
|
841
|
+
#
|
508
842
|
add_param :show_binding_warnings, Boolean, { :default => true, :show_on_false => true }
|
509
843
|
|
510
844
|
##
|
@@ -512,40 +846,67 @@ module FlashSDK
|
|
512
846
|
#
|
513
847
|
# The default value is true.
|
514
848
|
#
|
849
|
+
# desc "Compile the Application"
|
850
|
+
# mxmlc 'bin/SomeProject.swf' do |t|
|
851
|
+
# t.input = 'src/SomeProject.mxml'
|
852
|
+
# t.source_path << 'src'
|
853
|
+
# t.show_deprecation_warnings = false
|
854
|
+
# end
|
855
|
+
#
|
515
856
|
add_param :show_deprecation_warnings, Boolean, { :default => true, :show_on_false => true }
|
516
857
|
|
517
858
|
##
|
518
|
-
# Adds directories
|
859
|
+
# Adds directories to the source path. The compiler
|
860
|
+
# searches directories in the source path for MXML or AS source
|
861
|
+
# files based on import statements and type references.
|
519
862
|
#
|
520
|
-
#
|
863
|
+
# Only those files that have been referenced will be included
|
864
|
+
# in a compiled SWF or SWC file.
|
521
865
|
#
|
522
|
-
# To
|
866
|
+
# To add the contents of a SWC file to the entity search, use
|
867
|
+
# the {#library_path} option.
|
523
868
|
#
|
524
|
-
# The source path is also used as the search path for the component
|
869
|
+
# The source path is also used as the search path for the component
|
870
|
+
# compiler's {#include_classes} and {linclude_resource_bundles} options.
|
525
871
|
#
|
526
|
-
#
|
872
|
+
# desc "Compile the Application"
|
873
|
+
# mxmlc 'bin/SomeProject.swf' do |t|
|
874
|
+
# t.input = 'src/SomeProject.mxml'
|
875
|
+
# t.source_path << 'src'
|
876
|
+
# t.source_path << 'lib/othersrc'
|
877
|
+
# t.source_path << 'lib/anothersrc'
|
878
|
+
# end
|
527
879
|
#
|
528
880
|
add_param :source_path, Paths
|
529
881
|
|
530
882
|
add_param_alias :sp, :source_path
|
531
883
|
|
532
884
|
##
|
533
|
-
# Statically link the libraries specified by the
|
885
|
+
# Statically link the libraries specified by the {#runtime_shared_libraries_path} option.
|
534
886
|
#
|
535
|
-
#
|
887
|
+
# @see #runtime_shared_libraries_path
|
536
888
|
#
|
537
889
|
add_param :static_link_runtime_shared_libraries, Boolean, { :default => true }
|
538
890
|
|
539
891
|
##
|
540
|
-
# Alias for static_link_runtime_shared_libraries
|
892
|
+
# Alias for {#static_link_runtime_shared_libraries}
|
541
893
|
#
|
542
894
|
add_param_alias :static_rsls, :static_link_runtime_shared_libraries
|
543
895
|
|
544
896
|
##
|
545
897
|
# Prints undefined property and function calls; also performs compile-time type checking on assignments and options supplied to method calls.
|
546
898
|
#
|
899
|
+
# Turning of strict typing will essentially enable Duck-Typing in the Flash Player.
|
900
|
+
#
|
547
901
|
# The default value is true.
|
548
902
|
#
|
903
|
+
# desc "Compile the Application"
|
904
|
+
# mxmlc 'bin/SomeProject.swf' do |t|
|
905
|
+
# t.input = 'src/SomeProject.mxml'
|
906
|
+
# t.source_path << 'src'
|
907
|
+
# t.strict = false
|
908
|
+
# end
|
909
|
+
#
|
549
910
|
add_param :strict, Boolean, { :default => true, :show_on_false => true }
|
550
911
|
|
551
912
|
##
|
@@ -553,6 +914,15 @@ module FlashSDK
|
|
553
914
|
#
|
554
915
|
# Features requiring a later version will not be compiled into the application. The minimum value supported is "9.0.0".
|
555
916
|
#
|
917
|
+
# Be aware that this value is a String.
|
918
|
+
#
|
919
|
+
# desc "Compile the Application"
|
920
|
+
# mxmlc 'bin/SomeProject.swf' do |t|
|
921
|
+
# t.input = 'src/SomeProject.mxml'
|
922
|
+
# t.source_path << 'src'
|
923
|
+
# t.target_player = '10'
|
924
|
+
# end
|
925
|
+
#
|
556
926
|
add_param :target_player, String
|
557
927
|
|
558
928
|
##
|
@@ -572,14 +942,22 @@ module FlashSDK
|
|
572
942
|
#
|
573
943
|
# The default value is true.
|
574
944
|
#
|
575
|
-
# When the use-network property is set to false, the application can
|
945
|
+
# When the use-network property is set to false, the application can
|
946
|
+
# access the local filesystem (for example, use the XML.load() method
|
947
|
+
# with file: URLs) but not network services. In most circumstances, the
|
948
|
+
# value of this property should be true.
|
576
949
|
#
|
577
950
|
add_param :use_network, Boolean, { :default => true, :show_on_false => true }
|
578
951
|
|
579
952
|
##
|
580
|
-
# Generates source code that includes line numbers. When
|
953
|
+
# Generates source code that includes source files and line numbers. When
|
954
|
+
# a run-time error occurs, the stacktrace shows these line numbers.
|
955
|
+
#
|
956
|
+
# Enabling this option generates larger SWF files.
|
957
|
+
#
|
958
|
+
# The default value is false.
|
581
959
|
#
|
582
|
-
#
|
960
|
+
# @see #debug
|
583
961
|
#
|
584
962
|
add_param :verbose_stacktraces, Boolean
|
585
963
|
|