sprout-as3-bundle 0.1.34 → 0.1.37

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,7 +3,7 @@ module Sprout # :nodoc:
3
3
  module VERSION #:nodoc:
4
4
  MAJOR = 0
5
5
  MINOR = 1
6
- TINY = 34
6
+ TINY = 37
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY].join('.')
9
9
  MAJOR_MINOR = [MAJOR, MINOR].join('.')
@@ -1,7 +1,7 @@
1
- sprout 'flashplayer'
1
+ sprout 'sprout-flashplayer-tool'
2
2
  require 'sprout/tasks/flashplayer_task'
3
3
  require 'sprout/tasks/fdb_task'
4
4
  require 'sprout/tasks/mxmlc_task'
5
- require 'sprout/tasks/asdoc_task'
6
5
  require 'sprout/tasks/compc_task'
6
+ require 'sprout/tasks/asdoc_task'
7
7
  require 'sprout/tasks/asunit_task'
@@ -13,6 +13,7 @@ Sprout::ProjectModel.setup do |model|
13
13
  # model.swc_dir = 'lib'
14
14
  # model.bin_dir = 'bin'
15
15
  # model.test_dir = 'test'
16
+ # model.doc_dir = 'doc'
16
17
  # model.asset_dir = 'assets'
17
18
  model.language = 'as3'
18
19
  model.output = "#{model.bin_dir}/<%= project_name %>.swf"
@@ -90,3 +91,9 @@ mxmlc model.test_output => [:asunit3, :corelib] do |t|
90
91
  t.source_path << model.test_dir
91
92
  t.source_path << model.asset_dir
92
93
  end
