sprout-as3-bundle 0.1.45 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/sprout/as3/version.rb +2 -2
- data/lib/sprout/as3_tasks.rb +8 -1
- data/lib/sprout/generators/project/templates/rakefile.rb +30 -93
- data/lib/sprout/tasks/{adl_doc.rb → adl_rdoc.rb} +0 -0
- data/lib/sprout/tasks/{adt_cert_doc.rb → adt_cert_rdoc.rb} +0 -0
- data/lib/sprout/tasks/{adt_doc.rb → adt_rdoc.rb} +0 -0
- data/lib/sprout/tasks/{asdoc_doc.rb → asdoc_rdoc.rb} +0 -0
- data/lib/sprout/tasks/asdoc_task.rb +3 -3
- data/lib/sprout/tasks/{compc_doc.rb → compc_rdoc.rb} +0 -0
- data/lib/sprout/tasks/compc_task.rb +1 -1
- data/lib/sprout/tasks/mxmlc_debug.rb +25 -0
- data/lib/sprout/tasks/mxmlc_deploy.rb +37 -0
- data/lib/sprout/tasks/mxmlc_document.rb +29 -0
- data/lib/sprout/tasks/mxmlc_flex_builder.rb +125 -0
- data/lib/sprout/tasks/mxmlc_helper.rb +156 -0
- data/lib/sprout/tasks/{mxmlc_doc.rb → mxmlc_rdoc.rb} +0 -0
- data/lib/sprout/tasks/mxmlc_stylesheet.rb +38 -0
- data/lib/sprout/tasks/mxmlc_task.rb +12 -1
- data/lib/sprout/tasks/mxmlc_unit.rb +44 -0
- data/rakefile.rb +2 -2
- metadata +18 -11
- data/lib/sprout/tasks/asunit_task.rb +0 -148
data/lib/sprout/as3/version.rb
CHANGED
data/lib/sprout/as3_tasks.rb
CHANGED
@@ -4,6 +4,13 @@ require 'sprout/tasks/fdb_task'
|
|
4
4
|
require 'sprout/tasks/mxmlc_task'
|
5
5
|
require 'sprout/tasks/compc_task'
|
6
6
|
require 'sprout/tasks/asdoc_task'
|
7
|
-
require 'sprout/tasks/asunit_task'
|
8
7
|
require 'sprout/tasks/adl_task'
|
9
8
|
require 'sprout/tasks/adt_task'
|
9
|
+
|
10
|
+
require 'sprout/tasks/mxmlc_helper'
|
11
|
+
require 'sprout/tasks/mxmlc_flex_builder'
|
12
|
+
require 'sprout/tasks/mxmlc_unit'
|
13
|
+
require 'sprout/tasks/mxmlc_debug'
|
14
|
+
require 'sprout/tasks/mxmlc_deploy'
|
15
|
+
require 'sprout/tasks/mxmlc_document'
|
16
|
+
require 'sprout/tasks/mxmlc_stylesheet'
|
@@ -4,103 +4,40 @@ require 'sprout'
|
|
4
4
|
sprout 'as3'
|
5
5
|
|
6
6
|
############################################
|
7
|
-
#
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
#
|
15
|
-
#
|
16
|
-
#
|
17
|
-
#
|
18
|
-
|
19
|
-
|
20
|
-
|
7
|
+
# Configure your Project Model
|
8
|
+
project_model :model do |m|
|
9
|
+
m.project_name = '<%= project_name %>'
|
10
|
+
m.language = 'as3'
|
11
|
+
m.background_color = '#FFFFFF'
|
12
|
+
m.width = 970
|
13
|
+
m.height = 550
|
14
|
+
# m.src_dir = 'src'
|
15
|
+
# m.lib_dir = 'lib'
|
16
|
+
# m.swc_dir = 'lib'
|
17
|
+
# m.bin_dir = 'bin'
|
18
|
+
# m.test_dir = 'test'
|
19
|
+
# m.doc_dir = 'doc'
|
20
|
+
# m.asset_dir = 'assets'
|
21
|
+
# m.compiler_gem_name = 'sprout-flex4sdk-tool'
|
22
|
+
# m.compiler_gem_version = '>= 4.0.0'
|
23
|
+
# m.source_path << "#{m.lib_dir}/somelib"
|
24
|
+
# m.libraries << :corelib
|
21
25
|
end
|
22
26
|
|
23
|
-
|
27
|
+
desc 'Compile and run the application for debugging'
|
28
|
+
debug :debug
|
24
29
|
|
25
|
-
|
26
|
-
|
27
|
-
# the task name will be converted to a string
|
28
|
-
# and modified as follows sprout-#{name}-library
|
29
|
-
# unless you pass t.gem_name = 'full-sprout-name'
|
30
|
-
# For libraries that contain source code, the
|
31
|
-
# task name will also be the folder name that
|
32
|
-
# will be added to ProjectModel.lib_dir
|
33
|
-
# For a complete list of available sprout gems:
|
34
|
-
# http://rubyforge.org/frs/?group_id=3688
|
35
|
-
# You can also search that list directly from a
|
36
|
-
# terminal as follows:
|
37
|
-
# gem search -r sprout-*library
|
38
|
-
|
39
|
-
library :asunit3
|
40
|
-
library :corelib
|
30
|
+
desc 'Compile and run the test harness'
|
31
|
+
unit :test
|
41
32
|
|
42
|
-
|
43
|
-
|
44
|
-
# NOTE: double-quoted strings in ruby enable
|
45
|
-
# runtime expression evaluation using the
|
46
|
-
# following syntax:
|
47
|
-
# "Some String with: #{variable}"
|
33
|
+
desc 'Compile for deployment'
|
34
|
+
deploy :deploy => :doc
|
48
35
|
|
49
|
-
desc
|
50
|
-
|
36
|
+
desc 'Generate documentation'
|
37
|
+
document :doc
|
51
38
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
############################################
|
56
|
-
# Launch the test suites using the Flash Player
|
39
|
+
desc "Generate Flex Builder project files"
|
40
|
+
flex_builder :project
|
57
41
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
############################################
|
62
|
-
# Compile your application using mxmlc
|
63
|
-
# Any library tasks that are set as
|
64
|
-
# dependencies will automatically be added
|
65
|
-
# to the compiler source or swc paths
|
66
|
-
|
67
|
-
desc "Compile application"
|
68
|
-
mxmlc model.output => [:corelib] do |t|
|
69
|
-
# Uncomment to use the Flex 3 SDK
|
70
|
-
# t.gem_name = 'sprout-flex3sdk-tool'
|
71
|
-
t.warnings = true
|
72
|
-
t.default_background_color = '#FFFFFF'
|
73
|
-
t.default_frame_rate = 24
|
74
|
-
t.default_size = '600 400'
|
75
|
-
t.input = "#{model.src_dir}/<%= project_name %>.as"
|
76
|
-
t.source_path << model.asset_dir
|
77
|
-
# t.source_path << "#{model.lib_dir}/non-sprout-src-library"
|
78
|
-
# t.library_path << "#{model.lib_dir}/non-sprout.swc"
|
79
|
-
end
|
80
|
-
|
81
|
-
############################################
|
82
|
-
# Compile test harness using mxmlc
|
83
|
-
|
84
|
-
desc "Compile test harness"
|
85
|
-
mxmlc model.test_output => [:asunit3, :corelib] do |t|
|
86
|
-
# Uncomment to use the Flex 3 SDK
|
87
|
-
# t.gem_name = 'sprout-flex3sdk-tool'
|
88
|
-
t.warnings = true
|
89
|
-
t.default_background_color = '#FFFFFF'
|
90
|
-
t.default_frame_rate = 24
|
91
|
-
t.verbose_stacktraces = true
|
92
|
-
t.default_size = "800 450"
|
93
|
-
t.input = "#{model.src_dir}/<%= project_name %>Runner.as"
|
94
|
-
t.source_path << model.src_dir
|
95
|
-
t.source_path << model.test_dir
|
96
|
-
t.source_path << model.asset_dir
|
97
|
-
end
|
98
|
-
|
99
|
-
############################################
|
100
|
-
# Build documentation for your application
|
101
|
-
|
102
|
-
desc "Create documentation"
|
103
|
-
asdoc model.doc_dir => model.test_output do |t|
|
104
|
-
# Uncomment to use the Flex 3 SDK
|
105
|
-
# t.gem_name = 'sprout-flex3sdk-tool'
|
106
|
-
end
|
42
|
+
# set up the default rake task
|
43
|
+
task :default => :debug
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -39,7 +39,7 @@ module Sprout
|
|
39
39
|
|
40
40
|
def initialize_task
|
41
41
|
super
|
42
|
-
@default_gem_name = 'sprout-
|
42
|
+
@default_gem_name = 'sprout-flex3sdk-tool'
|
43
43
|
@default_gem_path = 'bin/asdoc'
|
44
44
|
|
45
45
|
add_param(:actionscript_file_encoding, :string) do |p|
|
@@ -260,7 +260,7 @@ EOF
|
|
260
260
|
end
|
261
261
|
end
|
262
262
|
|
263
|
-
# The AsDoc
|
263
|
+
# The AsDoc package includes an asDocHelper binary that is packaged up without
|
264
264
|
# the executable flag, calling Sprout::get_executable with this target will
|
265
265
|
# automatically chmod it to 744.
|
266
266
|
def update_helper_mode
|
@@ -271,6 +271,6 @@ EOF
|
|
271
271
|
end
|
272
272
|
|
273
273
|
def asdoc(args, &block)
|
274
|
-
Sprout::AsDocTask.define_task(args, &block)
|
274
|
+
return Sprout::AsDocTask.define_task(args, &block)
|
275
275
|
end
|
276
276
|
|
File without changes
|
@@ -0,0 +1,25 @@
|
|
1
|
+
|
2
|
+
module Sprout # :nodoc:
|
3
|
+
class MXMLCDebug < MXMLCHelper # :nodoc:
|
4
|
+
|
5
|
+
def initialize(args, &block)
|
6
|
+
super
|
7
|
+
t = define_outer_task
|
8
|
+
t.prerequisites << player_task_name
|
9
|
+
|
10
|
+
mxmlc output do |t|
|
11
|
+
configure_mxmlc t
|
12
|
+
configure_mxmlc_application t
|
13
|
+
yield t if block_given?
|
14
|
+
end
|
15
|
+
|
16
|
+
define_player
|
17
|
+
return output
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def debug(args, &block)
|
24
|
+
return Sprout::MXMLCDebug.new(args, &block)
|
25
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
|
2
|
+
module Sprout
|
3
|
+
class MXMLCDeploy < MXMLCHelper # :nodoc:
|
4
|
+
|
5
|
+
def initialize(args, &block)
|
6
|
+
super
|
7
|
+
t = define_outer_task
|
8
|
+
t.prerequisites << player_task_name
|
9
|
+
|
10
|
+
out_task = mxmlc output do |t|
|
11
|
+
configure_mxmlc t
|
12
|
+
configure_mxmlc_application t
|
13
|
+
t.optimize = true
|
14
|
+
t.warnings = false
|
15
|
+
t.verbose_stacktraces = false
|
16
|
+
|
17
|
+
block.call t if !block.nil?
|
18
|
+
end
|
19
|
+
|
20
|
+
task player_task_name => output
|
21
|
+
return out_task
|
22
|
+
end
|
23
|
+
|
24
|
+
def create_input
|
25
|
+
return File.join(@model.src_dir, @model.project_name) + input_extension
|
26
|
+
end
|
27
|
+
|
28
|
+
def create_output
|
29
|
+
return "#{create_output_base}.swf"
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def deploy(args, &block)
|
36
|
+
return Sprout::MXMLCDeploy.new(args, &block)
|
37
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
|
2
|
+
module Sprout # :nodoc:
|
3
|
+
class MXMLCDocument < MXMLCHelper # :nodoc:
|
4
|
+
|
5
|
+
def initialize(args, &block)
|
6
|
+
super
|
7
|
+
asdoc output => input do |t|
|
8
|
+
t.output = 'doc'
|
9
|
+
yield t if block_given?
|
10
|
+
end
|
11
|
+
|
12
|
+
outer = define_outer_task
|
13
|
+
outer.prerequisites << output
|
14
|
+
end
|
15
|
+
|
16
|
+
def create_output
|
17
|
+
return File.join(model.doc_dir, 'index.html')
|
18
|
+
end
|
19
|
+
|
20
|
+
def create_input
|
21
|
+
return "#{create_output_base}.swf"
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def document(args, &block)
|
28
|
+
Sprout::MXMLCDocument.new(args, &block)
|
29
|
+
end
|
@@ -0,0 +1,125 @@
|
|
1
|
+
|
2
|
+
module Sprout
|
3
|
+
class MXMLCFlexBuilder < MXMLCHelper # :nodoc:
|
4
|
+
PROJECT = '.project'
|
5
|
+
ACTION_SCRIPT_PROPERTIES = '.actionScriptProperties'
|
6
|
+
|
7
|
+
def initialize(args, &block)
|
8
|
+
super
|
9
|
+
|
10
|
+
t = file PROJECT do |t|
|
11
|
+
File.open(t.name, 'w') do |file|
|
12
|
+
file.write t.to_xml
|
13
|
+
end
|
14
|
+
end
|
15
|
+
configure_project_task t
|
16
|
+
|
17
|
+
t = file ACTION_SCRIPT_PROPERTIES do |t|
|
18
|
+
File.open(t.name, 'w') do |file|
|
19
|
+
file.write t.to_xml
|
20
|
+
end
|
21
|
+
end
|
22
|
+
configure_action_script_properties t
|
23
|
+
|
24
|
+
task args => [PROJECT, ACTION_SCRIPT_PROPERTIES]
|
25
|
+
end
|
26
|
+
|
27
|
+
def configure_project_task(project_task)
|
28
|
+
def project_task.xml=(str)
|
29
|
+
@xml = str
|
30
|
+
end
|
31
|
+
|
32
|
+
project_task.xml = <<EOF
|
33
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
34
|
+
<projectDescription>
|
35
|
+
<name>#{model.project_name}</name>
|
36
|
+
<comment></comment>
|
37
|
+
<projects>
|
38
|
+
</projects>
|
39
|
+
<buildSpec>
|
40
|
+
<buildCommand>
|
41
|
+
<name>com.adobe.flexbuilder.project.flexbuilder</name>
|
42
|
+
<arguments>
|
43
|
+
</arguments>
|
44
|
+
</buildCommand>
|
45
|
+
</buildSpec>
|
46
|
+
<natures>
|
47
|
+
<nature>com.adobe.flexbuilder.project.actionscriptnature</nature>
|
48
|
+
</natures>
|
49
|
+
</projectDescription>
|
50
|
+
EOF
|
51
|
+
|
52
|
+
def project_task.to_xml
|
53
|
+
return @xml
|
54
|
+
end
|
55
|
+
|
56
|
+
end
|
57
|
+
|
58
|
+
def configure_action_script_properties(properties_task)
|
59
|
+
def properties_task.xml=(str)
|
60
|
+
@xml = str
|
61
|
+
end
|
62
|
+
|
63
|
+
str1 = <<EOF
|
64
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
65
|
+
<actionScriptProperties mainApplicationPath="#{model.project_name}.as" version="3">
|
66
|
+
<compiler additionalCompilerArguments="--default-size #{model.width} #{model.height} --default-background-color #{model.background_color}" copyDependentFiles="false" enableModuleDebug="true" flexSDK="Flex 3" generateAccessible="false" htmlExpressInstall="true" htmlGenerate="false" htmlHistoryManagement="true" htmlPlayerVersion="9.0.28" htmlPlayerVersionCheck="true" outputFolderPath="bin" sourceFolderPath="src" strict="true" useApolloConfig="false" verifyDigests="true" warn="true">
|
67
|
+
<compilerSourcePath>
|
68
|
+
EOF
|
69
|
+
str2 = ""
|
70
|
+
model.source_path.each do |path|
|
71
|
+
str2 << "<compilerSourcePathEntry kind=\"1\" linkType=\"1\" path=\"#{path}\"/>\n"
|
72
|
+
end
|
73
|
+
|
74
|
+
str3 = <<EOF
|
75
|
+
</compilerSourcePath>
|
76
|
+
<libraryPath defaultLinkType="1">
|
77
|
+
<libraryPathEntry kind="4" path="">
|
78
|
+
<excludedEntries>
|
79
|
+
EOF
|
80
|
+
str4 = <<EOF
|
81
|
+
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_agent.swc" useDefaultLinkType="false"/>
|
82
|
+
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation.swc" useDefaultLinkType="false"/>
|
83
|
+
<libraryPathEntry kind="1" linkType="1" path="${PROJECT_FRAMEWORKS}/locale/{locale}"/>
|
84
|
+
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_flashflexkit.swc" useDefaultLinkType="false"/>
|
85
|
+
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/qtp.swc" useDefaultLinkType="false"/>
|
86
|
+
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/charts.swc" useDefaultLinkType="false"/>
|
87
|
+
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/rpc.swc" useDefaultLinkType="false"/>
|
88
|
+
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_charts.swc" useDefaultLinkType="false"/>
|
89
|
+
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/datavisualization.swc" useDefaultLinkType="false"/>
|
90
|
+
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_dmv.swc" useDefaultLinkType="false"/>
|
91
|
+
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/framework.swc" useDefaultLinkType="false"/>
|
92
|
+
</excludedEntries>
|
93
|
+
</libraryPathEntry>
|
94
|
+
EOF
|
95
|
+
str5 = ""
|
96
|
+
model.library_path.each do |path|
|
97
|
+
str5 << "<libraryPathEntry kind=\"1\" linkType=\"1\" path=\"#{path}\"/>\n"
|
98
|
+
end
|
99
|
+
|
100
|
+
str6 = <<EOF
|
101
|
+
</libraryPath>
|
102
|
+
<sourceAttachmentPath/>
|
103
|
+
</compiler>
|
104
|
+
<applications>
|
105
|
+
<application path="#{model.project_name}.as"/>
|
106
|
+
</applications>
|
107
|
+
<modules/>
|
108
|
+
<buildCSSFiles/>
|
109
|
+
</actionScriptProperties>
|
110
|
+
EOF
|
111
|
+
|
112
|
+
properties_task.xml = str1 + str2 + str3 + str4 + str5 + str6
|
113
|
+
|
114
|
+
def properties_task.to_xml
|
115
|
+
return @xml
|
116
|
+
end
|
117
|
+
|
118
|
+
end
|
119
|
+
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
def flex_builder(args, &block)
|
124
|
+
return Sprout::MXMLCFlexBuilder.new(args, &block)
|
125
|
+
end
|
@@ -0,0 +1,156 @@
|
|
1
|
+
|
2
|
+
module Sprout
|
3
|
+
class MXMLCHelper # :nodoc:
|
4
|
+
attr_reader :model
|
5
|
+
|
6
|
+
def initialize(args, &block)
|
7
|
+
resolve_task_args(args)
|
8
|
+
@model = get_model args
|
9
|
+
end
|
10
|
+
|
11
|
+
def output
|
12
|
+
return @output ||= create_output
|
13
|
+
end
|
14
|
+
|
15
|
+
def input
|
16
|
+
return @input ||= create_input
|
17
|
+
end
|
18
|
+
|
19
|
+
def task_name
|
20
|
+
return @task_name
|
21
|
+
end
|
22
|
+
|
23
|
+
def prerequisites
|
24
|
+
return @prerequisites ||= []
|
25
|
+
end
|
26
|
+
|
27
|
+
protected
|
28
|
+
|
29
|
+
def resolve_task_args(args)
|
30
|
+
if(args.is_a?(Symbol))
|
31
|
+
@task_name = args.to_s
|
32
|
+
elsif(args.is_a?(Hash))
|
33
|
+
args.each do |key, value|
|
34
|
+
@task_name = key.to_s
|
35
|
+
if(value.is_a?(Array))
|
36
|
+
value.each do |dep|
|
37
|
+
self.prerequisites << dep
|
38
|
+
end
|
39
|
+
elsif(!value.nil?)
|
40
|
+
self.prerequisites << value
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def configure_mxmlc(compiler)
|
47
|
+
compiler.input = input
|
48
|
+
compiler.gem_name = model.compiler_gem_name
|
49
|
+
compiler.gem_version = model.compiler_gem_version
|
50
|
+
|
51
|
+
# Set up library deps
|
52
|
+
model.libraries.each do |lib|
|
53
|
+
begin
|
54
|
+
t = Rake::application[lib]
|
55
|
+
rescue
|
56
|
+
library lib
|
57
|
+
end
|
58
|
+
compiler.prerequisites << lib
|
59
|
+
end
|
60
|
+
|
61
|
+
compiler.source_path << model.src_dir
|
62
|
+
compiler.source_path << model.asset_dir if File.exists?(model.asset_dir)
|
63
|
+
|
64
|
+
model.source_path.each do |path|
|
65
|
+
compiler.source_path << path
|
66
|
+
end
|
67
|
+
|
68
|
+
model.library_path.each do |path|
|
69
|
+
compiler.library_path << path
|
70
|
+
end
|
71
|
+
|
72
|
+
end
|
73
|
+
|
74
|
+
def configure_mxmlc_application(compiler)
|
75
|
+
compiler.warnings = true
|
76
|
+
compiler.verbose_stacktraces = true
|
77
|
+
compiler.default_background_color = model.background_color if model.background_color
|
78
|
+
compiler.default_frame_rate = model.frame_rate if model.frame_rate
|
79
|
+
if(model.width && model.height)
|
80
|
+
compiler.default_size = "#{model.width} #{model.height}"
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
def define_player
|
85
|
+
flashplayer player_task_name => output_file
|
86
|
+
end
|
87
|
+
|
88
|
+
def define_outer_task
|
89
|
+
t = task task_name
|
90
|
+
self.prerequisites.each do |dep|
|
91
|
+
t.prerequisites << dep
|
92
|
+
end
|
93
|
+
return t
|
94
|
+
end
|
95
|
+
|
96
|
+
def append_prerequisite(task_name, prerequisite_name)
|
97
|
+
t = Rake::application[task_name]
|
98
|
+
t.prerequisites << prerequisite_name
|
99
|
+
end
|
100
|
+
|
101
|
+
def output_file
|
102
|
+
@output_file ||= create_output
|
103
|
+
end
|
104
|
+
|
105
|
+
def create_output_base
|
106
|
+
return File.join(@model.bin_dir, @model.project_name)
|
107
|
+
end
|
108
|
+
|
109
|
+
def create_output
|
110
|
+
return "#{create_output_base}-debug.swf"
|
111
|
+
end
|
112
|
+
|
113
|
+
def player_task_name
|
114
|
+
return "run_#{create_output}"
|
115
|
+
end
|
116
|
+
|
117
|
+
def create_input
|
118
|
+
return File.join(@model.src_dir, @model.project_name) + input_extension
|
119
|
+
end
|
120
|
+
|
121
|
+
# Provided task name represents a Rake task
|
122
|
+
# that has had a ProjectModel appended to it
|
123
|
+
def project_model?(name)
|
124
|
+
return Rake::application[name].respond_to?('project_model')
|
125
|
+
end
|
126
|
+
|
127
|
+
def get_model(args)
|
128
|
+
# Look for the special, appended task method 'project_model'
|
129
|
+
# in the forwarded prerequisites
|
130
|
+
if args.is_a?(Symbol)
|
131
|
+
return ProjectModel.instance
|
132
|
+
end
|
133
|
+
|
134
|
+
args.each_value do |deps|
|
135
|
+
if(deps.is_a?(Array))
|
136
|
+
deps.each do |dep|
|
137
|
+
if(project_model?(dep))
|
138
|
+
return Rake::application[dep].project_model
|
139
|
+
end
|
140
|
+
end
|
141
|
+
else
|
142
|
+
if(project_model?(deps))
|
143
|
+
return Rake::application[deps].project_model
|
144
|
+
end
|
145
|
+
end
|
146
|
+
end
|
147
|
+
return ProjectModel.instance
|
148
|
+
end
|
149
|
+
|
150
|
+
def input_extension
|
151
|
+
return '.as' unless (@model.language == 'mxml')
|
152
|
+
return '.mxml'
|
153
|
+
end
|
154
|
+
|
155
|
+
end
|
156
|
+
end
|
File without changes
|
@@ -0,0 +1,38 @@
|
|
1
|
+
|
2
|
+
module Sprout # :nodoc:
|
3
|
+
class MXMLCStyleSheet < MXMLCHelper # :nodoc:
|
4
|
+
|
5
|
+
def initialize(args, &block)
|
6
|
+
super
|
7
|
+
outer = define_outer_task
|
8
|
+
|
9
|
+
mxmlc output do |t|
|
10
|
+
configure_mxmlc t
|
11
|
+
yield t if block_given?
|
12
|
+
end
|
13
|
+
|
14
|
+
outer.prerequisites << output
|
15
|
+
return output
|
16
|
+
end
|
17
|
+
|
18
|
+
protected
|
19
|
+
|
20
|
+
def create_input
|
21
|
+
return File.join(@model.src_dir, @model.project_name + 'Skin') + input_extension
|
22
|
+
end
|
23
|
+
|
24
|
+
def create_output
|
25
|
+
return "#{create_output_base}Skin.swf"
|
26
|
+
end
|
27
|
+
|
28
|
+
def input_extension
|
29
|
+
return '.css'
|
30
|
+
end
|
31
|
+
|
32
|
+
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def stylesheet(args, &block)
|
37
|
+
return Sprout::MXMLCStyleSheet.new(args, &block)
|
38
|
+
end
|
@@ -62,7 +62,7 @@ module Sprout
|
|
62
62
|
# Interface and descriptions found here:
|
63
63
|
# http://livedocs.adobe.com/flex/2/docs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00001481.html
|
64
64
|
def initialize_task
|
65
|
-
@default_gem_name = 'sprout-
|
65
|
+
@default_gem_name = 'sprout-flex3sdk-tool'
|
66
66
|
@default_gem_path = 'bin/mxmlc'
|
67
67
|
|
68
68
|
add_param(:accessible, :boolean) do |p|
|
@@ -615,10 +615,20 @@ EOF
|
|
615
615
|
end
|
616
616
|
end
|
617
617
|
|
618
|
+
if(!input)
|
619
|
+
raise MXMLCError.new('MXMLCTask.input is a required field')
|
620
|
+
end
|
621
|
+
|
618
622
|
if(!input.match(/.css/))
|
619
623
|
source_path << File.dirname(input)
|
620
624
|
end
|
621
625
|
|
626
|
+
if(link_report)
|
627
|
+
CLEAN.add(link_report)
|
628
|
+
end
|
629
|
+
|
630
|
+
source_path.uniq!
|
631
|
+
|
622
632
|
CLEAN.add(output)
|
623
633
|
if(incremental)
|
624
634
|
CLEAN.add(FileList['**/**/*.cache'])
|
@@ -660,3 +670,4 @@ end
|
|
660
670
|
def mxmlc(args, &block)
|
661
671
|
Sprout::MXMLCTask.define_task(args, &block)
|
662
672
|
end
|
673
|
+
|
@@ -0,0 +1,44 @@
|
|
1
|
+
|
2
|
+
module Sprout
|
3
|
+
class MXMLCUnit < MXMLCHelper # :nodoc:
|
4
|
+
|
5
|
+
def initialize(args, &block)
|
6
|
+
super
|
7
|
+
t = define_outer_task
|
8
|
+
t.prerequisites << player_task_name
|
9
|
+
|
10
|
+
library :asunit3
|
11
|
+
|
12
|
+
mxmlc output do |t|
|
13
|
+
configure_mxmlc t
|
14
|
+
configure_mxmlc_application t
|
15
|
+
t.prerequisites << :asunit3
|
16
|
+
t.source_path << model.test_dir
|
17
|
+
|
18
|
+
if(model.test_width && model.test_height)
|
19
|
+
t.default_size = "#{model.test_width} #{model.test_height}"
|
20
|
+
end
|
21
|
+
|
22
|
+
yield t if block_given?
|
23
|
+
end
|
24
|
+
|
25
|
+
define_player
|
26
|
+
return output
|
27
|
+
end
|
28
|
+
|
29
|
+
def create_output
|
30
|
+
return "#{create_output_base}Runner.swf"
|
31
|
+
end
|
32
|
+
|
33
|
+
def create_input
|
34
|
+
input = super
|
35
|
+
input.gsub!(/#{input_extension}$/, "Runner#{input_extension}")
|
36
|
+
return input
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def unit(args, &block)
|
43
|
+
return Sprout::MXMLCUnit.new(args, &block)
|
44
|
+
end
|
data/rakefile.rb
CHANGED
@@ -63,8 +63,8 @@ spec = Gem::Specification.new do |s|
|
|
63
63
|
s.rdoc_options << '-i' << '.'
|
64
64
|
s.files = PKG_LIST.to_a
|
65
65
|
|
66
|
-
s.add_dependency('sprout', '>= 0.7.
|
67
|
-
s.add_dependency('sprout-flashplayer-bundle')
|
66
|
+
s.add_dependency('sprout', '>= 0.7.180')
|
67
|
+
s.add_dependency('sprout-flashplayer-bundle', '>= 9.124.0')
|
68
68
|
end
|
69
69
|
|
70
70
|
Rake::GemPackageTask.new(spec) do |p|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sprout-as3-bundle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pattern Park
|
@@ -9,7 +9,7 @@ autorequire: sprout/as3
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-05-
|
12
|
+
date: 2008-05-16 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
requirements:
|
20
20
|
- - ">="
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 0.7.
|
22
|
+
version: 0.7.180
|
23
23
|
version:
|
24
24
|
- !ruby/object:Gem::Dependency
|
25
25
|
name: sprout-flashplayer-bundle
|
@@ -28,7 +28,7 @@ dependencies:
|
|
28
28
|
requirements:
|
29
29
|
- - ">="
|
30
30
|
- !ruby/object:Gem::Version
|
31
|
-
version:
|
31
|
+
version: 9.124.0
|
32
32
|
version:
|
33
33
|
description: Code Generation and Rake Tasks for ActionScript 3.0 Development
|
34
34
|
email: projectsprouts@googlegroups.com
|
@@ -40,6 +40,7 @@ extra_rdoc_files:
|
|
40
40
|
- README
|
41
41
|
files:
|
42
42
|
- lib
|
43
|
+
- pkg
|
43
44
|
- rakefile.rb
|
44
45
|
- README
|
45
46
|
- samples
|
@@ -86,20 +87,26 @@ files:
|
|
86
87
|
- lib/sprout/generators/test/test_generator.rb
|
87
88
|
- lib/sprout/generators/test/USAGE
|
88
89
|
- lib/sprout/tasks
|
89
|
-
- lib/sprout/tasks/
|
90
|
+
- lib/sprout/tasks/adl_rdoc.rb
|
90
91
|
- lib/sprout/tasks/adl_task.rb
|
91
|
-
- lib/sprout/tasks/
|
92
|
-
- lib/sprout/tasks/
|
92
|
+
- lib/sprout/tasks/adt_cert_rdoc.rb
|
93
|
+
- lib/sprout/tasks/adt_rdoc.rb
|
93
94
|
- lib/sprout/tasks/adt_task.rb
|
94
|
-
- lib/sprout/tasks/
|
95
|
+
- lib/sprout/tasks/asdoc_rdoc.rb
|
95
96
|
- lib/sprout/tasks/asdoc_task.rb
|
96
|
-
- lib/sprout/tasks/
|
97
|
-
- lib/sprout/tasks/compc_doc.rb
|
97
|
+
- lib/sprout/tasks/compc_rdoc.rb
|
98
98
|
- lib/sprout/tasks/compc_task.rb
|
99
99
|
- lib/sprout/tasks/fcsh_task.rb
|
100
100
|
- lib/sprout/tasks/fdb_task.rb
|
101
|
-
- lib/sprout/tasks/
|
101
|
+
- lib/sprout/tasks/mxmlc_debug.rb
|
102
|
+
- lib/sprout/tasks/mxmlc_deploy.rb
|
103
|
+
- lib/sprout/tasks/mxmlc_document.rb
|
104
|
+
- lib/sprout/tasks/mxmlc_flex_builder.rb
|
105
|
+
- lib/sprout/tasks/mxmlc_helper.rb
|
106
|
+
- lib/sprout/tasks/mxmlc_rdoc.rb
|
107
|
+
- lib/sprout/tasks/mxmlc_stylesheet.rb
|
102
108
|
- lib/sprout/tasks/mxmlc_task.rb
|
109
|
+
- lib/sprout/tasks/mxmlc_unit.rb
|
103
110
|
has_rdoc: true
|
104
111
|
homepage: http://www.projectsprouts.org
|
105
112
|
post_install_message:
|
@@ -1,148 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
Copyright (c) 2007 Pattern Park
|
3
|
-
|
4
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
5
|
-
a copy of this software and associated documentation files (the
|
6
|
-
"Software"), to deal in the Software without restriction, including
|
7
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
8
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
9
|
-
permit persons to whom the Software is furnished to do so, subject to
|
10
|
-
the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be
|
13
|
-
included in all copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
16
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
17
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
18
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
19
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
20
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
21
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
22
|
-
=end
|
23
|
-
|
24
|
-
module Rake # :nodoc:
|
25
|
-
class Tasks # :nodoc:
|
26
|
-
|
27
|
-
# Override Rake::Task.actions so that we can
|
28
|
-
# pull them from our dependent tasks
|
29
|
-
def actions
|
30
|
-
@actions
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
end
|
35
|
-
|
36
|
-
module Sprout
|
37
|
-
class AsUnitError < StandardError # :nodoc:
|
38
|
-
end
|
39
|
-
|
40
|
-
# This task does not yet work!
|
41
|
-
# The AsUnitTask provides a shortcut to compiling a test harness
|
42
|
-
# directly from a related MXMLCTask. The first prerequisite
|
43
|
-
# that is an MXMLCTask or MTASCTask will be copied and modified
|
44
|
-
# to generate a test swf using ProjectModel.instance.test_dir
|
45
|
-
# and the AsUnit library gem.
|
46
|
-
#
|
47
|
-
# mxmlc 'bin/SomeProject.swf' => :corelib do |t|
|
48
|
-
# t.input = 'src/SomeProject.as'
|
49
|
-
# end
|
50
|
-
#
|
51
|
-
# asunit :test => 'bin/SomeProject.swf'
|
52
|
-
#
|
53
|
-
class AsUnitTask < Rake::FileTask # :nodoc:
|
54
|
-
attr_accessor :input
|
55
|
-
attr_accessor :output
|
56
|
-
attr_accessor :asunit_gem
|
57
|
-
attr_accessor :source_path
|
58
|
-
|
59
|
-
=begin
|
60
|
-
def initialize(name, app) # :nodoc:
|
61
|
-
super
|
62
|
-
@asunit_gem = :asunit3
|
63
|
-
@spawned = []
|
64
|
-
@source_path = []
|
65
|
-
end
|
66
|
-
|
67
|
-
def self.define_task(args, &block)
|
68
|
-
t = super
|
69
|
-
yield t if block_given?
|
70
|
-
t.define
|
71
|
-
return t
|
72
|
-
end
|
73
|
-
|
74
|
-
def define
|
75
|
-
puts ">> DEFINE CALLED with: #{prerequisites.size}"
|
76
|
-
library @asunit_gem
|
77
|
-
|
78
|
-
reqs = prerequisites.dup
|
79
|
-
req = nil
|
80
|
-
reqs.each_index do |index|
|
81
|
-
req = reqs[index]
|
82
|
-
puts "req: #{req}"
|
83
|
-
t = get_task_instance(req)
|
84
|
-
if(is_mxmlc?(t))
|
85
|
-
spawn_mxmlc_task(t)
|
86
|
-
reqs.slice!(index)
|
87
|
-
end
|
88
|
-
end
|
89
|
-
|
90
|
-
@spawned.each do |req|
|
91
|
-
@prerequisites << req
|
92
|
-
end
|
93
|
-
|
94
|
-
@spawned = []
|
95
|
-
end
|
96
|
-
|
97
|
-
def get_spawned_task_name
|
98
|
-
|
99
|
-
end
|
100
|
-
|
101
|
-
def spawn_mxmlc_task(task)
|
102
|
-
puts "SPAWNING MXMLC TASK"
|
103
|
-
cloned = task.dup
|
104
|
-
task.actions.each do |action|
|
105
|
-
cloned.actions << action
|
106
|
-
end
|
107
|
-
# cloned.name = 'bin/SomeProjectRunner.swf'
|
108
|
-
cloned.input = 'src/SomeProjectRunner.as'
|
109
|
-
cloned.output = 'bin/SomeProjectRunner.swf'
|
110
|
-
cloned.prerequisites << asunit_gem
|
111
|
-
cloned.define
|
112
|
-
|
113
|
-
source_path.each do |path|
|
114
|
-
cloned.source_path << path
|
115
|
-
end
|
116
|
-
|
117
|
-
@spawned << cloned
|
118
|
-
end
|
119
|
-
|
120
|
-
# Alias for source_path so that MTASCTasks can also use this feature
|
121
|
-
def class_path=(path)
|
122
|
-
@source_path = path
|
123
|
-
end
|
124
|
-
|
125
|
-
def class_path
|
126
|
-
return self.source_path
|
127
|
-
end
|
128
|
-
|
129
|
-
def is_mxmlc?(task)
|
130
|
-
task.is_a?(MXMLCTask)
|
131
|
-
end
|
132
|
-
|
133
|
-
def get_task_instance(name)
|
134
|
-
Rake::application[name]
|
135
|
-
end
|
136
|
-
|
137
|
-
def execute(*args)
|
138
|
-
puts ">> asunit task"
|
139
|
-
# FileUtils.touch(name)
|
140
|
-
end
|
141
|
-
=end
|
142
|
-
|
143
|
-
end
|
144
|
-
end
|
145
|
-
|
146
|
-
def asunit(args, &block)
|
147
|
-
Sprout::AsUnitTask.define_task(args, &block)
|
148
|
-
end
|