sprout 0.7.246 → 1.0.0.pre
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of sprout might be problematic. Click here for more details.
- data/CHANGELOG.md +10 -0
- data/Gemfile +28 -0
- data/MIT-LICENSE +3 -2
- data/POSTINSTALL.rdoc +28 -0
- data/README.textile +152 -0
- data/bin/sprout +1 -131
- data/bin/sprout-generator +10 -0
- data/bin/sprout-library +11 -0
- data/bin/sprout-tool +10 -0
- data/lib/sprout.rb +4 -500
- data/lib/sprout/archive_unpacker.rb +122 -206
- data/lib/sprout/base.rb +90 -0
- data/lib/sprout/concern.rb +30 -0
- data/lib/sprout/dir.rb +23 -0
- data/lib/sprout/errors.rb +94 -0
- data/lib/sprout/executable.rb +496 -0
- data/lib/sprout/executable/boolean.rb +35 -0
- data/lib/sprout/executable/collection_param.rb +53 -0
- data/lib/sprout/executable/file_param.rb +53 -0
- data/lib/sprout/executable/files.rb +26 -0
- data/lib/sprout/executable/number.rb +10 -0
- data/lib/sprout/executable/param.rb +222 -0
- data/lib/sprout/executable/parameter_factory.rb +28 -0
- data/lib/sprout/executable/path.rb +21 -0
- data/lib/sprout/executable/paths.rb +21 -0
- data/lib/sprout/executable/string_param.rb +15 -0
- data/lib/sprout/executable/strings.rb +11 -0
- data/lib/sprout/executable/url.rb +10 -0
- data/lib/sprout/executable/urls.rb +10 -0
- data/lib/sprout/file_target.rb +76 -0
- data/lib/sprout/generator/base.rb +233 -0
- data/lib/sprout/generator/command.rb +67 -0
- data/lib/sprout/generator/directory_manifest.rb +49 -0
- data/lib/sprout/generator/file_manifest.rb +55 -0
- data/lib/sprout/generator/manifest.rb +13 -0
- data/lib/sprout/generator/template_manifest.rb +13 -0
- data/lib/sprout/generators/generator/generator_generator.rb +48 -0
- data/lib/sprout/generators/generator/templates/generator_class.rb +17 -0
- data/lib/sprout/generators/generator/templates/generator_executable +9 -0
- data/lib/sprout/generators/generator/templates/generator_template +1 -0
- data/lib/sprout/generators/generator/templates/generator_test.rb +37 -0
- data/lib/sprout/generators/generator/templates/generator_test_helper.rb +16 -0
- data/lib/sprout/generators/library/library_generator.rb +20 -0
- data/lib/sprout/generators/library/templates/library.gemspec +19 -0
- data/lib/sprout/generators/library/templates/library.rb +15 -0
- data/lib/sprout/generators/ruby/ruby_generator.rb +59 -0
- data/lib/sprout/generators/ruby/templates/ruby_base.rb +10 -0
- data/lib/sprout/generators/ruby/templates/ruby_executable +6 -0
- data/lib/sprout/generators/ruby/templates/ruby_gemfile +4 -0
- data/lib/sprout/generators/ruby/templates/ruby_input.rb +7 -0
- data/lib/sprout/generators/tool/templates/Gemfile +4 -0
- data/lib/sprout/generators/tool/templates/tool.gemspec +22 -0
- data/lib/sprout/generators/tool/templates/tool.rb +38 -0
- data/lib/sprout/generators/tool/tool_generator.rb +36 -0
- data/lib/sprout/library.rb +111 -0
- data/lib/sprout/log.rb +1 -0
- data/lib/sprout/platform.rb +71 -0
- data/lib/sprout/process_runner.rb +80 -40
- data/lib/sprout/progress_bar.rb +341 -0
- data/lib/sprout/rdoc_parser.rb +91 -0
- data/lib/sprout/remote_file_loader.rb +72 -50
- data/lib/sprout/remote_file_target.rb +44 -152
- data/lib/sprout/ruby_feature.rb +167 -0
- data/lib/sprout/specification.rb +197 -0
- data/lib/sprout/string.rb +19 -0
- data/lib/sprout/system.rb +35 -0
- data/lib/sprout/system/base_system.rb +225 -0
- data/lib/sprout/system/java_system.rb +9 -0
- data/lib/sprout/system/osx_system.rb +26 -0
- data/lib/sprout/system/unix_system.rb +72 -0
- data/lib/sprout/system/vista_system.rb +16 -0
- data/lib/sprout/system/win_nix_system.rb +41 -0
- data/lib/sprout/system/win_system.rb +76 -0
- data/lib/sprout/test/sprout_test_case.rb +211 -0
- data/lib/sprout/version.rb +9 -4
- data/rakefile.rb +85 -144
- data/script/console +10 -0
- data/script/destroy +14 -0
- data/script/generate +14 -0
- data/sprout.gemspec +26 -0
- data/test/fixtures/archive_unpacker/copyable/some_file.exe +0 -0
- data/test/fixtures/archive_unpacker/copyable/some_file.rb +0 -0
- data/test/fixtures/archive_unpacker/copyable/some_file.swc +0 -0
- data/test/fixtures/archive_unpacker/tgz/some folder.tgz +0 -0
- data/test/fixtures/archive_unpacker/tgz/some_file.tgz +0 -0
- data/test/fixtures/archive_unpacker/zip/some folder.zip +0 -0
- data/test/fixtures/archive_unpacker/zip/some_file.zip +0 -0
- data/test/fixtures/examples/app_generator.rb +127 -0
- data/test/fixtures/examples/echo_inputs.rb +151 -0
- data/test/fixtures/executable/echochamber_gem/bin/echochamber +3 -0
- data/test/fixtures/executable/echochamber_gem/echo_chamber.rb +10 -0
- data/test/fixtures/executable/flex3sdk_gem/flex3sdk.rb +11 -0
- data/test/fixtures/executable/flex3sdk_gem/mxmlc +3 -0
- data/test/fixtures/executable/flex3sdk_gem/mxmlc.bat +3 -0
- data/test/fixtures/executable/mxmlc.rb +805 -0
- data/test/fixtures/executable/params/input.as +0 -0
- data/test/fixtures/executable/params/input2.as +0 -0
- data/test/fixtures/executable/params/input3.as +0 -0
- data/test/fixtures/executable/params/mxmlc +5 -0
- data/test/fixtures/executable/path with spaces/input.as b/data/test/fixtures/executable/path with → spaces/input.as +0 -0
- data/test/fixtures/executable/path with spaces/input2.as b/data/test/fixtures/executable/path with → spaces/input2.as +0 -0
- data/test/fixtures/executable/path with spaces/input3.as b/data/test/fixtures/executable/path with → spaces/input3.as +0 -0
- data/test/fixtures/executable/paths/folder1/file1 +0 -0
- data/test/fixtures/executable/paths/folder1/file2 +0 -0
- data/test/fixtures/executable/paths/folder1/file3 +0 -0
- data/test/fixtures/executable/paths/folder2/file4 +0 -0
- data/test/fixtures/executable/paths/folder2/file5 +0 -0
- data/test/fixtures/executable/paths/folder3/file6 +0 -0
- data/test/fixtures/executable/src/Main.as +0 -0
- data/test/fixtures/executable/windows_line_endings +47 -0
- data/test/fixtures/generators/song_generator.rb +11 -0
- data/test/fixtures/generators/song_subclass/least_favorite.rb +10 -0
- data/test/fixtures/generators/song_subclass/templates/Song.txt +3 -0
- data/test/fixtures/generators/temp_generator.rb +24 -0
- data/test/fixtures/generators/templates/Main.as +9 -0
- data/test/fixtures/generators/templates/OtherFileTemplate +1 -0
- data/test/fixtures/generators/templates/SomeFile +1 -0
- data/test/fixtures/generators/templates/SomeSubclassFile +2 -0
- data/test/fixtures/generators/templates/Song.txt +3 -0
- data/test/fixtures/generators/templates/destroy +0 -0
- data/test/fixtures/generators/templates/generate +0 -0
- data/test/fixtures/library/archive/Archive.swc +0 -0
- data/test/fixtures/library/sources/lib/a/A.as +0 -0
- data/test/fixtures/library/sources/lib/b/B.as +0 -0
- data/test/fixtures/library/sources/src/Source.as +0 -0
- data/test/fixtures/process_runner/chmod_script.sh +3 -0
- data/test/fixtures/process_runner/dir with spaces/chmod_script.sh +3 -0
- data/test/fixtures/process_runner/failure +5 -0
- data/test/fixtures/process_runner/success +4 -0
- data/test/fixtures/remote_file_loader/md5/echochamber-test.zip +0 -0
- data/test/fixtures/remote_file_loader/md5/file_with_known_md5 +0 -0
- data/test/fixtures/remote_file_target/bin/echochamber +3 -0
- data/test/fixtures/remote_file_target/bin/echochamber.bat +3 -0
- data/test/fixtures/remote_file_target/echochamber-test.zip +0 -0
- data/test/fixtures/specification/asunit4.rb +25 -0
- data/test/fixtures/specification/ext/AsUnit-4.1.pre.swc +0 -0
- data/test/fixtures/specification/flashplayer.rb +30 -0
- data/test/fixtures/specification/flex4sdk.rb +72 -0
- data/test/fixtures/specification/flexunit4.sproutspec +17 -0
- data/test/fixtures/specification/lib/as3reflection/Reflection.as +0 -0
- data/test/fixtures/specification/src/AsUnit.as +0 -0
- data/test/fixtures/user/mxmlc_crlf +3 -0
- data/test/unit/archive_unpacker_test.rb +108 -0
- data/test/unit/boolean_param_test.rb +38 -0
- data/test/unit/executable_option_parser_test.rb +142 -0
- data/test/unit/executable_param_test.rb +76 -0
- data/test/unit/executable_test.rb +237 -0
- data/test/unit/fake_executable_task.rb +22 -0
- data/test/unit/fake_other_executable.rb +20 -0
- data/test/unit/fake_process_runner.rb +29 -0
- data/test/unit/file_param_test.rb +61 -0
- data/test/unit/file_target_test.rb +42 -0
- data/test/unit/files_param_test.rb +72 -0
- data/test/unit/generator_generator_test.rb +85 -0
- data/test/unit/generator_test.rb +333 -0
- data/test/unit/library_generator_test.rb +41 -0
- data/test/unit/library_test.rb +88 -0
- data/test/unit/osx_system_test.rb +20 -0
- data/test/unit/path_param_test.rb +43 -0
- data/test/unit/paths_param_test.rb +53 -0
- data/test/unit/platform_test.rb +76 -0
- data/test/unit/process_runner_test.rb +104 -0
- data/test/unit/rdoc_parser_test.rb +15 -0
- data/test/unit/remote_file_loader_test.rb +34 -0
- data/test/unit/remote_file_target_test.rb +105 -0
- data/test/unit/ruby_feature_test.rb +108 -0
- data/test/unit/ruby_generator_test.rb +70 -0
- data/test/unit/specification_test.rb +73 -0
- data/test/unit/sprout_test.rb +170 -0
- data/test/unit/sprout_test_helper.rb +18 -0
- data/test/unit/string_param_test.rb +19 -0
- data/test/unit/string_test.rb +20 -0
- data/test/unit/strings_param_test.rb +27 -0
- data/test/unit/test_helper.rb +1 -0
- data/test/unit/tool_generator_test.rb +43 -0
- data/test/unit/unix_system_test.rb +52 -0
- data/test/unit/user_test.rb +147 -0
- data/test/unit/vista_system_test.rb +40 -0
- data/test/unit/win_nix_system_test.rb +26 -0
- data/test/unit/win_system_test.rb +61 -0
- metadata +318 -113
- data/doc/Bundle +0 -14
- data/doc/Generator +0 -35
- data/doc/Library +0 -63
- data/doc/Task +0 -21
- data/doc/Tool +0 -20
- data/lib/platform.rb +0 -113
- data/lib/progress_bar.rb +0 -354
- data/lib/sprout/builder.rb +0 -51
- data/lib/sprout/bundle_resolver.rb +0 -349
- data/lib/sprout/commands/generate.rb +0 -9
- data/lib/sprout/dynamic_accessors.rb +0 -40
- data/lib/sprout/general_tasks.rb +0 -6
- data/lib/sprout/generator.rb +0 -7
- data/lib/sprout/generator/base_mixins.rb +0 -186
- data/lib/sprout/generator/named_base.rb +0 -227
- data/lib/sprout/project_model.rb +0 -278
- data/lib/sprout/simple_resolver.rb +0 -88
- data/lib/sprout/tasks/erb_resolver.rb +0 -118
- data/lib/sprout/tasks/gem_wrap_task.rb +0 -214
- data/lib/sprout/tasks/git_task.rb +0 -134
- data/lib/sprout/tasks/library_task.rb +0 -118
- data/lib/sprout/tasks/sftp_task.rb +0 -248
- data/lib/sprout/tasks/ssh_task.rb +0 -153
- data/lib/sprout/tasks/tool_task.rb +0 -836
- data/lib/sprout/tasks/zip_task.rb +0 -158
- data/lib/sprout/tool_task_model.rb +0 -19
- data/lib/sprout/user.rb +0 -415
- data/lib/sprout/version_file.rb +0 -89
- data/lib/sprout/zip_util.rb +0 -61
- data/samples/gem_wrap/rakefile.rb +0 -17
@@ -0,0 +1,151 @@
|
|
1
|
+
# /usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'sprout'
|
5
|
+
|
6
|
+
class CustomParameter < Sprout::Executable::Param; end
|
7
|
+
|
8
|
+
class EchoInputs
|
9
|
+
include Sprout::Executable
|
10
|
+
|
11
|
+
##
|
12
|
+
# A boolean parameter that will be set to true if present.
|
13
|
+
#
|
14
|
+
# echo-inputs --truthy
|
15
|
+
#
|
16
|
+
add_param :truthy, Boolean
|
17
|
+
|
18
|
+
##
|
19
|
+
# A boolean parameter that defaults to true, and must be
|
20
|
+
# explicitly set to false in order to turn it off.
|
21
|
+
#
|
22
|
+
# echo-inputs --falsey=false
|
23
|
+
#
|
24
|
+
add_param :falsey, Boolean, { :default => true, :hidden_value => false, :show_on_false => true }
|
25
|
+
|
26
|
+
##
|
27
|
+
# A file that exists at the time it is provided.
|
28
|
+
#
|
29
|
+
# echo-inputs --file=lib/sprout.rb
|
30
|
+
#
|
31
|
+
add_param :file, File
|
32
|
+
|
33
|
+
##
|
34
|
+
# A collection of files, this parameter can be repeated
|
35
|
+
# any number of times.
|
36
|
+
#
|
37
|
+
# echo-inputs --files+=rakefile.rb --files+=README.textil
|
38
|
+
#
|
39
|
+
add_param :files, Files
|
40
|
+
|
41
|
+
##
|
42
|
+
# A numeric value.
|
43
|
+
#
|
44
|
+
# echo-inputs --number=23
|
45
|
+
#
|
46
|
+
add_param :number, Number
|
47
|
+
|
48
|
+
##
|
49
|
+
# A relative or fully-qualified path to a directory.
|
50
|
+
#
|
51
|
+
# echo-inputs --path=lib/
|
52
|
+
#
|
53
|
+
add_param :path, Path
|
54
|
+
|
55
|
+
##
|
56
|
+
# Relative or fully-qualified paths to directories.
|
57
|
+
#
|
58
|
+
# echo-inputs --paths+=lib/ --paths+=test/
|
59
|
+
#
|
60
|
+
add_param :paths, Paths
|
61
|
+
|
62
|
+
##
|
63
|
+
# A simple string value.
|
64
|
+
#
|
65
|
+
# echo-inputs --string='Some String'
|
66
|
+
#
|
67
|
+
add_param :string, String
|
68
|
+
|
69
|
+
##
|
70
|
+
# A collection of simple string values.
|
71
|
+
#
|
72
|
+
# echo-inputs --strings+='First' --strings+='Second'
|
73
|
+
#
|
74
|
+
add_param :strings, Strings
|
75
|
+
|
76
|
+
##
|
77
|
+
# A short version of another parameter.
|
78
|
+
#
|
79
|
+
# echo-inputs -sp+='First' --sp+='Second'
|
80
|
+
#
|
81
|
+
add_param_alias :sp, :strings
|
82
|
+
|
83
|
+
|
84
|
+
##
|
85
|
+
# A collection of url values.
|
86
|
+
#
|
87
|
+
# echo-inputs --urls+='http://google.com' --urls+='http://yahoo.com'
|
88
|
+
#
|
89
|
+
add_param :urls, Urls
|
90
|
+
|
91
|
+
##
|
92
|
+
# A custom parameter type that is provided by this tool.
|
93
|
+
#
|
94
|
+
# echo-inputs --custom='Some Value'
|
95
|
+
#
|
96
|
+
add_param :custom, CustomParameter
|
97
|
+
|
98
|
+
##
|
99
|
+
# A required value with a hidden name. This kind of value is often
|
100
|
+
# presented as the default option.
|
101
|
+
#
|
102
|
+
# echo-inputs lib/sprout.rb
|
103
|
+
#
|
104
|
+
add_param :input, File, { :required => true }
|
105
|
+
|
106
|
+
def execute
|
107
|
+
puts "--truthy=#{truthy}" if truthy
|
108
|
+
puts "--falsey=#{falsey}" unless falsey
|
109
|
+
puts "--file=#{file}" unless file.nil?
|
110
|
+
puts "--files=#{files.inspect}" unless files.empty?
|
111
|
+
puts "--number=#{number}" unless number.nil?
|
112
|
+
puts "--path=#{path}" unless path.nil?
|
113
|
+
puts "--paths=#{paths.inspect}" unless paths.empty?
|
114
|
+
puts "--string=#{string}" unless string.nil?
|
115
|
+
puts "--strings=#{strings.inspect}" unless strings.empty?
|
116
|
+
puts "--sp=#{sp.inspect}" unless sp.empty?
|
117
|
+
puts "--urls=#{urls.inspect}" unless urls.empty?
|
118
|
+
puts "--custom=#{custom}" unless custom.nil?
|
119
|
+
puts " [input]: #{input}"
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
##
|
124
|
+
# When we're the outer application,
|
125
|
+
# run like an application:
|
126
|
+
if($0 == __FILE__)
|
127
|
+
exe = EchoInputs.new
|
128
|
+
exe.parse! ARGV
|
129
|
+
exe.execute
|
130
|
+
end
|
131
|
+
|
132
|
+
##
|
133
|
+
# Expose this application to Rake like:
|
134
|
+
#
|
135
|
+
# echo_inputs do |t|
|
136
|
+
# t.string = 'Foo'
|
137
|
+
# t.falsey = false
|
138
|
+
# end
|
139
|
+
#
|
140
|
+
def echo_inputs args
|
141
|
+
exe = EchoInputs.new
|
142
|
+
yield exe if block_given?
|
143
|
+
# Use 'file' task as if we were a compiler
|
144
|
+
# that created a file...
|
145
|
+
file args do
|
146
|
+
exe.execute
|
147
|
+
end
|
148
|
+
exe
|
149
|
+
end
|
150
|
+
|
151
|
+
|
@@ -0,0 +1,805 @@
|
|
1
|
+
|
2
|
+
module Sprout
|
3
|
+
|
4
|
+
# The MXMLC task provides a rake front end to the Flex MXMLC command line compiler.
|
5
|
+
# This task is integrated with the LibraryTask so that if any dependencies are
|
6
|
+
# library tasks, they will be automatically added to the library_path or source_path
|
7
|
+
# depending on whether they provide a swc or sources.
|
8
|
+
#
|
9
|
+
# The entire MXMLC advanced interface has been provided here. All parameter names should be
|
10
|
+
# identical to what is available on the regular compiler except dashes have been replaced
|
11
|
+
# by underscores.
|
12
|
+
#
|
13
|
+
# The following example can be pasted in a file named 'rakefile.rb' which should be placed in
|
14
|
+
# the same folder as an ActionScript 3.0 class named 'SomeProject.as' that extends
|
15
|
+
# flash.display.Sprite.
|
16
|
+
#
|
17
|
+
# # Create a remote library dependency on the corelib swc.
|
18
|
+
# library :corelib
|
19
|
+
#
|
20
|
+
# # Alias the compilation task with one that is easier to type
|
21
|
+
# task :compile => 'SomeProject.swf'
|
22
|
+
#
|
23
|
+
# # Create an MXMLC named for the output file that it creates. This task depends on the
|
24
|
+
# # corelib library and will automatically add the corelib.swc to it's library_path
|
25
|
+
# mxmlc 'SomeProject.swf' => :corelib do |t|
|
26
|
+
# t.input = 'SomeProject.as'
|
27
|
+
# t.default_size = '800 600'
|
28
|
+
# t.default_background_color = "#FFFFFF"
|
29
|
+
# end
|
30
|
+
#
|
31
|
+
# Note: Be sure to check out the features of the Executable to learn more about gem_version and preprocessor
|
32
|
+
#
|
33
|
+
# Interface and descriptions found here:
|
34
|
+
# http://livedocs.adobe.com/flex/2/docs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00001481.html
|
35
|
+
#
|
36
|
+
class MXMLC
|
37
|
+
include Sprout::Executable
|
38
|
+
|
39
|
+
##
|
40
|
+
# Enables accessibility features when compiling the Flex application or SWC file. The default value is false.
|
41
|
+
#
|
42
|
+
add_param :accessible, Boolean, { :hidden_value => true }
|
43
|
+
|
44
|
+
##
|
45
|
+
# Sets the file encoding for ActionScript files. For more information see: http://livedocs.adobe.com/flex/2/docs/00001503.html#149244
|
46
|
+
#
|
47
|
+
add_param :actionscript_file_encoding, String
|
48
|
+
|
49
|
+
##
|
50
|
+
# 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.
|
51
|
+
#
|
52
|
+
add_param :allow_source_path_overlap, Boolean, { :hidden_value => true }
|
53
|
+
|
54
|
+
##
|
55
|
+
# 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.
|
56
|
+
#
|
57
|
+
# The default value is true. If you set this value to false, you must set the es option to true.
|
58
|
+
#
|
59
|
+
# This is an advanced option.
|
60
|
+
add_param :as3, Boolean, { :default => true, :show_on_false => true }
|
61
|
+
|
62
|
+
##
|
63
|
+
# Prints detailed compile times to the standard output. The default value is true.
|
64
|
+
#
|
65
|
+
add_param :benchmark, Boolean, { :default => true, :show_on_false => true }
|
66
|
+
|
67
|
+
##
|
68
|
+
# 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.
|
69
|
+
#
|
70
|
+
# For more information on using the {context.root} token, see http://livedocs.adobe.com/flex/2/docs/00001446.html#205687.
|
71
|
+
#
|
72
|
+
add_param :context_root, Path
|
73
|
+
|
74
|
+
##
|
75
|
+
# 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).
|
76
|
+
#
|
77
|
+
add_param :contributor, String
|
78
|
+
|
79
|
+
##
|
80
|
+
# 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)
|
81
|
+
#
|
82
|
+
add_param :creator, String
|
83
|
+
|
84
|
+
##
|
85
|
+
# 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)
|
86
|
+
#
|
87
|
+
add_param :date, String
|
88
|
+
|
89
|
+
##
|
90
|
+
# 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.
|
91
|
+
#
|
92
|
+
# For the mxmlc compiler, the default value is false. For the compc compiler, the default value is true.
|
93
|
+
#
|
94
|
+
# 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.
|
95
|
+
#
|
96
|
+
# For information about the command-line debugger, see Using the Command-Line Debugger (http://livedocs.adobe.com/flex/2/docs/00001540.html#181846).
|
97
|
+
#
|
98
|
+
# Flex also uses the verbose-stacktraces setting to determine whether line numbers are added to the stacktrace.
|
99
|
+
#
|
100
|
+
add_param :debug, Boolean, { :hidden_value => true }
|
101
|
+
|
102
|
+
##
|
103
|
+
# Lets you engage in remote debugging sessions with the Flash IDE. This is an advanced option.
|
104
|
+
#
|
105
|
+
add_param :debug_password, String
|
106
|
+
|
107
|
+
##
|
108
|
+
# Sets the application's background color. You use the 0x notation to set the color, as the following example shows:
|
109
|
+
#
|
110
|
+
# -default-background-color=0xCCCCFF
|
111
|
+
#
|
112
|
+
# 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).
|
113
|
+
#
|
114
|
+
# This is an advanced option.
|
115
|
+
#
|
116
|
+
add_param :default_background_color, String
|
117
|
+
|
118
|
+
##
|
119
|
+
# Sets the application's frame rate. The default value is 24. This is an advanced option.
|
120
|
+
#
|
121
|
+
add_param :default_frame_rate, Number
|
122
|
+
|
123
|
+
##
|
124
|
+
# Defines the application's script execution limits.
|
125
|
+
#
|
126
|
+
# 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.
|
127
|
+
#
|
128
|
+
# 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.
|
129
|
+
#
|
130
|
+
# Example:
|
131
|
+
#
|
132
|
+
# # 900 is new max-recursion-depth
|
133
|
+
# # 20 is new max-execution-time
|
134
|
+
# t.default_script_limits = '900 20'
|
135
|
+
#
|
136
|
+
# You can override these settings in the application.
|
137
|
+
#
|
138
|
+
# This is an advanced option.
|
139
|
+
#
|
140
|
+
add_param :default_script_limits, String
|
141
|
+
|
142
|
+
##
|
143
|
+
# Defines the default application size, in pixels for example: default_size = '950 550'. This is an advanced option.
|
144
|
+
#
|
145
|
+
add_param :default_size, String, { :delimiter => ' ' }
|
146
|
+
|
147
|
+
##
|
148
|
+
# 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.
|
149
|
+
#
|
150
|
+
# 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.
|
151
|
+
#
|
152
|
+
# This is an advanced option.
|
153
|
+
#
|
154
|
+
add_param :default_css_url, Url
|
155
|
+
|
156
|
+
##
|
157
|
+
# This parameter is normally called 'define' but thanks to scoping issues with Sprouts and Rake, we needed to rename it and chose: 'define_conditional'.
|
158
|
+
#
|
159
|
+
# 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)
|
160
|
+
#
|
161
|
+
add_param :define_conditional, Strings, { :shell_name => "-define" }
|
162
|
+
|
163
|
+
##
|
164
|
+
# 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).
|
165
|
+
#
|
166
|
+
add_param :description, String
|
167
|
+
|
168
|
+
##
|
169
|
+
# Outputs the compiler options in the flex-config.xml file to the target path; for example:
|
170
|
+
#
|
171
|
+
# mxmlc -dump-config myapp-config.xml
|
172
|
+
#
|
173
|
+
# This is an advanced option.
|
174
|
+
#
|
175
|
+
add_param :dump_config, File
|
176
|
+
|
177
|
+
##
|
178
|
+
# 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.
|
179
|
+
#
|
180
|
+
# 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.
|
181
|
+
#
|
182
|
+
# The default value is false. If you set this option to true, you must set the es3 option to false.
|
183
|
+
#
|
184
|
+
# This is an advanced option.
|
185
|
+
#
|
186
|
+
add_param :es, Boolean
|
187
|
+
|
188
|
+
##
|
189
|
+
# Sets a list of symbols to exclude from linking when compiling a SWF file.
|
190
|
+
#
|
191
|
+
# This option provides compile-time link checking for external references that are dynamically linked.
|
192
|
+
#
|
193
|
+
# For more information about dynamic linking, see About linking (http://livedocs.adobe.com/flex/2/docs/00001521.html#205852).
|
194
|
+
#
|
195
|
+
# This is an advanced option.
|
196
|
+
#
|
197
|
+
add_param :externs, Strings
|
198
|
+
|
199
|
+
##
|
200
|
+
# 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.
|
201
|
+
#
|
202
|
+
# For more information about dynamic linking, see About linking (http://livedocs.adobe.com/flex/2/docs/00001521.html#205852).
|
203
|
+
#
|
204
|
+
# You can use the += operator to append the new SWC file to the list of external libraries.
|
205
|
+
#
|
206
|
+
# This parameter has been aliased as +el+.
|
207
|
+
#
|
208
|
+
add_param :external_library_path, Files
|
209
|
+
|
210
|
+
##
|
211
|
+
# Alias for external_library_path
|
212
|
+
#
|
213
|
+
add_param_alias :el, :external_library_path
|
214
|
+
|
215
|
+
##
|
216
|
+
# Specifies source files to compile. This is the default option for the mxmlc compiler.
|
217
|
+
#
|
218
|
+
add_param :file_specs, Files
|
219
|
+
|
220
|
+
##
|
221
|
+
# 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.
|
222
|
+
#
|
223
|
+
# This is an advanced option.
|
224
|
+
#
|
225
|
+
add_param :fonts_languages_language_range, String, { :shell_name => "-compiler.fonts.languages.language-range" }
|
226
|
+
|
227
|
+
##
|
228
|
+
# 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).
|
229
|
+
#
|
230
|
+
# This is an advanced option.
|
231
|
+
#
|
232
|
+
add_param :fonts_managers, Strings
|
233
|
+
|
234
|
+
##
|
235
|
+
# 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).
|
236
|
+
#
|
237
|
+
# This is an advanced option.
|
238
|
+
#
|
239
|
+
add_param :fonts_max_cached_fonts, Number
|
240
|
+
|
241
|
+
##
|
242
|
+
# 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).
|
243
|
+
#
|
244
|
+
# This is an advanced option.
|
245
|
+
#
|
246
|
+
add_param :fonts_max_glyphs_per_face, Number
|
247
|
+
|
248
|
+
##
|
249
|
+
# Specifies a SWF file frame label with a sequence of class names that are linked onto the frame.
|
250
|
+
#
|
251
|
+
# For example: frames_frame = 'someLabel MyProject OtherProject FoodProject'
|
252
|
+
#
|
253
|
+
# This is an advanced option.
|
254
|
+
#
|
255
|
+
add_param :frames_frame, String, { :shell_name => '-frames.frame' }
|
256
|
+
|
257
|
+
##
|
258
|
+
# Toggles the generation of an IFlexBootstrap-derived loader class.
|
259
|
+
#
|
260
|
+
# This is an advanced option.
|
261
|
+
#
|
262
|
+
add_param :generate_frame_loader, Boolean
|
263
|
+
|
264
|
+
##
|
265
|
+
# Enables the headless implementation of the Flex compiler. This sets the following:
|
266
|
+
#
|
267
|
+
# System.setProperty('java.awt.headless', 'true')
|
268
|
+
#
|
269
|
+
# The headless setting (java.awt.headless=true) is required to use fonts and SVG on UNIX systems without X Windows.
|
270
|
+
#
|
271
|
+
# This is an advanced option.
|
272
|
+
#
|
273
|
+
add_param :headless_server, Boolean
|
274
|
+
|
275
|
+
##
|
276
|
+
# Links all classes inside a SWC file to the resulting application SWF file, regardless of whether or not they are used.
|
277
|
+
#
|
278
|
+
# Contrast this option with the library-path option that includes only those classes that are referenced at compile time.
|
279
|
+
#
|
280
|
+
# To link one or more classes whether or not they are used and not an entire SWC file, use the includes option.
|
281
|
+
#
|
282
|
+
# This option is commonly used to specify resource bundles.
|
283
|
+
#
|
284
|
+
add_param :include_libraries, Files
|
285
|
+
|
286
|
+
##
|
287
|
+
# Links one or more classes to the resulting application SWF file, whether or not those classes are required at compile time.
|
288
|
+
#
|
289
|
+
# To link an entire SWC file rather than individual classes, use the include-libraries option.
|
290
|
+
#
|
291
|
+
add_param :includes, Strings
|
292
|
+
|
293
|
+
##
|
294
|
+
# 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
|
295
|
+
# be included in the SWF regardless of whether they are imported or not.
|
296
|
+
add_param :include_path, Paths
|
297
|
+
|
298
|
+
##
|
299
|
+
# Enables incremental compilation. For more information, see About incremental compilation (http://livedocs.adobe.com/flex/2/docs/00001506.html#153980).
|
300
|
+
#
|
301
|
+
# 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.
|
302
|
+
#
|
303
|
+
add_param :incremental, Boolean
|
304
|
+
|
305
|
+
##
|
306
|
+
# Keep the specified metadata in the SWF (advanced, repeatable).
|
307
|
+
#
|
308
|
+
# Example:
|
309
|
+
#
|
310
|
+
# Rakefile:
|
311
|
+
#
|
312
|
+
# mxmlc 'bin/SomeProject.swf' do |t|
|
313
|
+
# t.keep_as3_metadata << 'Orange'
|
314
|
+
# end
|
315
|
+
#
|
316
|
+
# Source Code:
|
317
|
+
#
|
318
|
+
# [Orange(isTasty=true)]
|
319
|
+
# public function eatOranges():void {
|
320
|
+
# // do something
|
321
|
+
# }
|
322
|
+
#
|
323
|
+
add_param :keep_as3_metadata, Strings
|
324
|
+
|
325
|
+
##
|
326
|
+
# Determines whether to keep the generated ActionScript class files.
|
327
|
+
#
|
328
|
+
# The generated class files include stubs and classes that are generated by the compiler and used to build the SWF file.
|
329
|
+
#
|
330
|
+
# 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.
|
331
|
+
#
|
332
|
+
# The default names of the primary generated class files are filename-generated.as and filename-interface.as.
|
333
|
+
#
|
334
|
+
# The default value is false.\nThis is an advanced option.
|
335
|
+
#
|
336
|
+
add_param :keep_generated_actionscript, Boolean
|
337
|
+
|
338
|
+
##
|
339
|
+
# 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).
|
340
|
+
#
|
341
|
+
add_param :language, String
|
342
|
+
|
343
|
+
##
|
344
|
+
# Enables ABC bytecode lazy initialization.
|
345
|
+
#
|
346
|
+
# The default value is false.
|
347
|
+
#
|
348
|
+
# This is an advanced option.
|
349
|
+
#
|
350
|
+
add_param :lazy_init, Boolean
|
351
|
+
|
352
|
+
|
353
|
+
##
|
354
|
+
# <product> <serial-number>
|
355
|
+
#
|
356
|
+
# Specifies a product and a serial number. (repeatable)
|
357
|
+
#
|
358
|
+
# This is an advanced option.
|
359
|
+
#
|
360
|
+
add_param :license, String
|
361
|
+
|
362
|
+
##
|
363
|
+
# Links SWC files to the resulting application SWF file. The compiler only links in those classes for the SWC file that are required.
|
364
|
+
#
|
365
|
+
# The default value of the library-path option includes all SWC files in the libs directory and the current locale. These are required.
|
366
|
+
#
|
367
|
+
# To point to individual classes or packages rather than entire SWC files, use the source-path option.
|
368
|
+
#
|
369
|
+
# 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.
|
370
|
+
#
|
371
|
+
# You can use the += operator to append the new argument to the list of existing SWC files.
|
372
|
+
#
|
373
|
+
# 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.
|
374
|
+
#
|
375
|
+
add_param :library_path, Files
|
376
|
+
|
377
|
+
##
|
378
|
+
# Alias to library_path
|
379
|
+
#
|
380
|
+
add_param_alias :l, :library_path
|
381
|
+
|
382
|
+
##
|
383
|
+
# Prints linking information to the specified output file.
|
384
|
+
# This file is an XML file that contains
|
385
|
+
#
|
386
|
+
# <def>, <pre>, and <ext>
|
387
|
+
#
|
388
|
+
# symbols showing linker dependencies in the final SWF file.
|
389
|
+
#
|
390
|
+
# The file format output by this command can be used to write a file for input to the load-externs option.
|
391
|
+
#
|
392
|
+
# For more information on the report, see Examining linker dependencies (http://livedocs.adobe.com/flex/2/docs/00001394.html#211202).
|
393
|
+
#
|
394
|
+
# This is an advanced option.
|
395
|
+
#
|
396
|
+
add_param :link_report, File
|
397
|
+
|
398
|
+
##
|
399
|
+
# Specifies the location of the configuration file that defines compiler options.
|
400
|
+
#
|
401
|
+
# If you specify a configuration file, you can override individual options by setting them on the command line.
|
402
|
+
#
|
403
|
+
# All relative paths in the configuration file are relative to the location of the configuration file itself.
|
404
|
+
#
|
405
|
+
# Use the += operator to chain this configuration file to other configuration files.
|
406
|
+
#
|
407
|
+
# 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).
|
408
|
+
#
|
409
|
+
add_param :load_config, Files
|
410
|
+
|
411
|
+
##
|
412
|
+
# Specifies the location of an XML file that contains
|
413
|
+
#
|
414
|
+
# <def>, <pre>, and <ext>
|
415
|
+
#
|
416
|
+
# symbols to omit from linking when compiling a SWF file.
|
417
|
+
#
|
418
|
+
# The XML file uses the same syntax as the one produced by the link-report option.
|
419
|
+
#
|
420
|
+
# For more information on the report, see Examining linker dependencies (http://livedocs.adobe.com/flex/2/docs/00001394.html#211202).
|
421
|
+
#
|
422
|
+
# This option provides compile-time link checking for external components that are dynamically linked.
|
423
|
+
#
|
424
|
+
# For more information about dynamic linking, see About linking (http://livedocs.adobe.com/flex/2/docs/00001521.html#205852).
|
425
|
+
#
|
426
|
+
# This is an advanced option.
|
427
|
+
#
|
428
|
+
add_param :load_externs, File
|
429
|
+
|
430
|
+
##
|
431
|
+
# Specifies the locale that should be packaged in the SWF file (for example, en_EN).
|
432
|
+
#
|
433
|
+
# You run the mxmlc compiler multiple times to create SWF files for more than one locale,
|
434
|
+
# with only the locale option changing.
|
435
|
+
#
|
436
|
+
# You must also include the parent directory of the individual locale directories,
|
437
|
+
# plus the token {locale}, in the source-path; for example:
|
438
|
+
#
|
439
|
+
# mxmlc -locale en_EN -source-path locale/{locale} -file-specs MainApp.mxml
|
440
|
+
#
|
441
|
+
# For more information, see Localizing Flex Applicationsin (http://livedocs.adobe.com/flex/2/docs/00000898.html#129288) Flex 2 Developer's Guide.
|
442
|
+
#
|
443
|
+
add_param :locale, String
|
444
|
+
|
445
|
+
##
|
446
|
+
# 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).
|
447
|
+
#
|
448
|
+
add_param :localized_description, String
|
449
|
+
|
450
|
+
##
|
451
|
+
# 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)."
|
452
|
+
#
|
453
|
+
add_param :localized_title, String
|
454
|
+
|
455
|
+
##
|
456
|
+
# 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.
|
457
|
+
#
|
458
|
+
# For more information about manifest files, see About manifest files (http://livedocs.adobe.com/flex/2/docs/00001519.html#134676).
|
459
|
+
#
|
460
|
+
add_param :namespaces_namespace, String
|
461
|
+
|
462
|
+
##
|
463
|
+
# Enables the ActionScript optimizer. This optimizer reduces file size and increases performance by optimizing the SWF file's bytecode.
|
464
|
+
#
|
465
|
+
# The default value is false.
|
466
|
+
#
|
467
|
+
add_param :optimize, Boolean
|
468
|
+
|
469
|
+
##
|
470
|
+
# 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.
|
471
|
+
#
|
472
|
+
# The default SWF filename matches the target filename, but with a SWF file extension.
|
473
|
+
#
|
474
|
+
# 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.
|
475
|
+
#
|
476
|
+
# The compiler creates extra directories based on the specified filename if those directories are not present.
|
477
|
+
#
|
478
|
+
# When using this option with the component compiler, the output is a SWC file rather than a SWF file.
|
479
|
+
#
|
480
|
+
add_param :output, File, { :file_task_name => true }
|
481
|
+
|
482
|
+
|
483
|
+
##
|
484
|
+
# 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).
|
485
|
+
#
|
486
|
+
add_param :publisher, String
|
487
|
+
|
488
|
+
##
|
489
|
+
# XML text to store in the SWF metadata (overrides metadata.* configuration) (advanced)
|
490
|
+
#
|
491
|
+
add_param :raw_metadata, String
|
492
|
+
|
493
|
+
##
|
494
|
+
# 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.
|
495
|
+
#
|
496
|
+
# For more information, see Localizing Flex Applications (http://livedocs.adobe.com/flex/2/docs/00000898.html#129288) in Flex 2 Developer's Guide.
|
497
|
+
#
|
498
|
+
add_param :resource_bundle_list, File
|
499
|
+
|
500
|
+
##
|
501
|
+
# Specifies a list of run-time shared libraries (RSLs) to use for this application. RSLs are dynamically-linked at run time.
|
502
|
+
#
|
503
|
+
# 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.
|
504
|
+
#
|
505
|
+
# For more information about RSLs, see Using Runtime Shared Libraries. (http://livedocs.adobe.com/flex/2/docs/00001520.html#168690)
|
506
|
+
#
|
507
|
+
add_param :runtime_shared_libraries, Strings
|
508
|
+
|
509
|
+
##
|
510
|
+
# Alias for runtime_shared_libraries
|
511
|
+
#
|
512
|
+
add_param_alias :rsl, :runtime_shared_libraries
|
513
|
+
|
514
|
+
##
|
515
|
+
# [path-element] [rsl-url] [policy-file-url] [rsl-url] [policy-file-url]
|
516
|
+
# alias -rslp
|
517
|
+
# (repeatable)
|
518
|
+
add_param :runtime_shared_library_path, Strings
|
519
|
+
|
520
|
+
##
|
521
|
+
# Alias for runtime_shared_library_path
|
522
|
+
#
|
523
|
+
add_param_alias :rslp, :runtime_shared_library_path
|
524
|
+
|
525
|
+
##
|
526
|
+
# Specifies the location of the services-config.xml file. This file is used by Flex Data Services.
|
527
|
+
#
|
528
|
+
add_param :services, File
|
529
|
+
|
530
|
+
##
|
531
|
+
# Shows warnings for ActionScript classes.
|
532
|
+
#
|
533
|
+
# The default value is true.
|
534
|
+
#
|
535
|
+
# For more information about viewing warnings and errors, see Viewing warnings and errors (http://livedocs.adobe.com/flex/2/docs/00001517.html#182413).
|
536
|
+
#
|
537
|
+
add_param :show_actionscript_warnings, Boolean, { :default => true, :show_on_false => true }
|
538
|
+
|
539
|
+
##
|
540
|
+
# Shows a warning when Flash Player cannot detect changes to a bound property.
|
541
|
+
#
|
542
|
+
# The default value is true.
|
543
|
+
#
|
544
|
+
# For more information about compiler warnings, see Using SWC files (http://livedocs.adobe.com/flex/2/docs/00001505.html#158337).
|
545
|
+
#
|
546
|
+
add_param :show_binding_warnings, Boolean, { :default => true, :show_on_false => true }
|
547
|
+
|
548
|
+
##
|
549
|
+
# Shows deprecation warnings for Flex components. To see warnings for ActionScript classes, use the show-actionscript-warnings option.
|
550
|
+
#
|
551
|
+
# The default value is true.
|
552
|
+
#
|
553
|
+
# For more information about viewing warnings and errors, see Viewing warnings and errors.
|
554
|
+
#
|
555
|
+
add_param :show_deprecation_warnings, Boolean, { :default => true, :show_on_false => true }
|
556
|
+
|
557
|
+
##
|
558
|
+
# 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.
|
559
|
+
#
|
560
|
+
# You can use wildcards to include all files and subdirectories of a directory.
|
561
|
+
#
|
562
|
+
# To link an entire library SWC file and not individual classes or directories, use the library-path option.
|
563
|
+
#
|
564
|
+
# The source path is also used as the search path for the component compiler's include-classes and include-resource-bundles options.
|
565
|
+
#
|
566
|
+
# You can also use the += operator to append the new argument to the list of existing source path entries.
|
567
|
+
#
|
568
|
+
add_param :source_path, Paths
|
569
|
+
|
570
|
+
add_param_alias :sp, :source_path
|
571
|
+
|
572
|
+
##
|
573
|
+
# Statically link the libraries specified by the -runtime-shared-libraries-path option.
|
574
|
+
#
|
575
|
+
# alias -static-rsls
|
576
|
+
#
|
577
|
+
add_param :static_link_runtime_shared_libraries, Boolean
|
578
|
+
|
579
|
+
##
|
580
|
+
# Alias for static_link_runtime_shared_libraries
|
581
|
+
#
|
582
|
+
add_param_alias :static_rsls, :static_link_runtime_shared_libraries
|
583
|
+
|
584
|
+
##
|
585
|
+
# Prints undefined property and function calls; also performs compile-time type checking on assignments and options supplied to method calls.
|
586
|
+
#
|
587
|
+
# The default value is true.
|
588
|
+
#
|
589
|
+
# For more information about viewing warnings and errors, see Viewing warnings and errors (http://livedocs.adobe.com/flex/2/docs/00001517.html#182413).
|
590
|
+
#
|
591
|
+
add_param :strict, Boolean, { :default => true, :show_on_false => true }
|
592
|
+
|
593
|
+
##
|
594
|
+
# Specifies the version of the player the application is targeting.
|
595
|
+
#
|
596
|
+
# Features requiring a later version will not be compiled into the application. The minimum value supported is "9.0.0".
|
597
|
+
#
|
598
|
+
add_param :target_player, String
|
599
|
+
|
600
|
+
##
|
601
|
+
# 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.
|
602
|
+
#
|
603
|
+
# 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.
|
604
|
+
#
|
605
|
+
add_param :theme, Files
|
606
|
+
|
607
|
+
##
|
608
|
+
# 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).
|
609
|
+
#
|
610
|
+
add_param :title, String
|
611
|
+
|
612
|
+
##
|
613
|
+
# Specifies that the current application uses network services.
|
614
|
+
#
|
615
|
+
# The default value is true.
|
616
|
+
#
|
617
|
+
# 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.
|
618
|
+
#
|
619
|
+
# For more information about the use-network property, see Applying Flex Security (http://livedocs.adobe.com/flex/2/docs/00001328.html#137544).
|
620
|
+
#
|
621
|
+
add_param :use_network, Boolean, { :default => true, :show_on_false => true }
|
622
|
+
|
623
|
+
##
|
624
|
+
# Generates source code that includes line numbers. When a run-time error occurs, the stacktrace shows these line numbers.
|
625
|
+
#
|
626
|
+
# Enabling this option generates larger SWF files.\nThe default value is false.
|
627
|
+
#
|
628
|
+
add_param :verbose_stacktraces, Boolean
|
629
|
+
|
630
|
+
##
|
631
|
+
# Verifies the libraries loaded at runtime are the correct ones.
|
632
|
+
#
|
633
|
+
add_param :verify_digests, Boolean
|
634
|
+
|
635
|
+
##
|
636
|
+
# Enables specified warnings. For more information, see Viewing warnings and errors (http://livedocs.adobe.com/flex/2/docs/00001517.html#182413).
|
637
|
+
#
|
638
|
+
add_param :warn_warning_type, Boolean
|
639
|
+
|
640
|
+
##
|
641
|
+
# Enables all warnings. Set to false to disable all warnings. This option overrides the warn-warning_type options.
|
642
|
+
#
|
643
|
+
# The default value is true.
|
644
|
+
#
|
645
|
+
add_param :warnings, Boolean
|
646
|
+
|
647
|
+
##
|
648
|
+
# Main source file to send compiler"
|
649
|
+
# This must be the last item in this list
|
650
|
+
add_param :input, File, { :required => true, :hidden_name => true }
|
651
|
+
|
652
|
+
set :default_prefix, '-'
|
653
|
+
|
654
|
+
##
|
655
|
+
# The default gem name is sprout-flex3sdk
|
656
|
+
#
|
657
|
+
set :pkg_name, 'flex4sdk'
|
658
|
+
|
659
|
+
##
|
660
|
+
# The default gem version
|
661
|
+
#
|
662
|
+
set :pkg_version, '>= 1.0.pre'
|
663
|
+
|
664
|
+
##
|
665
|
+
# The default executable target
|
666
|
+
#
|
667
|
+
set :executable, :mxmlc
|
668
|
+
|
669
|
+
end
|
670
|
+
end
|
671
|
+
|
672
|
+
=begin
|
673
|
+
def define # :nodoc:
|
674
|
+
super
|
675
|
+
|
676
|
+
if(!output)
|
677
|
+
if(name.match(/.swf/) || name.match(/swc/))
|
678
|
+
self.output = name
|
679
|
+
end
|
680
|
+
end
|
681
|
+
|
682
|
+
if(input && !input.match(/.css/) && File.exists?(input))
|
683
|
+
source_path << File.dirname(input)
|
684
|
+
end
|
685
|
+
|
686
|
+
if(include_path)
|
687
|
+
include_path.each do |path|
|
688
|
+
process_include_path(path) if(File.directory?(path))
|
689
|
+
end
|
690
|
+
end
|
691
|
+
|
692
|
+
self.include_path = []
|
693
|
+
|
694
|
+
if(link_report)
|
695
|
+
CLEAN.add(link_report)
|
696
|
+
end
|
697
|
+
|
698
|
+
source_path.uniq!
|
699
|
+
param_hash['source_path'].value = clean_nested_source_paths(source_path)
|
700
|
+
|
701
|
+
CLEAN.add(output)
|
702
|
+
if(incremental)
|
703
|
+
CLEAN.add(FileList['**/**/*.cache'])
|
704
|
+
end
|
705
|
+
|
706
|
+
self
|
707
|
+
end
|
708
|
+
|
709
|
+
protected
|
710
|
+
|
711
|
+
def process_include_path(path)
|
712
|
+
symbols = []
|
713
|
+
FileList["#{path}/**/*[.as|.mxml]"].each do |file|
|
714
|
+
next if File.directory?(file)
|
715
|
+
file.gsub!(path, '')
|
716
|
+
file.gsub!(/^\//, '')
|
717
|
+
file.gsub!('/', '.')
|
718
|
+
file.gsub!(/.as$/, '')
|
719
|
+
file.gsub!(/.mxml$/, '')
|
720
|
+
file.gsub!(/.css$/, '')
|
721
|
+
symbols << file
|
722
|
+
end
|
723
|
+
|
724
|
+
symbols.each do |symbol|
|
725
|
+
self.includes << symbol
|
726
|
+
end
|
727
|
+
end
|
728
|
+
|
729
|
+
def clean_nested_source_paths(paths)
|
730
|
+
results = []
|
731
|
+
paths.each do |path|
|
732
|
+
# TODO: This should only happen if: allow_source_path_overlap != true
|
733
|
+
if(check_nested_source_path(results, path))
|
734
|
+
results << path
|
735
|
+
end
|
736
|
+
end
|
737
|
+
return results
|
738
|
+
end
|
739
|
+
|
740
|
+
def check_nested_source_path(array, path)
|
741
|
+
array.each_index do |index|
|
742
|
+
item = array[index]
|
743
|
+
if(item =~ /^#{path}/)
|
744
|
+
array.slice!(index, 1)
|
745
|
+
elsif(path =~ /^#{item}/)
|
746
|
+
return false
|
747
|
+
end
|
748
|
+
end
|
749
|
+
return true
|
750
|
+
end
|
751
|
+
|
752
|
+
# Use the swc path if possible
|
753
|
+
# Otherwise add to source
|
754
|
+
def resolve_library(library_task)
|
755
|
+
#TODO: Add support for libraries that don't get
|
756
|
+
# copied into the project
|
757
|
+
path = library_task.project_path
|
758
|
+
if(path.match(/.swc$/))
|
759
|
+
library_path << library_task.project_path
|
760
|
+
else
|
761
|
+
source_path << library_task.project_path
|
762
|
+
end
|
763
|
+
end
|
764
|
+
|
765
|
+
def execute_with_fcsh(command)
|
766
|
+
begin
|
767
|
+
display_preprocess_message
|
768
|
+
puts FCSHSocket.execute("mxmlc #{command}")
|
769
|
+
rescue FCSHError => fcsh_error
|
770
|
+
raise fcsh_error
|
771
|
+
rescue StandardError => std_error
|
772
|
+
# TODO: Capture a more concrete error here...
|
773
|
+
raise MXMLCError.new("[ERROR] There was a problem connecting to the Flex Compiler SHell, run 'rake fcsh:start' in another terminal.")
|
774
|
+
end
|
775
|
+
end
|
776
|
+
|
777
|
+
def execute(*args)
|
778
|
+
begin
|
779
|
+
start = Time.now.to_i
|
780
|
+
if(@use_fcsh)
|
781
|
+
execute_with_fcsh(to_shell)
|
782
|
+
else
|
783
|
+
super
|
784
|
+
end
|
785
|
+
Log.puts "mxmlc finished compiling #{name} in #{Time.now.to_i - start} seconds"
|
786
|
+
rescue ExecutionError => e
|
787
|
+
if(e.message.index('Warning:'))
|
788
|
+
# MXMLC sends warnings to stderr....
|
789
|
+
Log.puts(e.message.gsub('[ERROR]', '[WARNING]'))
|
790
|
+
else
|
791
|
+
raise e
|
792
|
+
end
|
793
|
+
end
|
794
|
+
end
|
795
|
+
|
796
|
+
end
|
797
|
+
end
|
798
|
+
=end
|
799
|
+
|
800
|
+
def mxmlc args, &block
|
801
|
+
mxmlc_tool = Sprout::MXMLC.new
|
802
|
+
mxmlc_tool.to_rake(args, &block)
|
803
|
+
mxmlc_tool
|
804
|
+
end
|
805
|
+
|