94
+
95
+ ############################################
96
+ # Build documentation for your application
97
+
98
+ desc "Create documentation"
99
+ asdoc model.doc_dir => model.output
@@ -0,0 +1,155 @@
1
+ module Sprout
2
+ class AsDocTask < ToolTask
3
+ # Sets the file encoding for ActionScript files. For more information see: http://livedocs.adobe.com/flex/2/docs/00001503.html#149244
4
+ def actionscript_file_encoding=(string)
5
+ @actionscript_file_encoding = string
6
+ end
7
+
8
+ # Prints detailed compile times to the standard output. The default value is true.
9
+ def benchmark=(boolean)
10
+ @benchmark = boolean
11
+ end
12
+
13
+ # A list of classes to document. These classes must be in the source path. This is the default option.
14
+ #
15
+ # This option works the same way as does the -include-classes option for the compc component compiler. For more information, see Using the component compiler (http://livedocs.adobe.com/flex/201/html/compilers_123_31.html#162910).
16
+ def doc_classes=(strings)
17
+ @doc_classes = strings
18
+ end
19
+
20
+ # A list of URIs whose classes should be documented. The classes must be in the source path.
21
+ #
22
+ # You must include a URI and the location of the manifest file that defines the contents of this namespace.
23
+ #
24
+ # This option works the same way as does the -include-namespaces option for the compc component compiler. For more information, see Using the component compiler. (http://livedocs.adobe.com/flex/201/html/compilers_123_31.html#162910)
25
+ def doc_namespaces=(strings)
26
+ @doc_namespaces = strings
27
+ end
28
+
29
+ # A list of files that should be documented. If a directory name is in the list, it is recursively searched.
30
+ #
31
+ # This option works the same way as does the -include-sources option for the compc component compiler. For more information, see Using the component compiler (http://livedocs.adobe.com/flex/201/html/compilers_123_31.html#162910).
32
+ def doc_sources=(paths)
33
+ @doc_sources = paths
34
+ end
35
+
36
+ # A list of classes that should not be documented. You must specify individual class names. Alternatively, if the ASDoc comment for the class contains the @private tag, is not documented.
37
+ def exclude_classes=(string)
38
+ @exclude_classes = string
39
+ end
40
+
41
+ # Whether all dependencies found by the compiler are documented. If true, the dependencies of the input classes are not documented.
42
+ #
43
+ # The default value is false.
44
+ def exclude_dependencies=(boolean)
45
+ @exclude_dependencies = boolean
46
+ end
47
+
48
+ # The text that appears at the bottom of the HTML pages in the output documentation.
49
+ def footer=(string)
50
+ @footer = string
51
+ end
52
+
53
+ # An integer that changes the width of the left frameset of the documentation. You can change this size to accommodate the length of your package names.
54
+ #
55
+ # The default value is 210 pixels.
56
+ def left_frameset_width=(number)
57
+ @left_frameset_width = number
58
+ end
59
+
60
+ # Links SWC files to the resulting application SWF file. The compiler only links in those classes for the SWC file that are required.
61
+ #
62
+ # The default value of the library-path option includes all SWC files in the libs directory and the current locale. These are required.
63
+ #
64
+ # To point to individual classes or packages rather than entire SWC files, use the source-path option.
65
+ #
66
+ # If you set the value of the library-path as an option of the command-line compiler, you must also explicitly add the framework.swc and locale SWC files. Your new entry is not appended to the library-path but replaces it.
67
+ #
68
+ # You can use the += operator to append the new argument to the list of existing SWC files.
69
+ #
70
+ # 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.
71
+ def library_path=(files)
72
+ @library_path = files
73
+ end
74
+
75
+ # Specifies the location of the configuration file that defines compiler options.
76
+ #
77
+ # If you specify a configuration file, you can override individual options by setting them on the command line.
78
+ #
79
+ # All relative paths in the configuration file are relative to the location of the configuration file itself.
80
+ #
81
+ # Use the += operator to chain this configuration file to other configuration files.
82
+ #
83
+ # 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).
84
+ def load_config=(file)
85
+ @load_config = file
86
+ end
87
+
88
+ # The text that appears at the top of the HTML pages in the output documentation.
89
+ #
90
+ # The default value is "API Documentation".
91
+ def main_title=(string)
92
+ @main_title = string
93
+ end
94
+
95
+ # Not sure about this option, it was in the CLI help, but not documented on the Adobe site
96
+ def namespace=(string)
97
+ @namespace = string
98
+ end
99
+
100
+ # The output directory for the generated documentation. The default value is "doc".
101
+ def output=(path)
102
+ @output = path
103
+ end
104
+
105
+ # The descriptions to use when describing a package in the documentation. You can specify more than one package option.
106
+ #
107
+ # The following example adds two package descriptions to the output:
108
+ # asdoc -doc-sources my_dir -output myDoc -package com.my.business "Contains business classes and interfaces" -package com.my.commands "Contains command base classes and interfaces"
109
+ def package=(string)
110
+ @package = string
111
+ end
112
+
113
+ # 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.
114
+ #
115
+ # You can use wildcards to include all files and subdirectories of a directory.
116
+ #
117
+ # To link an entire library SWC file and not individual classes or directories, use the library-path option.
118
+ #
119
+ # The source path is also used as the search path for the component compiler's include-classes and include-resource-bundles options.
120
+ #
121
+ # You can also use the += operator to append the new argument to the list of existing source path entries.
122
+ def source_path=(paths)
123
+ @source_path = paths
124
+ end
125
+
126
+ # Prints undefined property and function calls; also performs compile-time type checking on assignments and options supplied to method calls.
127
+ #
128
+ # The default value is true.
129
+ #
130
+ # For more information about viewing warnings and errors, see Viewing warnings and errors (http://livedocs.adobe.com/flex/2/docs/00001517.html#182413).
131
+ def strict=(boolean)
132
+ @strict = boolean
133
+ end
134
+
135
+ # The path to the ASDoc template directory. The default is the asdoc/templates directory in the ASDoc installation directory. This directory contains all the HTML, CSS, XSL, and image files used for generating the output.
136
+ def templates_path=(paths)
137
+ @templates_path = paths
138
+ end
139
+
140
+ # Enables all warnings. Set to false to disable all warnings. This option overrides the warn-warning_type options.
141
+ #
142
+ # The default value is true.
143
+ def warnings=(boolean)
144
+ @warnings = boolean
145
+ end
146
+
147
+ # The text that appears in the browser window in the output documentation.
148
+ #
149
+ # The default value is "API Documentation".
150
+ def window_title=(string)
151
+ @window_title = string
152
+ end
153
+
154
+ end
155
+ end
@@ -2,15 +2,10 @@
2
2
 
