flashsdk 1.0.13.pre → 1.0.14.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.
Files changed (46) hide show
  1. data/Gemfile +1 -1
  2. data/Gemfile.lock +2 -4
  3. data/VERSION +1 -1
  4. data/lib/flashplayer/specification.rb +39 -35
  5. data/lib/flashplayer/system_mixins.rb +2 -5
  6. data/lib/flashplayer/task.legacy.rb +1 -1
  7. data/lib/flashsdk/adl.rb +5 -2
  8. data/lib/flashsdk/adt.rb +1 -2
  9. data/lib/flashsdk/amxmlc.rb +1 -2
  10. data/lib/flashsdk/compc.rb +0 -1
  11. data/lib/flashsdk/compiler_base.rb +111 -61
  12. data/lib/flashsdk/fcsh.rb +65 -0
  13. data/lib/flashsdk/fcsh_client.rb +36 -0
  14. data/lib/flashsdk/fdb.rb +767 -0
  15. data/lib/flashsdk/generators/class_generator.rb +37 -12
  16. data/lib/flashsdk/generators/flash_helper.rb +119 -23
  17. data/lib/flashsdk/module.rb +99 -1
  18. data/lib/flashsdk/mxmlc.rb +34 -8
  19. data/lib/flashsdk.rb +2 -0
  20. data/lib/flex3.rb +10 -9
  21. data/lib/flex4.rb +29 -0
  22. data/test/fixtures/sdk/fdb +62 -0
  23. data/test/fixtures/sdk/mxmlc +54 -0
  24. data/test/unit/adl_test.rb +1 -3
  25. data/test/unit/adt_test.rb +2 -3
  26. data/test/unit/amxmlc_test.rb +4 -2
  27. data/test/unit/class_generator_test.rb +1 -1
  28. data/test/unit/compc_test.rb +1 -2
  29. data/test/unit/fcsh_test.rb +35 -0
  30. data/test/unit/fdb_test.rb +49 -0
  31. data/test/unit/flash_helper_test.rb +21 -5
  32. data/test/unit/flashplayer_log_file_test.rb +2 -2
  33. data/test/unit/flashplayer_mm_config_test.rb +1 -1
  34. data/test/unit/flashplayer_module_test.rb +1 -1
  35. data/test/unit/flashplayer_task_test.rb +2 -2
  36. data/test/unit/flashplayer_trust_test.rb +1 -1
  37. data/test/unit/flex_generator_test.rb +1 -1
  38. data/test/unit/mxmlc_test.rb +27 -5
  39. data/test/unit/project_generator_test.rb +1 -1
  40. data/test/unit/test_helper.rb +3 -1
  41. data/test-stderr.log +1 -0
  42. data/test-stdout.log +58 -0
  43. metadata +15 -9
  44. data/lib/flashsdk/compc_legacy.rb +0 -149
  45. data/lib/flashsdk/mxmlc_legacy.rb +0 -135
  46. data/mate +0 -0
