flashsdk 1.0.1.pre → 1.0.5.pre
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -1
- data/POSTINSTALL.rdoc +40 -0
- data/VERSION +1 -1
- data/doc/adl-list.txt +0 -0
- data/doc/adt-list.txt +0 -0
- data/doc/compc-list.txt +130 -0
- data/doc/mxmlc-advanced-list.txt +122 -0
- data/doc/mxmlc-list.txt +55 -0
- data/flashsdk.gemspec +10 -9
- data/lib/flashsdk/compc.rb +89 -0
- data/lib/flashsdk/compc_legacy.rb +149 -0
- data/lib/flashsdk/{tasks/mxmlc.rb → compiler_base.rb} +14 -67
- data/lib/flashsdk/generators/class_generator.rb +31 -16
- data/lib/flashsdk/generators/flash_helper.rb +71 -1
- data/lib/flashsdk/generators/project_generator.rb +3 -25
- data/lib/flashsdk/generators/templates/Gemfile +1 -2
- data/lib/flashsdk/mxmlc.rb +70 -0
- data/lib/flashsdk.rb +3 -1
- data/test/fixtures/compc/simple/SomeFile.as +11 -0
- data/test/unit/class_generator_test.rb +0 -1
- data/test/unit/compc_test.rb +38 -0
- data/test/unit/mxmlc_test.rb +9 -3
- data/test/unit/test_helper.rb +1 -0
- metadata +59 -8
- /data/lib/flashsdk/{tasks/mxmlc_legacy.rb → mxmlc_legacy.rb} +0 -0
data/Gemfile
CHANGED
data/POSTINSTALL.rdoc
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
++++++++++++++++++++++++++++++++
|
2
|
+
You have successfully installed the Project Sprouts FlashSDK!
|
3
|
+
|
4
|
+
To get started with a new ActionScript 3 project:
|
5
|
+
|
6
|
+
# Generate a project named 'SomeProject'
|
7
|
+
sprout-as3 SomeProject
|
8
|
+
|
9
|
+
# Change directory to the newly-created directory:
|
10
|
+
cd SomeProject
|
11
|
+
|
12
|
+
# Install whatever additional gems are required
|
13
|
+
# by this project Gemfile:
|
14
|
+
bundle install
|
15
|
+
|
16
|
+
# Use Rake to run the default task:
|
17
|
+
rake
|
18
|
+
|
19
|
+
++++++++++++++++++++++++++++++++
|
20
|
+
Next Steps:
|
21
|
+
|
22
|
+
# Generate a new class, test case and test suite:
|
23
|
+
sprout-class utils.MathUtil
|
24
|
+
|
25
|
+
# Compile and run the test harness:
|
26
|
+
rake test
|
27
|
+
|
28
|
+
# List available rake tasks:
|
29
|
+
rake -T
|
30
|
+
|
31
|
+
# List available generators:
|
32
|
+
sprout-
|
33
|
+
(followed by the TAB key)
|
34
|
+
|
35
|
+
++++++++++++++++++++++++++++++++
|
36
|
+
Issues or Questions?
|
37
|
+
|
38
|
+
Email us at:
|
39
|
+
projectsprouts@googlegroups.com
|
40
|
+
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.5.pre
|
data/doc/adl-list.txt
ADDED
File without changes
|
data/doc/adt-list.txt
ADDED
File without changes
|
data/doc/compc-list.txt
ADDED
@@ -0,0 +1,130 @@
|
|
1
|
+
Adobe Flex Compiler (compc)
|
2
|
+
Version 4.0.0 build 10485
|
3
|
+
Copyright (c) 2004-2009 Adobe Systems, Inc. All rights reserved.
|
4
|
+
|
5
|
+
|
6
|
+
-benchmark
|
7
|
+
-compiler.accessible
|
8
|
+
-compiler.actionscript-file-encoding <string>
|
9
|
+
-compiler.allow-source-path-overlap
|
10
|
+
-compiler.as3
|
11
|
+
-compiler.context-root <context-path>
|
12
|
+
-compiler.debug
|
13
|
+
-compiler.defaults-css-files [filename] [...]
|
14
|
+
-compiler.defaults-css-url <string>
|
15
|
+
-compiler.define <name> <value>
|
16
|
+
-compiler.enable-runtime-design-layers
|
17
|
+
-compiler.es
|
18
|
+
-compiler.extensions.extension [extension] [parameters] [...]
|
19
|
+
-compiler.external-library-path [path-element] [...]
|
20
|
+
-compiler.fonts.advanced-anti-aliasing
|
21
|
+
-compiler.fonts.flash-type
|
22
|
+
-compiler.fonts.languages.language-range <lang> <range>
|
23
|
+
-compiler.fonts.local-font-paths [path-element] [...]
|
24
|
+
-compiler.fonts.local-fonts-snapshot <string>
|
25
|
+
-compiler.fonts.managers [manager-class] [...]
|
26
|
+
-compiler.fonts.max-cached-fonts <string>
|
27
|
+
-compiler.fonts.max-glyphs-per-face <string>
|
28
|
+
-compiler.headless-server
|
29
|
+
-compiler.include-libraries [library] [...]
|
30
|
+
-compiler.incremental
|
31
|
+
-compiler.keep-all-type-selectors
|
32
|
+
-compiler.keep-as3-metadata [name] [...]
|
33
|
+
-compiler.keep-generated-actionscript
|
34
|
+
-compiler.library-path [path-element] [...]
|
35
|
+
-compiler.locale [locale-element] [...]
|
36
|
+
-compiler.mxml.compatibility-version <version>
|
37
|
+
-compiler.mxml.qualified-type-selectors
|
38
|
+
-compiler.namespaces.namespace [uri] [manifest] [...]
|
39
|
+
-compiler.optimize
|
40
|
+
-compiler.services <filename>
|
41
|
+
-compiler.show-actionscript-warnings
|
42
|
+
-compiler.show-binding-warnings
|
43
|
+
-compiler.show-shadowed-device-font-warnings
|
44
|
+
-compiler.show-unused-type-selector-warnings
|
45
|
+
-compiler.source-path [path-element] [...]
|
46
|
+
-compiler.strict
|
47
|
+
-compiler.theme [filename] [...]
|
48
|
+
-compiler.use-resource-bundle-metadata
|
49
|
+
-compiler.verbose-stacktraces
|
50
|
+
-compiler.warn-array-tostring-changes
|
51
|
+
-compiler.warn-assignment-within-conditional
|
52
|
+
-compiler.warn-bad-array-cast
|
53
|
+
-compiler.warn-bad-bool-assignment
|
54
|
+
-compiler.warn-bad-date-cast
|
55
|
+
-compiler.warn-bad-es3-type-method
|
56
|
+
-compiler.warn-bad-es3-type-prop
|
57
|
+
-compiler.warn-bad-nan-comparison
|
58
|
+
-compiler.warn-bad-null-assignment
|
59
|
+
-compiler.warn-bad-null-comparison
|
60
|
+
-compiler.warn-bad-undefined-comparison
|
61
|
+
-compiler.warn-boolean-constructor-with-no-args
|
62
|
+
-compiler.warn-changes-in-resolve
|
63
|
+
-compiler.warn-class-is-sealed
|
64
|
+
-compiler.warn-const-not-initialized
|
65
|
+
-compiler.warn-constructor-returns-value
|
66
|
+
-compiler.warn-deprecated-event-handler-error
|
67
|
+
-compiler.warn-deprecated-function-error
|
68
|
+
-compiler.warn-deprecated-property-error
|
69
|
+
-compiler.warn-duplicate-argument-names
|
70
|
+
-compiler.warn-duplicate-variable-def
|
71
|
+
-compiler.warn-for-var-in-changes
|
72
|
+
-compiler.warn-import-hides-class
|
73
|
+
-compiler.warn-instance-of-changes
|
74
|
+
-compiler.warn-internal-error
|
75
|
+
-compiler.warn-level-not-supported
|
76
|
+
-compiler.warn-missing-namespace-decl
|
77
|
+
-compiler.warn-negative-uint-literal
|
78
|
+
-compiler.warn-no-constructor
|
79
|
+
-compiler.warn-no-explicit-super-call-in-constructor
|
80
|
+
-compiler.warn-no-type-decl
|
81
|
+
-compiler.warn-number-from-string-changes
|
82
|
+
-compiler.warn-scoping-change-in-this
|
83
|
+
-compiler.warn-slow-text-field-addition
|
84
|
+
-compiler.warn-unlikely-function-value
|
85
|
+
-compiler.warn-xml-class-has-changed
|
86
|
+
-compute-digest
|
87
|
+
-debug-password <string>
|
88
|
+
-default-background-color <int>
|
89
|
+
-default-frame-rate <int>
|
90
|
+
-default-script-limits <max-recursion-depth> <max-execution-time>
|
91
|
+
-default-size <width> <height>
|
92
|
+
-directory
|
93
|
+
-dump-config <filename>
|
94
|
+
-externs [symbol] [...]
|
95
|
+
-frames.frame [label] [classname] [...]
|
96
|
+
-framework <string>
|
97
|
+
-help [keyword] [...]
|
98
|
+
-include-classes [class] [...]
|
99
|
+
-include-file <name> <path>
|
100
|
+
-include-lookup-only
|
101
|
+
-include-namespaces [uri] [...]
|
102
|
+
-include-resource-bundles [bundle] [...]
|
103
|
+
-include-sources [path-element] [...]
|
104
|
+
-include-stylesheet <name> <path>
|
105
|
+
-includes [symbol] [...]
|
106
|
+
-licenses.license <product> <serial-number>
|
107
|
+
-link-report <filename>
|
108
|
+
-load-config <filename>
|
109
|
+
-load-externs <filename>
|
110
|
+
-metadata.contributor <name>
|
111
|
+
-metadata.creator <name>
|
112
|
+
-metadata.date <text>
|
113
|
+
-metadata.description <text>
|
114
|
+
-metadata.language <code>
|
115
|
+
-metadata.localized-description <text> <lang>
|
116
|
+
-metadata.localized-title <title> <lang>
|
117
|
+
-metadata.publisher <name>
|
118
|
+
-metadata.title <text>
|
119
|
+
-output <filename>
|
120
|
+
-raw-metadata <text>
|
121
|
+
-resource-bundle-list <filename>
|
122
|
+
-runtime-shared-libraries [url] [...]
|
123
|
+
-runtime-shared-library-path [path-element] [rsl-url] [policy-file-url] [rsl-url] [policy-file-url]
|
124
|
+
-static-link-runtime-shared-libraries
|
125
|
+
-target-player <version>
|
126
|
+
-use-network
|
127
|
+
-verify-digests
|
128
|
+
-version
|
129
|
+
-warnings
|
130
|
+
|
@@ -0,0 +1,122 @@
|
|
1
|
+
Adobe Flex Compiler (mxmlc)
|
2
|
+
Version 4.0.0 build 10485
|
3
|
+
Copyright (c) 2004-2009 Adobe Systems, Inc. All rights reserved.
|
4
|
+
|
5
|
+
|
6
|
+
-benchmark
|
7
|
+
-compiler.accessible
|
8
|
+
-compiler.actionscript-file-encoding <string>
|
9
|
+
-compiler.allow-source-path-overlap
|
10
|
+
-compiler.as3
|
11
|
+
-compiler.context-root <context-path>
|
12
|
+
-compiler.debug
|
13
|
+
-compiler.defaults-css-files [filename] [...]
|
14
|
+
-compiler.defaults-css-url <string>
|
15
|
+
-compiler.define <name> <value>
|
16
|
+
-compiler.enable-runtime-design-layers
|
17
|
+
-compiler.es
|
18
|
+
-compiler.extensions.extension [extension] [parameters] [...]
|
19
|
+
-compiler.external-library-path [path-element] [...]
|
20
|
+
-compiler.fonts.advanced-anti-aliasing
|
21
|
+
-compiler.fonts.flash-type
|
22
|
+
-compiler.fonts.languages.language-range <lang> <range>
|
23
|
+
-compiler.fonts.local-font-paths [path-element] [...]
|
24
|
+
-compiler.fonts.local-fonts-snapshot <string>
|
25
|
+
-compiler.fonts.managers [manager-class] [...]
|
26
|
+
-compiler.fonts.max-cached-fonts <string>
|
27
|
+
-compiler.fonts.max-glyphs-per-face <string>
|
28
|
+
-compiler.headless-server
|
29
|
+
-compiler.include-libraries [library] [...]
|
30
|
+
-compiler.incremental
|
31
|
+
-compiler.keep-all-type-selectors
|
32
|
+
-compiler.keep-as3-metadata [name] [...]
|
33
|
+
-compiler.keep-generated-actionscript
|
34
|
+
-compiler.library-path [path-element] [...]
|
35
|
+
-compiler.locale [locale-element] [...]
|
36
|
+
-compiler.mxml.compatibility-version <version>
|
37
|
+
-compiler.mxml.qualified-type-selectors
|
38
|
+
-compiler.namespaces.namespace [uri] [manifest] [...]
|
39
|
+
-compiler.optimize
|
40
|
+
-compiler.services <filename>
|
41
|
+
-compiler.show-actionscript-warnings
|
42
|
+
-compiler.show-binding-warnings
|
43
|
+
-compiler.show-shadowed-device-font-warnings
|
44
|
+
-compiler.show-unused-type-selector-warnings
|
45
|
+
-compiler.source-path [path-element] [...]
|
46
|
+
-compiler.strict
|
47
|
+
-compiler.theme [filename] [...]
|
48
|
+
-compiler.use-resource-bundle-metadata
|
49
|
+
-compiler.verbose-stacktraces
|
50
|
+
-compiler.warn-array-tostring-changes
|
51
|
+
-compiler.warn-assignment-within-conditional
|
52
|
+
-compiler.warn-bad-array-cast
|
53
|
+
-compiler.warn-bad-bool-assignment
|
54
|
+
-compiler.warn-bad-date-cast
|
55
|
+
-compiler.warn-bad-es3-type-method
|
56
|
+
-compiler.warn-bad-es3-type-prop
|
57
|
+
-compiler.warn-bad-nan-comparison
|
58
|
+
-compiler.warn-bad-null-assignment
|
59
|
+
-compiler.warn-bad-null-comparison
|
60
|
+
-compiler.warn-bad-undefined-comparison
|
61
|
+
-compiler.warn-boolean-constructor-with-no-args
|
62
|
+
-compiler.warn-changes-in-resolve
|
63
|
+
-compiler.warn-class-is-sealed
|
64
|
+
-compiler.warn-const-not-initialized
|
65
|
+
-compiler.warn-constructor-returns-value
|
66
|
+
-compiler.warn-deprecated-event-handler-error
|
67
|
+
-compiler.warn-deprecated-function-error
|
68
|
+
-compiler.warn-deprecated-property-error
|
69
|
+
-compiler.warn-duplicate-argument-names
|
70
|
+
-compiler.warn-duplicate-variable-def
|
71
|
+
-compiler.warn-for-var-in-changes
|
72
|
+
-compiler.warn-import-hides-class
|
73
|
+
-compiler.warn-instance-of-changes
|
74
|
+
-compiler.warn-internal-error
|
75
|
+
-compiler.warn-level-not-supported
|
76
|
+
-compiler.warn-missing-namespace-decl
|
77
|
+
-compiler.warn-negative-uint-literal
|
78
|
+
-compiler.warn-no-constructor
|
79
|
+
-compiler.warn-no-explicit-super-call-in-constructor
|
80
|
+
-compiler.warn-no-type-decl
|
81
|
+
-compiler.warn-number-from-string-changes
|
82
|
+
-compiler.warn-scoping-change-in-this
|
83
|
+
-compiler.warn-slow-text-field-addition
|
84
|
+
-compiler.warn-unlikely-function-value
|
85
|
+
-compiler.warn-xml-class-has-changed
|
86
|
+
-debug-password <string>
|
87
|
+
-default-background-color <int>
|
88
|
+
-default-frame-rate <int>
|
89
|
+
-default-script-limits <max-recursion-depth> <max-execution-time>
|
90
|
+
-default-size <width> <height>
|
91
|
+
-dump-config <filename>
|
92
|
+
-externs [symbol] [...]
|
93
|
+
-frames.frame [label] [classname] [...]
|
94
|
+
-framework <string>
|
95
|
+
-help [keyword] [...]
|
96
|
+
-include-resource-bundles [bundle] [...]
|
97
|
+
-includes [symbol] [...]
|
98
|
+
-licenses.license <product> <serial-number>
|
99
|
+
-link-report <filename>
|
100
|
+
-load-config <filename>
|
101
|
+
-load-externs <filename>
|
102
|
+
-metadata.contributor <name>
|
103
|
+
-metadata.creator <name>
|
104
|
+
-metadata.date <text>
|
105
|
+
-metadata.description <text>
|
106
|
+
-metadata.language <code>
|
107
|
+
-metadata.localized-description <text> <lang>
|
108
|
+
-metadata.localized-title <title> <lang>
|
109
|
+
-metadata.publisher <name>
|
110
|
+
-metadata.title <text>
|
111
|
+
-output <filename>
|
112
|
+
-raw-metadata <text>
|
113
|
+
-resource-bundle-list <filename>
|
114
|
+
-runtime-shared-libraries [url] [...]
|
115
|
+
-runtime-shared-library-path [path-element] [rsl-url] [policy-file-url] [rsl-url] [policy-file-url]
|
116
|
+
-static-link-runtime-shared-libraries
|
117
|
+
-target-player <version>
|
118
|
+
-use-network
|
119
|
+
-verify-digests
|
120
|
+
-version
|
121
|
+
-warnings
|
122
|
+
|
data/doc/mxmlc-list.txt
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
Adobe Flex Compiler (mxmlc)
|
2
|
+
Version 4.0.0 build 10485
|
3
|
+
Copyright (c) 2004-2009 Adobe Systems, Inc. All rights reserved.
|
4
|
+
|
5
|
+
|
6
|
+
-benchmark
|
7
|
+
-compiler.accessible
|
8
|
+
-compiler.actionscript-file-encoding <string>
|
9
|
+
-compiler.context-root <context-path>
|
10
|
+
-compiler.debug
|
11
|
+
-compiler.enable-runtime-design-layers
|
12
|
+
-compiler.extensions.extension [extension] [parameters] [...]
|
13
|
+
-compiler.external-library-path [path-element] [...]
|
14
|
+
-compiler.fonts.advanced-anti-aliasing
|
15
|
+
-compiler.fonts.flash-type
|
16
|
+
-compiler.fonts.max-glyphs-per-face <string>
|
17
|
+
-compiler.include-libraries [library] [...]
|
18
|
+
-compiler.incremental
|
19
|
+
-compiler.library-path [path-element] [...]
|
20
|
+
-compiler.locale [locale-element] [...]
|
21
|
+
-compiler.mxml.compatibility-version <version>
|
22
|
+
-compiler.namespaces.namespace [uri] [manifest] [...]
|
23
|
+
-compiler.optimize
|
24
|
+
-compiler.services <filename>
|
25
|
+
-compiler.show-actionscript-warnings
|
26
|
+
-compiler.show-binding-warnings
|
27
|
+
-compiler.show-shadowed-device-font-warnings
|
28
|
+
-compiler.show-unused-type-selector-warnings
|
29
|
+
-compiler.source-path [path-element] [...]
|
30
|
+
-compiler.strict
|
31
|
+
-compiler.theme [filename] [...]
|
32
|
+
-compiler.use-resource-bundle-metadata
|
33
|
+
-framework <string>
|
34
|
+
-help [keyword] [...]
|
35
|
+
-include-resource-bundles [bundle] [...]
|
36
|
+
-licenses.license <product> <serial-number>
|
37
|
+
-load-config <filename>
|
38
|
+
-metadata.contributor <name>
|
39
|
+
-metadata.creator <name>
|
40
|
+
-metadata.date <text>
|
41
|
+
-metadata.description <text>
|
42
|
+
-metadata.language <code>
|
43
|
+
-metadata.localized-description <text> <lang>
|
44
|
+
-metadata.localized-title <title> <lang>
|
45
|
+
-metadata.publisher <name>
|
46
|
+
-metadata.title <text>
|
47
|
+
-output <filename>
|
48
|
+
-runtime-shared-libraries [url] [...]
|
49
|
+
-runtime-shared-library-path [path-element] [rsl-url] [policy-file-url] [rsl-url] [policy-file-url]
|
50
|
+
-static-link-runtime-shared-libraries
|
51
|
+
-target-player <version>
|
52
|
+
-use-network
|
53
|
+
-version
|
54
|
+
-warnings
|
55
|
+
|
data/flashsdk.gemspec
CHANGED
@@ -8,15 +8,16 @@ Bundler.setup
|
|
8
8
|
require 'flashsdk'
|
9
9
|
|
10
10
|
Gem::Specification.new do |s|
|
11
|
-
s.name
|
12
|
-
s.version
|
13
|
-
s.author
|
14
|
-
s.email
|
15
|
-
s.homepage
|
16
|
-
s.summary
|
17
|
-
s.description
|
18
|
-
s.executable
|
19
|
-
s.
|
11
|
+
s.name = 'flashsdk'
|
12
|
+
s.version = FlashSDK::VERSION
|
13
|
+
s.author = "Luke Bayes"
|
14
|
+
s.email = "projectsprouts@googlegroups.com"
|
15
|
+
s.homepage = "http://www.adobe.com/products/flex"
|
16
|
+
s.summary = "Adobe Flash SDK including mxmlc, compc, asdoc, adl, adt, optimizer and fdb"
|
17
|
+
s.description = "The Flash SDK Rubygem is brought to you by Project Sprouts (http://projectsprouts.org)"
|
18
|
+
s.executable = 'sprout-as3'
|
19
|
+
s.post_install_message = File.read 'POSTINSTALL.rdoc'
|
20
|
+
s.files = FileList['**/**/*'].exclude /.git|.svn|.DS_Store/
|
20
21
|
s.add_bundler_dependencies
|
21
22
|
s.require_paths << 'lib'
|
22
23
|
end
|
@@ -0,0 +1,89 @@
|
|
1
|
+
module FlashSDK
|
2
|
+
|
3
|
+
class COMPC < CompilerBase
|
4
|
+
include Sprout::Executable
|
5
|
+
|
6
|
+
##
|
7
|
+
# Outputs the SWC file into an open directory format rather than a SWC file
|
8
|
+
#
|
9
|
+
# compc "bin/rsls/foo" do |t|
|
10
|
+
# t.directory = true
|
11
|
+
# t.include_sources = 'src'
|
12
|
+
# end
|
13
|
+
#
|
14
|
+
add_param :directory, Boolean
|
15
|
+
|
16
|
+
##
|
17
|
+
# 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.
|
18
|
+
#
|
19
|
+
# You can use packaged and unpackaged classes. To use components in namespaces, use the include-namespaces option.
|
20
|
+
#
|
21
|
+
# If the components are in packages, ensure that you use dot-notation rather than slashes to separate package levels.
|
22
|
+
#
|
23
|
+
# This is the default option for the component compiler.
|
24
|
+
#
|
25
|
+
add_param :include_classes, Strings
|
26
|
+
|
27
|
+
add_param_alias :ic, :include_classes
|
28
|
+
|
29
|
+
|
30
|
+
##
|
31
|
+
# 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.
|
32
|
+
#
|
33
|
+
# 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.
|
34
|
+
#
|
35
|
+
# For more information, see Adding nonsource classes (http://livedocs.adobe.com/flex/201/html/compilers_123_39.html#158900).
|
36
|
+
#
|
37
|
+
add_param :include_file, Files
|
38
|
+
|
39
|
+
add_param :include_lookup_only, Boolean
|
40
|
+
|
41
|
+
##
|
42
|
+
# 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.
|
43
|
+
#
|
44
|
+
# To use components in packages, use the include-classes option.
|
45
|
+
#
|
46
|
+
add_param :include_namespaces, Strings
|
47
|
+
|
48
|
+
##
|
49
|
+
# 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.
|
50
|
+
#
|
51
|
+
# 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.
|
52
|
+
#
|
53
|
+
add_param :include_resource_bundles, Files
|
54
|
+
|
55
|
+
##
|
56
|
+
# 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.
|
57
|
+
#
|
58
|
+
# If you specify a directory, this option includes all files with an MXML or AS extension, and ignores all other files.
|
59
|
+
#
|
60
|
+
add_param :include_sources, Paths
|
61
|
+
|
62
|
+
##
|
63
|
+
# Not sure about this option, it was in the CLI help, but not documented on the Adobe site
|
64
|
+
#
|
65
|
+
add_param :namespace, String
|
66
|
+
|
67
|
+
##
|
68
|
+
# The default gem name is sprout-flex3sdk
|
69
|
+
#
|
70
|
+
set :pkg_name, 'flex4'
|
71
|
+
|
72
|
+
##
|
73
|
+
# The default gem version
|
74
|
+
#
|
75
|
+
set :pkg_version, ">= #{FlashSDK::VERSION}"
|
76
|
+
|
77
|
+
##
|
78
|
+
# The default executable target
|
79
|
+
#
|
80
|
+
set :executable, :compc
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
def compc args, &block
|
85
|
+
exe = FlashSDK::COMPC.new
|
86
|
+
exe.to_rake(args, &block)
|
87
|
+
exe
|
88
|
+
end
|
89
|
+
|
@@ -0,0 +1,149 @@
|
|
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,40 +1,8 @@
|
|
1
1
|
module FlashSDK
|
2
|
-
|
3
|
-
|
4
|
-
# This task is integrated with the LibraryTask so that if any dependencies are
|
5
|
-
# library tasks, they will be automatically added to the library_path or source_path
|
6
|
-
# depending on whether they provide a swc or sources.
|
7
|
-
#
|
8
|
-
# The entire MXMLC advanced interface has been provided here. All parameter names should be
|
9
|
-
# identical to what is available on the regular compiler except dashes have been replaced
|
10
|
-
# by underscores.
|
11
|
-
#
|
12
|
-
# The following example can be pasted in a file named 'rakefile.rb' which should be placed in
|
13
|
-
# the same folder as an ActionScript 3.0 class named 'SomeProject.as' that extends
|
14
|
-
# flash.display.Sprite.
|
15
|
-
#
|
16
|
-
# # Create a remote library dependency on the corelib swc.
|
17
|
-
# library :corelib
|
18
|
-
#
|
19
|
-
# # Alias the compilation task with one that is easier to type
|
20
|
-
# task :compile => 'SomeProject.swf'
|
21
|
-
#
|
22
|
-
# # Create an MXMLC named for the output file that it creates. This task depends on the
|
23
|
-
# # corelib library and will automatically add the corelib.swc to it's library_path
|
24
|
-
# mxmlc 'SomeProject.swf' => :corelib do |t|
|
25
|
-
# t.input = 'SomeProject.as'
|
26
|
-
# t.default_size = '800 600'
|
27
|
-
# t.default_background_color = "#FFFFFF"
|
28
|
-
# end
|
29
|
-
#
|
30
|
-
# Note: Be sure to check out the features of the Executable to learn more about gem_version and preprocessor
|
31
|
-
#
|
32
|
-
# Interface and descriptions found here:
|
33
|
-
# http://livedocs.adobe.com/flex/2/docs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00001481.html
|
34
|
-
#
|
35
|
-
class MXMLC
|
2
|
+
|
3
|
+
class CompilerBase
|
36
4
|
include Sprout::Executable
|
37
|
-
|
5
|
+
|
38
6
|
##
|
39
7
|
# Enables accessibility features when compiling the Flex application or SWC file. The default value is false.
|
40
8
|
#
|
@@ -139,9 +107,17 @@ module FlashSDK
|
|
139
107
|
add_param :default_script_limits, String
|
140
108
|
|
141
109
|
##
|
142
|
-
# Defines the default application size, in pixels for example:
|
110
|
+
# Defines the default application size, in pixels for example:
|
111
|
+
#
|
112
|
+
# default_size = '950 550'.
|
113
|
+
#
|
114
|
+
# If you're using the Flex 4 SDK, this value should be comma-delimited like:
|
143
115
|
#
|
144
|
-
|
116
|
+
# default_size = '950,550'
|
117
|
+
#
|
118
|
+
# This is an advanced option.
|
119
|
+
#
|
120
|
+
add_param :default_size, String
|
145
121
|
|
146
122
|
##
|
147
123
|
# 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.
|
@@ -583,7 +559,7 @@ module FlashSDK
|
|
583
559
|
#
|
584
560
|
# alias -static-rsls
|
585
561
|
#
|
586
|
-
add_param :static_link_runtime_shared_libraries, Boolean
|
562
|
+
add_param :static_link_runtime_shared_libraries, Boolean, { :default => true }
|
587
563
|
|
588
564
|
##
|
589
565
|
# Alias for static_link_runtime_shared_libraries
|
@@ -653,35 +629,6 @@ module FlashSDK
|
|
653
629
|
#
|
654
630
|
add_param :warnings, Boolean
|
655
631
|
|
656
|
-
##
|
657
|
-
# Main source file to send compiler"
|
658
|
-
# This must be the last item in this list
|
659
|
-
add_param :input, File, { :required => true, :hidden_name => true }
|
660
|
-
|
661
|
-
set :default_prefix, '-'
|
662
|
-
|
663
|
-
##
|
664
|
-
# The default gem name is sprout-flex3sdk
|
665
|
-
#
|
666
|
-
set :pkg_name, 'flex3'
|
667
|
-
|
668
|
-
##
|
669
|
-
# The default gem version
|
670
|
-
#
|
671
|
-
set :pkg_version, '>= 1.0.0.pre'
|
672
|
-
|
673
|
-
##
|
674
|
-
# The default executable target
|
675
|
-
#
|
676
|
-
set :executable, :mxmlc
|
677
|
-
|
678
632
|
end
|
679
633
|
end
|
680
634
|
|
681
|
-
# TODO: Assign mxmlc.output = args || args.first_key
|
682
|
-
def mxmlc args, &block
|
683
|
-
mxmlc_tool = FlashSDK::MXMLC.new
|
684
|
-
mxmlc_tool.to_rake(args, &block)
|
685
|
-
mxmlc_tool
|
686
|
-
end
|
687
|
-
|
@@ -2,21 +2,47 @@ module FlashSDK
|
|
2
2
|
class ClassGenerator < Sprout::Generator::Base
|
3
3
|
include FlashHelper
|
4
4
|
|
5
|
+
##
|
6
|
+
# The path where assets will be created.
|
7
|
+
add_param :assets, String, { :default => 'assets' }
|
8
|
+
|
9
|
+
##
|
10
|
+
# The path where skins will be created.
|
11
|
+
add_param :skins, String, { :default => 'skins' }
|
12
|
+
|
13
|
+
##
|
14
|
+
# The path where test cases should be created.
|
15
|
+
add_param :test, String, { :default => 'test' }
|
16
|
+
|
17
|
+
##
|
18
|
+
# The path where libraries should be added.
|
19
|
+
add_param :lib, String, { :default => 'lib' }
|
20
|
+
|
21
|
+
##
|
22
|
+
# The path where binaries should be created.
|
23
|
+
add_param :bin, String, { :default => 'bin' }
|
24
|
+
|
5
25
|
##
|
6
26
|
# The path where source files should be created.
|
7
27
|
add_param :src, String, { :default => 'src' }
|
8
28
|
|
29
|
+
##
|
30
|
+
# Do not create a test case for this class.
|
31
|
+
add_param :no_test, Boolean
|
32
|
+
|
9
33
|
def manifest
|
10
|
-
|
11
|
-
|
34
|
+
if(!input.match(/Test$/))
|
35
|
+
directory class_directory do
|
36
|
+
template "#{class_name}.as", 'ActionScript3Class.as'
|
37
|
+
end
|
12
38
|
end
|
13
39
|
|
14
|
-
|
15
|
-
|
40
|
+
unless no_test
|
41
|
+
generator :test_class, :input => "#{fully_qualified_class_name}Test"
|
42
|
+
end
|
16
43
|
end
|
17
44
|
|
18
45
|
end
|
19
|
-
|
20
46
|
end
|
21
47
|
|
22
48
|
##
|
@@ -30,14 +56,3 @@ module FlashSDK
|
|
30
56
|
end
|
31
57
|
end
|
32
58
|
|
33
|
-
##
|
34
|
-
# This is a null Generator, if you add a test library
|
35
|
-
# to your Gemfile, it should have it's own TestClassGenerator
|
36
|
-
# that supercedes this one.
|
37
|
-
module FlashSDK
|
38
|
-
class SuiteClassGenerator < Sprout::Generator::Base
|
39
|
-
def manifest
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
@@ -3,6 +3,56 @@ module FlashSDK
|
|
3
3
|
|
4
4
|
module FlashHelper
|
5
5
|
|
6
|
+
def test_class_directory
|
7
|
+
parts = input_in_parts
|
8
|
+
if parts.size > 1
|
9
|
+
parts.pop
|
10
|
+
return File.join test, *parts
|
11
|
+
end
|
12
|
+
return test
|
13
|
+
end
|
14
|
+
|
15
|
+
# Glob that is used to search for test cases and build
|
16
|
+
# up the test suites
|
17
|
+
def test_glob
|
18
|
+
return @test_glob ||= File.join(path, test, '**', '?*Test.as')
|
19
|
+
end
|
20
|
+
|
21
|
+
def test_glob= glob
|
22
|
+
@test_glob = glob
|
23
|
+
end
|
24
|
+
|
25
|
+
# Collection of all test case files either assigned or found
|
26
|
+
# using the test_glob as provided.
|
27
|
+
def test_cases
|
28
|
+
@test_cases ||= Dir.glob(test_glob)
|
29
|
+
end
|
30
|
+
|
31
|
+
def test_cases= collection
|
32
|
+
@test_cases = collection
|
33
|
+
end
|
34
|
+
|
35
|
+
# Get the list of test_cases (which are files) as a
|
36
|
+
# list of fully qualified class names
|
37
|
+
def test_case_classes
|
38
|
+
classes = self.test_cases.dup
|
39
|
+
classes.collect do |file|
|
40
|
+
actionscript_file_to_class_name(file)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
# Transform a file name in the source or test path
|
45
|
+
# to a fully-qualified class name
|
46
|
+
def actionscript_file_to_class_name file
|
47
|
+
name = file.dup
|
48
|
+
name.gsub!(/^#{path}\//, '')
|
49
|
+
name.gsub!(/^#{test}\//, '')
|
50
|
+
name.gsub!(/^#{src}\//, '')
|
51
|
+
name.gsub!(/.as$/, '')
|
52
|
+
name.gsub!(/#{File::SEPARATOR}/, '.')
|
53
|
+
return name
|
54
|
+
end
|
55
|
+
|
6
56
|
def class_directory
|
7
57
|
parts = input_in_parts
|
8
58
|
if parts.size > 1
|
@@ -23,7 +73,27 @@ module FlashSDK
|
|
23
73
|
|
24
74
|
def class_name
|
25
75
|
parts = input_in_parts
|
26
|
-
parts.pop.camel_case
|
76
|
+
name = parts.pop.camel_case
|
77
|
+
if(name.match(/Test$/))
|
78
|
+
return name.gsub(/Test$/, '')
|
79
|
+
end
|
80
|
+
name
|
81
|
+
end
|
82
|
+
|
83
|
+
def test_class_name
|
84
|
+
source = class_name
|
85
|
+
if(!source.match(/Test$/))
|
86
|
+
return "#{source}Test"
|
87
|
+
end
|
88
|
+
source
|
89
|
+
end
|
90
|
+
|
91
|
+
def instance_name
|
92
|
+
# TODO: should uncapitalize class_name
|
93
|
+
# (not the same as lowercase)
|
94
|
+
# If the name is > 12 character, just
|
95
|
+
# use 'instance' instead.
|
96
|
+
'instance'
|
27
97
|
end
|
28
98
|
|
29
99
|
def input_in_parts
|
@@ -1,26 +1,6 @@
|
|
1
1
|
module FlashSDK
|
2
2
|
class ProjectGenerator < ClassGenerator
|
3
3
|
|
4
|
-
##
|
5
|
-
# The path where assets will be created.
|
6
|
-
add_param :assets, String, { :default => 'assets' }
|
7
|
-
|
8
|
-
##
|
9
|
-
# The path where skins will be created.
|
10
|
-
add_param :skins, String, { :default => 'skins' }
|
11
|
-
|
12
|
-
##
|
13
|
-
# The path where test cases should be created.
|
14
|
-
add_param :test, String, { :default => 'test' }
|
15
|
-
|
16
|
-
##
|
17
|
-
# The path where libraries should be added.
|
18
|
-
add_param :lib, String, { :default => 'lib' }
|
19
|
-
|
20
|
-
##
|
21
|
-
# The path where binaries should be created.
|
22
|
-
add_param :bin, String, { :default => 'bin' }
|
23
|
-
|
24
4
|
def manifest
|
25
5
|
directory input do
|
26
6
|
template 'rakefile.rb'
|
@@ -44,10 +24,8 @@ module FlashSDK
|
|
44
24
|
|
45
25
|
protected
|
46
26
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
27
|
+
def debug_swf_name
|
28
|
+
"#{class_name}-debug.swf"
|
29
|
+
end
|
51
30
|
end
|
52
|
-
|
53
31
|
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
module FlashSDK
|
2
|
+
|
3
|
+
# The MXMLC task provides a rake front end to the Flex MXMLC command line compiler.
|
4
|
+
# This task is integrated with the LibraryTask so that if any dependencies are
|
5
|
+
# library tasks, they will be automatically added to the library_path or source_path
|
6
|
+
# depending on whether they provide a swc or sources.
|
7
|
+
#
|
8
|
+
# The entire MXMLC advanced interface has been provided here. All parameter names should be
|
9
|
+
# identical to what is available on the regular compiler except dashes have been replaced
|
10
|
+
# by underscores.
|
11
|
+
#
|
12
|
+
# The following example can be pasted in a file named 'rakefile.rb' which should be placed in
|
13
|
+
# the same folder as an ActionScript 3.0 class named 'SomeProject.as' that extends
|
14
|
+
# flash.display.Sprite.
|
15
|
+
#
|
16
|
+
# # Create a remote library dependency on the corelib swc.
|
17
|
+
# library :corelib
|
18
|
+
#
|
19
|
+
# # Alias the compilation task with one that is easier to type
|
20
|
+
# task :compile => 'SomeProject.swf'
|
21
|
+
#
|
22
|
+
# # Create an MXMLC named for the output file that it creates. This task depends on the
|
23
|
+
# # corelib library and will automatically add the corelib.swc to it's library_path
|
24
|
+
# mxmlc 'SomeProject.swf' => :corelib do |t|
|
25
|
+
# t.input = 'SomeProject.as'
|
26
|
+
# t.default_size = '800 600'
|
27
|
+
# t.default_background_color = "#FFFFFF"
|
28
|
+
# t.library_path << 'lib/SomeLibrary.swc'
|
29
|
+
# t.source_path << 'lib/otherlib'
|
30
|
+
# end
|
31
|
+
#
|
32
|
+
# Note: Be sure to check out the features of the Executable to learn more about gem_version and preprocessor
|
33
|
+
#
|
34
|
+
# Interface and descriptions found here:
|
35
|
+
# http://livedocs.adobe.com/flex/2/docs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00001481.html
|
36
|
+
#
|
37
|
+
class MXMLC < CompilerBase
|
38
|
+
include Sprout::Executable
|
39
|
+
|
40
|
+
##
|
41
|
+
# Main source file to send compiler"
|
42
|
+
# This must be the last item in this list
|
43
|
+
add_param :input, File, { :required => true, :hidden_name => true }
|
44
|
+
|
45
|
+
set :default_prefix, '-'
|
46
|
+
|
47
|
+
##
|
48
|
+
# The default gem name is sprout-flex3sdk
|
49
|
+
#
|
50
|
+
set :pkg_name, 'flex4'
|
51
|
+
|
52
|
+
##
|
53
|
+
# The default gem version
|
54
|
+
#
|
55
|
+
set :pkg_version, ">= #{VERSION}"
|
56
|
+
|
57
|
+
##
|
58
|
+
# The default executable target
|
59
|
+
#
|
60
|
+
set :executable, :mxmlc
|
61
|
+
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
def mxmlc args, &block
|
66
|
+
exe = FlashSDK::MXMLC.new
|
67
|
+
exe.to_rake(args, &block)
|
68
|
+
exe
|
69
|
+
end
|
70
|
+
|
data/lib/flashsdk.rb
CHANGED
@@ -7,6 +7,8 @@ require 'flashsdk/module'
|
|
7
7
|
require 'flashsdk/generators/flash_helper'
|
8
8
|
require 'flashsdk/generators/class_generator'
|
9
9
|
require 'flashsdk/generators/project_generator'
|
10
|
-
require 'flashsdk/
|
10
|
+
require 'flashsdk/compiler_base'
|
11
|
+
require 'flashsdk/mxmlc'
|
12
|
+
require 'flashsdk/compc'
|
11
13
|
require 'flashplayer'
|
12
14
|
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), 'test_helper')
|
2
|
+
|
3
|
+
class COMPCTest < Test::Unit::TestCase
|
4
|
+
include SproutTestCase
|
5
|
+
|
6
|
+
context "An COMPC tool" do
|
7
|
+
|
8
|
+
setup do
|
9
|
+
@fixture = File.join 'test', 'fixtures', 'compc', 'simple'
|
10
|
+
@input = File.join @fixture, 'SomeFile.as'
|
11
|
+
@expected_output = File.join @fixture, 'SomeFile.swc'
|
12
|
+
#Sprout::Log.debug = false
|
13
|
+
end
|
14
|
+
|
15
|
+
teardown do
|
16
|
+
remove_file @expected_output
|
17
|
+
end
|
18
|
+
|
19
|
+
should "accept input" do
|
20
|
+
as_a_unix_system do
|
21
|
+
compc = FlashSDK::COMPC.new
|
22
|
+
compc.output = @expected_output
|
23
|
+
compc.include_sources << @fixture
|
24
|
+
assert_equal '--output=test/fixtures/compc/simple/SomeFile.swc --static-link-runtime-shared-libraries --include-sources+=test/fixtures/compc/simple', compc.to_shell
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
should "compile a swc" do
|
29
|
+
compc = FlashSDK::COMPC.new
|
30
|
+
compc.include_sources << @fixture
|
31
|
+
compc.output = @expected_output
|
32
|
+
compc.execute
|
33
|
+
assert_file @expected_output
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
data/test/unit/mxmlc_test.rb
CHANGED
@@ -21,18 +21,24 @@ class MXMLCTest < Test::Unit::TestCase
|
|
21
21
|
mxmlc = FlashSDK::MXMLC.new
|
22
22
|
mxmlc.input = @input
|
23
23
|
mxmlc.source_path << @fixture
|
24
|
-
assert_equal '--source-path+=test/fixtures/mxmlc/simple test/fixtures/mxmlc/simple/SomeFile.as', mxmlc.to_shell
|
24
|
+
assert_equal '--source-path+=test/fixtures/mxmlc/simple --static-link-runtime-shared-libraries test/fixtures/mxmlc/simple/SomeFile.as', mxmlc.to_shell
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
28
|
should "compile a swf" do
|
29
29
|
mxmlc = FlashSDK::MXMLC.new
|
30
30
|
mxmlc.input = @input
|
31
|
-
# Turn on to trigger an actual compilation:
|
32
|
-
# (This is too damn slow to leave in the every-time test run)
|
33
31
|
mxmlc.execute
|
34
32
|
assert_file @expected_output
|
35
33
|
end
|
34
|
+
|
35
|
+
|
36
|
+
should "assign default-size" do
|
37
|
+
mxmlc = FlashSDK::MXMLC.new
|
38
|
+
mxmlc.default_size = '800,500'
|
39
|
+
mxmlc.static_link_runtime_shared_libraries = false
|
40
|
+
assert_equal '--default-size=800,500', mxmlc.to_shell
|
41
|
+
end
|
36
42
|
|
37
43
|
should "assign simple output" do
|
38
44
|
t = mxmlc 'bin/SomeProject.swf' do |t|
|
data/test/unit/test_helper.rb
CHANGED
metadata
CHANGED
@@ -5,9 +5,9 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 0
|
8
|
-
-
|
8
|
+
- 5
|
9
9
|
- pre
|
10
|
-
version: 1.0.
|
10
|
+
version: 1.0.5.pre
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Luke Bayes
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-07-
|
18
|
+
date: 2010-07-05 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -27,9 +27,9 @@ dependencies:
|
|
27
27
|
segments:
|
28
28
|
- 1
|
29
29
|
- 0
|
30
|
-
-
|
30
|
+
- 20
|
31
31
|
- pre
|
32
|
-
version: 1.0.
|
32
|
+
version: 1.0.20.pre
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
35
|
version_requirements: *id001
|
@@ -67,6 +67,11 @@ extra_rdoc_files: []
|
|
67
67
|
|
68
68
|
files:
|
69
69
|
- bin/sprout-as3
|
70
|
+
- doc/adl-list.txt
|
71
|
+
- doc/adt-list.txt
|
72
|
+
- doc/compc-list.txt
|
73
|
+
- doc/mxmlc-advanced-list.txt
|
74
|
+
- doc/mxmlc-list.txt
|
70
75
|
- flashsdk.gemspec
|
71
76
|
- Gemfile
|
72
77
|
- lib/flashplayer/clix_flash_player.rb
|
@@ -80,6 +85,9 @@ files:
|
|
80
85
|
- lib/flashplayer/task.rb
|
81
86
|
- lib/flashplayer/trust.rb
|
82
87
|
- lib/flashplayer.rb
|
88
|
+
- lib/flashsdk/compc.rb
|
89
|
+
- lib/flashsdk/compc_legacy.rb
|
90
|
+
- lib/flashsdk/compiler_base.rb
|
83
91
|
- lib/flashsdk/generators/class_generator.rb
|
84
92
|
- lib/flashsdk/generators/flash_helper.rb
|
85
93
|
- lib/flashsdk/generators/project_generator.rb
|
@@ -89,15 +97,18 @@ files:
|
|
89
97
|
- lib/flashsdk/generators/templates/Gemfile
|
90
98
|
- lib/flashsdk/generators/templates/rakefile.rb
|
91
99
|
- lib/flashsdk/module.rb
|
92
|
-
- lib/flashsdk/
|
93
|
-
- lib/flashsdk/
|
100
|
+
- lib/flashsdk/mxmlc.rb
|
101
|
+
- lib/flashsdk/mxmlc_legacy.rb
|
94
102
|
- lib/flashsdk.rb
|
95
103
|
- lib/flex3.rb
|
96
104
|
- lib/flex4.rb
|
105
|
+
- POSTINSTALL.rdoc
|
97
106
|
- rakefile.rb
|
98
107
|
- README.textile
|
108
|
+
- test/fixtures/compc/simple/SomeFile.as
|
99
109
|
- test/fixtures/mxmlc/simple/SomeFile.as
|
100
110
|
- test/unit/class_generator_test.rb
|
111
|
+
- test/unit/compc_test.rb
|
101
112
|
- test/unit/flash_helper_test.rb
|
102
113
|
- test/unit/flashplayer_test.rb
|
103
114
|
- test/unit/log_file_test.rb
|
@@ -112,7 +123,47 @@ has_rdoc: true
|
|
112
123
|
homepage: http://www.adobe.com/products/flex
|
113
124
|
licenses: []
|
114
125
|
|
115
|
-
post_install_message:
|
126
|
+
post_install_message: |+
|
127
|
+
++++++++++++++++++++++++++++++++
|
128
|
+
You have successfully installed the Project Sprouts FlashSDK!
|
129
|
+
|
130
|
+
To get started with a new ActionScript 3 project:
|
131
|
+
|
132
|
+
# Generate a project named 'SomeProject'
|
133
|
+
sprout-as3 SomeProject
|
134
|
+
|
135
|
+
# Change directory to the newly-created directory:
|
136
|
+
cd SomeProject
|
137
|
+
|
138
|
+
# Install whatever additional gems are required
|
139
|
+
# by this project Gemfile:
|
140
|
+
bundle install
|
141
|
+
|
142
|
+
# Use Rake to run the default task:
|
143
|
+
rake
|
144
|
+
|
145
|
+
++++++++++++++++++++++++++++++++
|
146
|
+
Next Steps:
|
147
|
+
|
148
|
+
# Generate a new class, test case and test suite:
|
149
|
+
sprout-class utils.MathUtil
|
150
|
+
|
151
|
+
# Compile and run the test harness:
|
152
|
+
rake test
|
153
|
+
|
154
|
+
# List available rake tasks:
|
155
|
+
rake -T
|
156
|
+
|
157
|
+
# List available generators:
|
158
|
+
sprout-
|
159
|
+
(followed by the TAB key)
|
160
|
+
|
161
|
+
++++++++++++++++++++++++++++++++
|
162
|
+
Issues or Questions?
|
163
|
+
|
164
|
+
Email us at:
|
165
|
+
projectsprouts@googlegroups.com
|
166
|
+
|
116
167
|
rdoc_options: []
|
117
168
|
|
118
169
|
require_paths:
|
File without changes
|