3
3
  module Sprout
4
4
  #
5
- # *NOTE:* The AsDoc task has not yet been built, please let us know[http://groups.google.com/group/projectsprouts] if you're interested in contributing!
6
- # http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Book_Parts&file=asdoc_127_9.html#142061
7
- #
8
- # The AsDoc Task will provide Rake support for the asdoc documentation engine.
9
- # The main idea behind this task is that one would simply name it after
10
- # the documentation directory, and set an Sprout::MXMLCTask as a prerequisite.
11
- # Then AsDoc should grab all of the compiler settings from the MXMLCTask and
12
- # generate the documentation as expected. Of course any parameters set directly
13
- # would override what is found from the compiler task.
5
+ # The AsDoc Task provides Rake support for the asdoc documentation engine.
6
+ # If a Sprout::MXMLCTask or Sprout::COMPCTask are found as prerequisites
7
+ # to the AsDoc task, AsDoc will inherit the source_path and library_path
8
+ # from those tasks. You can also configure AsDoc normally if you wish.
14
9
  #
15
10
  # This configuration might look something like this:
16
11
  #
@@ -26,14 +21,256 @@ module Sprout
26
21
  # t.input = 'src/SomeProject.as'
27
22
  # t.default_size = '800 600'
28
23
  # t.default_background_color = "#FFFFFF"
24
+ # t.source_path << 'src'
25
+ # t.source_path << 'lib/asunit'
26
+ # t.source_path << 'test'
29
27
  # end
30
28
  #
31
29
  # desc "Generate documentation"
32
- # asdoc 'doc' => 'bin/SomeProject.swf'
30
+ # asdoc :doc => 'bin/SomeProject.swf'
33
31
  #
34
- # This would then generate documentation in the relative path, 'doc', but only if
35
- # The contents of the documentation directory werer older than the sources referenced by the compiler.
32
+ # This configuration will generate documentation in the relative path, 'doc', but only if
33
+ # The contents of the documentation directory are older than the sources referenced by the compiler.
36
34
  #