@@ -1,149 +0,0 @@
1
- =begin
2
- Copyright (c) 2007 Pattern Park
3
-
4
- Permission is hereby granted, free of charge, to any person obtaining
5
- a copy of this software and associated documentation files (the
6
- "Software"), to deal in the Software without restriction, including
7
- without limitation the rights to use, copy, modify, merge, publish,
8
- distribute, sublicense, and/or sell copies of the Software, and to
9
- permit persons to whom the Software is furnished to do so, subject to
10
- the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be
13
- included in all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
- =end
23
-
24
- module Sprout
25
- class COMPCError < StandardError #:nodoc:
26
- end
27
- class ExecutionError < StandardError #:nodoc:
28
- end
29
-
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
- #
43
- class COMPCTask < MXMLCTask
44
-
45
- def initialize_task
46
- super
47
- @default_gem_name = 'sprout-flex3sdk-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.to_shell_proc = Proc.new {|param|
62
- return if(param.value.nil?)
63
-
64
- if(param.value.is_a? Array)
65
- "-include-classes #{param.value.join(' ')}"
66
- else
67
- "-include-classes #{param.value}"
68
- end
69
- }
70
- p.description =<<EOF
71
- 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.
72
-
73
- You can use packaged and unpackaged classes. To use components in namespaces, use the include-namespaces option.
74
-
75
- If the components are in packages, ensure that you use dot-notation rather than slashes to separate package levels.
76
-
77
- This is the default option for the component compiler.
78
- EOF
79
- end
80
-
81
- add_param_alias(:ic, :include_classes)
82
-
83
- add_param(:include_file, :files) do |p|
84
- p.description =<<EOF
85
- 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.
86
-
87
- 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.
88
-
89
- For more information, see Adding nonsource classes (http://livedocs.adobe.com/flex/201/html/compilers_123_39.html#158900).
90
- EOF
91
- end
92
-
93
- add_param(:include_lookup_only, :boolean) do |p|
94
- p.description =<<EOF
95
- EOF
96
- end
97
-
98
- add_param(:include_namespaces, :urls) do |p|
99
- p.description =<<EOF
100
- 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.
101
-
102
- To use components in packages, use the include-classes option.
103
- EOF
104
- end
105
-
106
- add_param(:include_resource_bundles, :files) do |p|
107
- p.description =<<EOF
108
- 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.
109
-
110
- 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.
111
- EOF
112
- end
113
-
114
- add_param(:include_sources, :paths) do |p|
115
- p.preprocessable = true
116
- p.description =<<EOF
117
- 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.
118
-
119
- If you specify a directory, this option includes all files with an MXML or AS extension, and ignores all other files.
120
- EOF
121
- end
122
-
123
- add_param(:namespace, :string) do |p|
124
- p.description =<<EOF
125
- Not sure about this option, it was in the CLI help, but not documented on the Adobe site
126
- EOF
127
- end
128
-
129
- # Move the input param to the end of the stack:
130
- input_param = nil
131
- params.each_index do |index|
132
- param = params[index]
133
- if(param.name == 'input')
134
- input_param = param
135
- params.slice!(index, 1)
136
- break
137
- end
138
- end
139
- params << input_param unless input_param.nil?
140
-
141
- end
142
-
143
- end
144
- end
145
-
146
- def compc(args, &block)
147
- Sprout::COMPCTask.define_task(args, &block)
148
- end
149
-
@@ -1,135 +0,0 @@
1
-
2
- =begin
3
- def define # :nodoc:
4
- super
5
-
6
- if(!output)
7
- if(name.match(/.swf/) || name.match(/swc/))
8
- self.output = name
9
- end
10
- end
11
-
12
- if(input && !input.match(/.css/) && File.exists?(input))
13
- source_path << File.dirname(input)
14
- end
15
-
16
- if(include_path)
17
- include_path.each do |path|
18
- process_include_path(path) if(File.directory?(path))
19
- end
20
- end
21
-
22
- self.include_path = []
23
-
24
- if(link_report)
25
- CLEAN.add(link_report)
26
- end
27
-
28
- source_path.uniq!
29
- param_hash['source_path'].value = clean_nested_source_paths(source_path)
30
-
31
- CLEAN.add(output)
32
- if(incremental)
33
- CLEAN.add(FileList['**/**/*.cache'])
34
- end
35
-
36
- self
37
- end
38
-
39
- protected
40
-
41
- def process_include_path(path)
42
- symbols = []
43
- FileList["#{path}/**/*[.as|.mxml]"].each do |file|
44
- next if File.directory?(file)
45
- file.gsub!(path, '')
46
- file.gsub!(/^\//, '')
47
- file.gsub!('/', '.')
48
- file.gsub!(/.as$/, '')
49
- file.gsub!(/.mxml$/, '')
50
- file.gsub!(/.css$/, '')
51
- symbols << file
52
- end
53
-
54
- symbols.each do |symbol|
55
- self.includes << symbol
56
- end
57
- end
58
-
59
- def clean_nested_source_paths(paths)
60
- results = []
61
- paths.each do |path|
62
- # TODO: This should only happen if: allow_source_path_overlap != true
63
- if(check_nested_source_path(results, path))
64
- results << path
65
- end
66
- end
67
- return results
68
- end
69
-
70
- def check_nested_source_path(array, path)
71
- array.each_index do |index|
72
- item = array[index]
73
- if(item =~ /^#{path}/)
74
- array.slice!(index, 1)
75
- elsif(path =~ /^#{item}/)
76
- return false
77
- end
78
- end
79
- return true
80
- end
81
-
82
- # Use the swc path if possible
83
- # Otherwise add to source
84
- def resolve_library(library_task)
85
- #TODO: Add support for libraries that don't get
86
- # copied into the project
87
- path = library_task.project_path
88
- if(path.match(/.swc$/))
89
- library_path << library_task.project_path
90
- else
91
- source_path << library_task.project_path
92
- end
93
- end
94
-
95
- def execute_with_fcsh(command)
96
- begin
97
- display_preprocess_message
98
- puts FCSHSocket.execute("mxmlc #{command}")
99
- rescue FCSHError => fcsh_error
100
- raise fcsh_error
101
- rescue StandardError => std_error
102
- # TODO: Capture a more concrete error here...
103
- raise MXMLCError.new("[ERROR] There was a problem connecting to the Flex Compiler SHell, run 'rake fcsh:start' in another terminal.")
104
- end
105
- end
106
-
107
- def execute(*args)
108
- begin
109
- start = Time.now.to_i
110
- if(@use_fcsh)
111
- execute_with_fcsh(to_shell)
112
- else
113
- super
114
- end
115
- Log.puts "mxmlc finished compiling #{name} in #{Time.now.to_i - start} seconds"
116
- rescue ExecutionError => e
117
- if(e.message.index('Warning:'))
118
- # MXMLC sends warnings to stderr....
119
- Log.puts(e.message.gsub('[ERROR]', '[WARNING]'))
120
- else
121
- raise e
122
- end
123
- end
124
- end
125
-
126
- end
127
- end
128
-
129
- # Helper method for definining and accessing MXMLC instances in a rakefile
130
- def mxmlc(args, &block)
131
- AS3::MXMLC.define_task(args, &block)
132
- end
133
-
134
- =end
135
-
data/mate DELETED
File without changes