37
- class AsDocTask < MXMLCTask
35
+ # For more information about using the asdoc command line compiler, check livedocs at:
36
+ # http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Book_Parts&file=asdoc_127_1.html
37
+ #
38
+ class AsDocTask < ToolTask
39
+
40
+ def initialize_task
41
+ super
42
+ @default_gem_name = 'sprout-flex2sdk-tool'
43
+ @default_gem_path = 'bin/asdoc'
44
+
45
+ add_param(:actionscript_file_encoding, :string) do |p|
46
+ p.description = "Sets the file encoding for ActionScript files. For more information see: http://livedocs.adobe.com/flex/2/docs/00001503.html#149244"
47
+ end
48
+
49
+ add_param(:benchmark, :boolean) do |p|
50
+ p.value = true
51
+ p.show_on_false = true
52
+ p.description = "Prints detailed compile times to the standard output. The default value is true."
53
+ end
54
+
55
+ add_param(:doc_classes, :strings) do |p|
56
+ p.description =<<EOF
57
+ A list of classes to document. These classes must be in the source path. This is the default option.
58
+
59
+ This option works the same way as does the -include-classes option for the compc component compiler. For more information, see Using the component compiler (http://livedocs.adobe.com/flex/201/html/compilers_123_31.html#162910).
60
+ EOF
61
+ end
62
+
63
+ add_param(:doc_namespaces, :strings) do |p|
64
+ p.description =<<EOF
65
+ A list of URIs whose classes should be documented. The classes must be in the source path.
66
+
67
+ You must include a URI and the location of the manifest file that defines the contents of this namespace.
68
+
69
+ This option works the same way as does the -include-namespaces option for the compc component compiler. For more information, see Using the component compiler. (http://livedocs.adobe.com/flex/201/html/compilers_123_31.html#162910)
70
+ EOF
71
+ end
72
+
73
+ add_param(:doc_sources, :paths) do |p|
74
+ p.description =<<EOF
75
+ A list of files that should be documented. If a directory name is in the list, it is recursively searched.
76
+
77
+ This option works the same way as does the -include-sources option for the compc component compiler. For more information, see Using the component compiler (http://livedocs.adobe.com/flex/201/html/compilers_123_31.html#162910).
78
+ EOF
79
+ end
80
+
81
+ add_param(:exclude_classes, :string) do |p|
82
+ p.description =<<EOF
83
+ A list of classes that should not be documented. You must specify individual class names. Alternatively, if the ASDoc comment for the class contains the @private tag, is not documented.
84
+ EOF
85
+ end
86
+
87
+ add_param(:exclude_dependencies, :boolean) do |p|
88
+ p.description =<<EOF
89
+ Whether all dependencies found by the compiler are documented. If true, the dependencies of the input classes are not documented.
90
+
91
+ The default value is false.
92
+ EOF
93
+ end
94
+
95
+ add_param(:footer, :string) do |p|
96
+ p.description =<<EOF
97
+ The text that appears at the bottom of the HTML pages in the output documentation.
98
+ EOF
99
+ end
100
+
101
+ add_param(:left_frameset_width, :number) do |p|
102
+ p.description =<<EOF
103
+ An integer that changes the width of the left frameset of the documentation. You can change this size to accommodate the length of your package names.
104
+
105
+ The default value is 210 pixels.
106
+ EOF
107
+ end
108
+
109
+ add_param(:library_path, :files) do |p|
110
+ p.description =<<EOF
111
+ Links SWC files to the resulting application SWF file. The compiler only links in those classes for the SWC file that are required.
112
+
113
+ The default value of the library-path option includes all SWC files in the libs directory and the current locale. These are required.
114
+
115
+ To point to individual classes or packages rather than entire SWC files, use the source-path option.
116
+
117
+ If you set the value of the library-path as an option of the command-line compiler, you must also explicitly add the framework.swc and locale SWC files. Your new entry is not appended to the library-path but replaces it.
118
+
119
+ You can use the += operator to append the new argument to the list of existing SWC files.
120
+
121
+ 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.
122
+ EOF
123
+ end
124
+
125
+ add_param(:load_config, :file) do |p|
126
+ p.description =<<EOF
127
+ Specifies the location of the configuration file that defines compiler options.
128
+
129
+ If you specify a configuration file, you can override individual options by setting them on the command line.
130
+
131
+ All relative paths in the configuration file are relative to the location of the configuration file itself.
132
+
133
+ Use the += operator to chain this configuration file to other configuration files.
134
+
135
+ 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).
136
+ EOF
137
+ end
138
+
139
+ add_param(:main_title, :string) do |p|
140
+ p.description =<<EOF
141
+ The text that appears at the top of the HTML pages in the output documentation.
142
+
143
+ The default value is "API Documentation".
144
+ EOF
145
+ end
146
+
147
+ add_param(:namespace, :string) do |p|
148
+ p.description =<<EOF
149
+ Not sure about this option, it was in the CLI help, but not documented on the Adobe site
150
+ EOF
151
+ end
152
+
153
+ add_param(:output, :path) do |p|
154
+ p.value = 'doc'
155
+ p.description =<<EOF
156
+ The output directory for the generated documentation. The default value is "doc".
157
+ EOF
158
+ end
159
+
160
+ add_param(:package, :string) do |p|
161
+ p.description =<<EOF
162
+ The descriptions to use when describing a package in the documentation. You can specify more than one package option.
163
+
164
+ The following example adds two package descriptions to the output:
165
+ asdoc -doc-sources my_dir -output myDoc -package com.my.business "Contains business classes and interfaces" -package com.my.commands "Contains command base classes and interfaces"
166
+ EOF
167
+ end
168
+
169
+ add_param(:source_path, :paths) do |p|
170
+ p.description =<<EOF
171
+ 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.
172
+
173
+ You can use wildcards to include all files and subdirectories of a directory.
174
+
175
+ To link an entire library SWC file and not individual classes or directories, use the library-path option.
176
+
177
+ The source path is also used as the search path for the component compiler's include-classes and include-resource-bundles options.
178
+
179
+ You can also use the += operator to append the new argument to the list of existing source path entries.
180
+ EOF
181
+ end
182
+
183
+ add_param(:strict, :boolean) do |p|
184
+ p.value = true
185
+ p.show_on_false = true
186
+ p.description =<<EOF
187
+ Prints undefined property and function calls; also performs compile-time type checking on assignments and options supplied to method calls.
188
+
189
+ The default value is true.
190
+
191
+ For more information about viewing warnings and errors, see Viewing warnings and errors (http://livedocs.adobe.com/flex/2/docs/00001517.html#182413).
192
+ EOF
193
+ end
194
+
195
+ add_param(:templates_path, :paths) do |p|
196
+ p.description =<<EOF
197
+ The path to the ASDoc template directory. The default is the asdoc/templates directory in the ASDoc installation directory. This directory contains all the HTML, CSS, XSL, and image files used for generating the output.
198
+ EOF
199
+ end
200
+
201
+ add_param(:warnings, :boolean) do |p|
202
+ p.description =<<EOF
203
+ Enables all warnings. Set to false to disable all warnings. This option overrides the warn-warning_type options.
204
+
205
+ The default value is true.
206
+ EOF
207
+ end
208
+
209
+ add_param(:window_title, :string) do |p|
210
+ p.description =<<EOF
211
+ The text that appears in the browser window in the output documentation.
212
+
213
+ The default value is "API Documentation".
214
+ EOF
215
+ end
216
+ end
217
+
218
+ def define # :nodoc:
219
+ super
220
+ validate_templates
221
+ CLEAN.add(output)
222
+ end
223
+
224
+ def prepare
225
+ super
226
+ prerequisite = nil
227
+ @prerequisites.each do |req|
228
+ prerequisite = @application[req]
229
+ if(prerequisite.is_a?(MXMLCTask))
230
+ prerequisite.source_path.each do |path|
231
+ doc_sources << path
232
+ end
233
+ prerequisite.library_path.each do |path|
234
+ library_path << path
235
+ end
236
+ end
237
+ end
238
+ end
239
+
240
+ protected
241
+
242
+ def validate_templates
243
+ if(templates_path.size == 0)
244
+ templates_dir = Sprout.get_executable(gem_name, 'asdoc/templates', gem_version)
245
+ templates_path << templates_dir
246
+ end
247
+ end
248
+
249
+ def execute(*args)
250
+ update_helper_mode
251
+ begin
252
+ super
253
+ rescue ExecutionError => e
254
+ if(e.message.index('Warning:'))
255
+ # MXMLC sends warnings to stderr....
256
+ Log.puts(e.message.gsub('[ERROR]', '[WARNING]'))
257
+ else
258
+ raise e
259
+ end
260
+ end
261
+ end
262
+
263
+ # The AsDoc packaage includes an asDocHelper binary that is packaged up without
264
+ # the executable flag, calling Sprout::get_executable with this target will
265
+ # automatically chmod it to 744.
266
+ def update_helper_mode
267
+ exe = Sprout.get_executable('sprout-flex2sdk-tool', 'asdoc/templates/asDocHelper', gem_version)
268
+ end
269
+
38
270
  end
39
- end
271
+ end
272
+
273
+ def asdoc(args, &block)
274
+ Sprout::AsDocTask.define_task(args, &block)
275
+ end
276
+
@@ -480,29 +480,64 @@ def input=(file)
480
480
  @input = file
481
481
  end
482
482
 
483
+ # Outputs the SWC file in an open directory format rather than a SWC file. You use this option with the output option to specify a destination directory, as the following example shows:
484
+ # compc -directory -output destination_directory
485
+ #
486
+ # You use this option when you create RSLs. For more information, see Using Runtime Shared Libraries (http://livedocs.adobe.com/flex/201/html/rsl_124_1.html#168690).
487
+ def directory=(boolean)
488
+ @directory = boolean
489
+ end
490
+
491
+ # Specifies classes to include in the SWC file. You provide the class name (for example, MyClass) rather than the file name (for example, MyClass.as) to the file for this option. As a result, all classes specified with this option must be in the compiler's source path. You specify this by using the source-path compiler option.
492
+ #
493
+ # You can use packaged and unpackaged classes. To use components in namespaces, use the include-namespaces option.
494
+ #
495
+ # If the components are in packages, ensure that you use dot-notation rather than slashes to separate package levels.
496
+ #
497
+ # This is the default option for the component compiler.
483
498
  def include_classes=(symbols)
484
499
  @include_classes = symbols
485
500
  end
486
501
 
487
- def include_file=(file)
488
- @include_file = file
502
+ # Adds the file to the SWC file. This option does not embed files inside the library.swf file. This is useful for skinning and theming, where you want to add non-compiled files that can be referenced in a style sheet or embedded as assets in MXML files.
503
+ #
504
+ # If you use the [Embed] syntax to add a resource to your application, you are not required to use this option to also link it into the SWC file.
505
+ #
506
+ # For more information, see Adding nonsource classes (http://livedocs.adobe.com/flex/201/html/compilers_123_39.html#158900).
507
+ def include_file=(files)
508
+ @include_file = files
489
509
  end
490
510
 
511
+ #
491
512
  def include_lookup_only=(boolean)
492
513
  @include_lookup_only = boolean
493
514
  end
494
515
 
516
+ # Specifies namespace-style components in the SWC file. You specify a list of URIs to include in the SWC file. The uri argument must already be defined with the namespace option.
517
+ #
518
+ # To use components in packages, use the include-classes option.
495
519
  def include_namespaces=(urls)
496
520
  @include_namespaces = urls
497
521
  end
498
522
 
523
+ # Specifies the resource bundles to include in this SWC file. All resource bundles specified with this option must be in the compiler's source path. You specify this using the source-path compiler option.
524
+ #
525
+ # For more information on using resource bundles, see Localizing Flex Applications (http://livedocs.adobe.com/flex/201/html/l10n_076_1.html#129288) in Flex 2 Developer's Guide.
499
526
  def include_resource_bundles=(files)
500
527
  @include_resource_bundles = files
501
528
  end
502
529
 
530
+ # Specifies classes or directories to add to the SWC file. When specifying classes, you specify the path to the class file (for example, MyClass.as) rather than the class name itself (for example, MyClass). This lets you add classes to the SWC file that are not in the source path. In general, though, use the include-classes option, which lets you add classes that are in the source path.
531
+ #
532
+ # If you specify a directory, this option includes all files with an MXML or AS extension, and ignores all other files.
503
533
  def include_sources=(paths)
504
534
  @include_sources = paths
505
535
  end
506
536
 
537
+ # Not sure about this option, it was in the CLI help, but not documented on the Adobe site
538
+ def namespace=(string)
539
+ @namespace = string
540
+ end
541
+
507
542
  end
508
543
  end
@@ -19,48 +19,6 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19
19
  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20
20
  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21
21
  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
-
23
- Example compile directive from Mike Chambers at:
24
- http://www.mikechambers.com/blog/2006/05/19/quick-example-using-compc-to-compile-swcs/
25
-
26
- compc -namespace http://www.adobe.com/2006/foo manifest.xml -source-path .
27
- -include-namespaces http://www.adobe.com/2006/foo -include-classes mx.containers.MyWindow
28
- -include-file MyWindow.png mx/containers/MyWindow.png
29
- -output='MyWindow.swc'
30
-
31
- manifext.xml file:
32
- <?xml version="1.0"?>
33
- <componentPackage>
34
- <component id="MyWindow" class="mx.containers.MyWindow"/>
35
- </componentPackage>
36
-
37
- ------------------------------
38
-
39
- Following is a diff of advanced options between compc and mxmlc:
40
-
41
- diff compc.advanced mxmlc.advanced
42
- 1c1
43
- < Adobe Flex Compiler (compc)
44
- ---
45
- > Adobe Flex Compiler (mxmlc)
46
- 82d81
47
- < -directory
48
- 87,92d85
49
- < -include-classes [class] [...]
50
- < -include-file <name> <path>
51
- < -include-lookup-only
52
- < -include-namespaces [uri] [...]
53
- < -include-resource-bundles [bundle] [...]
54
- < -include-sources [path-element] [...]
55
- 112a106
56
- > -warnings
57
-
58
- ------------------------------
59
-
60
- TODO: compc tasks:
61
- * Autogenerate the manifest based on a directory or FileList
62
- * Allow manual assignment of the manifest (instead of generated file)
63
-
64
22
  =end
65
23
 
66
24
  module Sprout
@@ -69,22 +27,94 @@ module Sprout
69
27
  class ExecutionError < StandardError #:nodoc:
70
28
  end
71
29
 
72
- # The COMPCTask should work almost identically to the Sprout::MXMLCTask. We haven't
73
- # taken the time to investigate it fully, if you are able to get it working please submit
74
- # sample code to the list at: projectsprouts@googlegroups.com
30
+ # The COMPCTask will emit SWC files that are usually used to easily distribute and include
31
+ # shared functionality.
32
+ #
33
+ # This task represents a superset of the features available to the MXMLCTask.
34
+ #
35
+ # A simple COMPC instance is as follows:
36
+ #
37
+ # compc 'bin/SomeLibrary.swc' do |t|
38
+ # t.input = 'SomeLibrary' # Class name, not file name
39
+ # t.source_path << 'src'
40
+ # t.source_path << 'test'
41
+ # end
42
+ #
75
43
  class COMPCTask < MXMLCTask
76
- DEFAULT_GEM_NAME = 'sprout-flex2sdk-tool'
77
- DEFAULT_GEM_PATH = 'bin/compc'
78
44
 
79
45
  def initialize_task
80
46
  super
81
- add_param(:include_classes, :symbols)
47
+ @default_gem_name = 'sprout-flex2sdk-tool'
48
+ @default_gem_path = 'bin/compc'
49
+
50
+ add_param(:directory, :boolean) do |p|
51
+ p.hidden_value = true
52
+ p.description =<<EOF
53
+ Outputs the SWC file in an open directory format rather than a SWC file. You use this option with the output option to specify a destination directory, as the following example shows:
54
+ compc -directory -output destination_directory
55
+
56
+ You use this option when you create RSLs. For more information, see Using Runtime Shared Libraries (http://livedocs.adobe.com/flex/201/html/rsl_124_1.html#168690).
57
+ EOF
58
+ end
59
+
60
+ add_param(:include_classes, :symbols) do |p|
61
+ p.description =<<EOF
62
+ Specifies classes to include in the SWC file. You provide the class name (for example, MyClass) rather than the file name (for example, MyClass.as) to the file for this option. As a result, all classes specified with this option must be in the compiler's source path. You specify this by using the source-path compiler option.
63
+
64
+ You can use packaged and unpackaged classes. To use components in namespaces, use the include-namespaces option.
65
+
66
+ If the components are in packages, ensure that you use dot-notation rather than slashes to separate package levels.
67
+
68
+ This is the default option for the component compiler.
69
+ EOF
70
+ end
71
+
82
72
  add_param_alias(:ic, :include_classes)
83
- add_param(:include_file, :file)
84
- add_param(:include_lookup_only, :boolean)
85
- add_param(:include_namespaces, :urls)
86
- add_param(:include_resource_bundles, :files)
87
- add_param(:include_sources, :paths)
73
+
74
+ add_param(:include_file, :files) do |p|
75
+ p.description =<<EOF
76
+ Adds the file to the SWC file. This option does not embed files inside the library.swf file. This is useful for skinning and theming, where you want to add non-compiled files that can be referenced in a style sheet or embedded as assets in MXML files.
77
+
78
+ If you use the [Embed] syntax to add a resource to your application, you are not required to use this option to also link it into the SWC file.
79
+
80
+ For more information, see Adding nonsource classes (http://livedocs.adobe.com/flex/201/html/compilers_123_39.html#158900).
81
+ EOF
82
+ end
83
+
84
+ add_param(:include_lookup_only, :boolean) do |p|
85
+ p.description =<<EOF
86
+ EOF
87
+ end
88
+
89
+ add_param(:include_namespaces, :urls) do |p|
90
+ p.description =<<EOF
91
+ Specifies namespace-style components in the SWC file. You specify a list of URIs to include in the SWC file. The uri argument must already be defined with the namespace option.
92
+
93
+ To use components in packages, use the include-classes option.
94
+ EOF
95
+ end
96
+
97
+ add_param(:include_resource_bundles, :files) do |p|
98
+ p.description =<<EOF
99
+ Specifies the resource bundles to include in this SWC file. All resource bundles specified with this option must be in the compiler's source path. You specify this using the source-path compiler option.
100
+
101
+ For more information on using resource bundles, see Localizing Flex Applications (http://livedocs.adobe.com/flex/201/html/l10n_076_1.html#129288) in Flex 2 Developer's Guide.
102
+ EOF
103
+ end
104
+
105
+ add_param(:include_sources, :paths) do |p|
106
+ p.description =<<EOF
107
+ Specifies classes or directories to add to the SWC file. When specifying classes, you specify the path to the class file (for example, MyClass.as) rather than the class name itself (for example, MyClass). This lets you add classes to the SWC file that are not in the source path. In general, though, use the include-classes option, which lets you add classes that are in the source path.
108
+
109
+ If you specify a directory, this option includes all files with an MXML or AS extension, and ignores all other files.
110
+ EOF
111
+ end
112
+
113
+ add_param(:namespace, :string) do |p|
114
+ p.description =<<EOF
115
+ Not sure about this option, it was in the CLI help, but not documented on the Adobe site
116
+ EOF
117
+ end
88
118
  end
89
119
 
90
120
  def execute(*args)
@@ -95,6 +125,6 @@ module Sprout
95
125
  end
96
126
 
97
127
  def compc(args, &block)
98
- Sprout::MXMLCTask.define_task(args, &block)
128
+ Sprout::COMPCTask.define_task(args, &block)
99
129
  end
100
130
 
data/rakefile.rb CHANGED
@@ -25,6 +25,7 @@ lib_dir = File.dirname(__FILE__) + '/lib'
25
25
 
26
26
  add_tool(lib_dir + '/sprout/tasks/mxmlc_task.rb', Sprout::MXMLCTask)
27
27
  add_tool(lib_dir + '/sprout/tasks/compc_task.rb', Sprout::COMPCTask)
28
+ add_tool(lib_dir + '/sprout/tasks/asdoc_task.rb', Sprout::AsDocTask)
28
29
  #########################
29
30
 
30
31
  PKG_LIST = FileList['[a-zA-Z]*',
@@ -58,7 +59,7 @@ spec = Gem::Specification.new do |s|
58
59
  s.rdoc_options << '-i' << '.'
59
60
  s.files = PKG_LIST.to_a
60
61
 
61
- s.add_dependency('sprout', '>= 0.7.158')
62
+ s.add_dependency('sprout', '>= 0.7.167')
62
63
  s.add_dependency('sprout-flashplayer-bundle')
63
64
  end
64
65
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sprout-as3-bundle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.34
4
+ version: 0.1.37
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pattern Park
@@ -9,7 +9,7 @@ autorequire: sprout/as3
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-02-23 00:00:00 -08:00
12
+ date: 2008-02-24 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -19,7 +19,7 @@ dependencies:
19
19
  requirements:
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 0.7.158
22
+ version: 0.7.167
23
23
  version:
24
24
  - !ruby/object:Gem::Dependency
25
25
  name: sprout-flashplayer-bundle
@@ -86,6 +86,7 @@ files:
86
86
  - lib/sprout/generators/test/test_generator.rb
87
87
  - lib/sprout/generators/test/USAGE
88
88
  - lib/sprout/tasks
89
+ - lib/sprout/tasks/asdoc_doc.rb
89
90
  - lib/sprout/tasks/asdoc_task.rb
90
91
  - lib/sprout/tasks/asunit_task.rb
91
92
  - lib/sprout/tasks/compc_doc.rb