buildr-as3 0.2.32.pre → 0.2.33.pre
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +5 -2
- data/VERSION +1 -1
- data/buildr-as3.gemspec +17 -19
- data/lib/buildr/as3.rb +1 -1
- data/lib/buildr/as3/toolkits.rb +3 -1
- data/lib/buildr/as3/toolkits/airsdk.rb +62 -0
- data/lib/buildr/as3/toolkits/apparat.rb +12 -7
- data/lib/buildr/as3/toolkits/base.rb +19 -25
- data/lib/buildr/as3/toolkits/flexsdk.rb +95 -6
- data/lib/buildr/as3/toolkits/player.rb +68 -0
- metadata +104 -33
data/Gemfile
CHANGED
@@ -3,12 +3,15 @@ source "http://rubygems.org"
|
|
3
3
|
# Example:
|
4
4
|
# gem "activesupport", ">= 2.3.5"
|
5
5
|
|
6
|
+
gem "archive-tar-minitar", "~> 0.5.2"
|
7
|
+
gem "buildr", "~> 1.4.6"
|
8
|
+
|
6
9
|
# Add dependencies to develop your gem here.
|
7
10
|
# Include everything needed to run rake, tests, features, etc.
|
8
11
|
group :development do
|
9
12
|
gem "shoulda", ">= 0"
|
10
|
-
gem "bundler", "~> 1.
|
11
|
-
gem "jeweler", "~> 1.
|
13
|
+
gem "bundler", "~> 1.1.3"
|
14
|
+
gem "jeweler", "~> 1.8.3"
|
12
15
|
gem "buildr", "~> 1.4.6"
|
13
16
|
#gem "rcov", ">= 0"
|
14
17
|
gem "simplecov", :require => false
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.33.pre
|
data/buildr-as3.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "buildr-as3"
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.33.pre"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Dominic Graefen"]
|
12
|
-
s.date = "2012-
|
12
|
+
s.date = "2012-03-30"
|
13
13
|
s.description = "Build like you code - now supporting ActionScript 3 & Flex"
|
14
14
|
s.email = "dominic @nospam@ devboy.org"
|
15
15
|
s.executables = ["buildr-as3"]
|
@@ -48,10 +48,12 @@ Gem::Specification.new do |s|
|
|
48
48
|
"lib/buildr/as3/test/base.rb",
|
49
49
|
"lib/buildr/as3/test/flexunit4.rb",
|
50
50
|
"lib/buildr/as3/toolkits.rb",
|
51
|
+
"lib/buildr/as3/toolkits/airsdk.rb",
|
51
52
|
"lib/buildr/as3/toolkits/alchemy.rb",
|
52
53
|
"lib/buildr/as3/toolkits/apparat.rb",
|
53
54
|
"lib/buildr/as3/toolkits/base.rb",
|
54
55
|
"lib/buildr/as3/toolkits/flexsdk.rb",
|
56
|
+
"lib/buildr/as3/toolkits/player.rb",
|
55
57
|
"rake/jeweler.rb",
|
56
58
|
"rake/jeweler_prerelease_tasks.rb",
|
57
59
|
"rake/pre_release_gemspec.rb",
|
@@ -68,26 +70,18 @@ Gem::Specification.new do |s|
|
|
68
70
|
s.homepage = "http://github.com/devboy/buildr_as3"
|
69
71
|
s.licenses = ["MIT"]
|
70
72
|
s.require_paths = ["lib"]
|
71
|
-
s.rubygems_version = "1.8.
|
73
|
+
s.rubygems_version = "1.8.21"
|
72
74
|
s.summary = "Buildr extension to allow ActionScript3/Flex development."
|
73
|
-
s.test_files = [
|
74
|
-
"spec/as3/compiler/aircompc_spec.rb",
|
75
|
-
"spec/as3/compiler/airmxmlc_spec.rb",
|
76
|
-
"spec/as3/compiler/compc_spec.rb",
|
77
|
-
"spec/as3/compiler/mxmlc_spec.rb",
|
78
|
-
"spec/as3/compiler/task_spec.rb",
|
79
|
-
"spec/as3/project_spec.rb",
|
80
|
-
"spec/sandbox.rb",
|
81
|
-
"spec/spec_helper.rb"
|
82
|
-
]
|
83
75
|
|
84
76
|
if s.respond_to? :specification_version then
|
85
77
|
s.specification_version = 3
|
86
78
|
|
87
79
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
80
|
+
s.add_runtime_dependency(%q<archive-tar-minitar>, ["~> 0.5.2"])
|
81
|
+
s.add_runtime_dependency(%q<buildr>, ["~> 1.4.6"])
|
88
82
|
s.add_development_dependency(%q<shoulda>, [">= 0"])
|
89
|
-
s.add_development_dependency(%q<bundler>, ["~> 1.
|
90
|
-
s.add_development_dependency(%q<jeweler>, ["~> 1.
|
83
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.1.3"])
|
84
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.8.3"])
|
91
85
|
s.add_development_dependency(%q<buildr>, ["~> 1.4.6"])
|
92
86
|
s.add_development_dependency(%q<simplecov>, [">= 0"])
|
93
87
|
s.add_development_dependency(%q<simplecov-rcov>, [">= 0"])
|
@@ -95,9 +89,11 @@ Gem::Specification.new do |s|
|
|
95
89
|
s.add_development_dependency(%q<ci_reporter>, ["~> 1.6.5"])
|
96
90
|
s.add_runtime_dependency(%q<buildr>, [">= 1.4.6"])
|
97
91
|
else
|
92
|
+
s.add_dependency(%q<archive-tar-minitar>, ["~> 0.5.2"])
|
93
|
+
s.add_dependency(%q<buildr>, ["~> 1.4.6"])
|
98
94
|
s.add_dependency(%q<shoulda>, [">= 0"])
|
99
|
-
s.add_dependency(%q<bundler>, ["~> 1.
|
100
|
-
s.add_dependency(%q<jeweler>, ["~> 1.
|
95
|
+
s.add_dependency(%q<bundler>, ["~> 1.1.3"])
|
96
|
+
s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
|
101
97
|
s.add_dependency(%q<buildr>, ["~> 1.4.6"])
|
102
98
|
s.add_dependency(%q<simplecov>, [">= 0"])
|
103
99
|
s.add_dependency(%q<simplecov-rcov>, [">= 0"])
|
@@ -106,9 +102,11 @@ Gem::Specification.new do |s|
|
|
106
102
|
s.add_dependency(%q<buildr>, [">= 1.4.6"])
|
107
103
|
end
|
108
104
|
else
|
105
|
+
s.add_dependency(%q<archive-tar-minitar>, ["~> 0.5.2"])
|
106
|
+
s.add_dependency(%q<buildr>, ["~> 1.4.6"])
|
109
107
|
s.add_dependency(%q<shoulda>, [">= 0"])
|
110
|
-
s.add_dependency(%q<bundler>, ["~> 1.
|
111
|
-
s.add_dependency(%q<jeweler>, ["~> 1.
|
108
|
+
s.add_dependency(%q<bundler>, ["~> 1.1.3"])
|
109
|
+
s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
|
112
110
|
s.add_dependency(%q<buildr>, ["~> 1.4.6"])
|
113
111
|
s.add_dependency(%q<simplecov>, [">= 0"])
|
114
112
|
s.add_dependency(%q<simplecov-rcov>, [">= 0"])
|
data/lib/buildr/as3.rb
CHANGED
@@ -28,4 +28,4 @@ require "#{File.dirname(__FILE__)}/as3/packaging"
|
|
28
28
|
require "#{File.dirname(__FILE__)}/as3/toolkits"
|
29
29
|
require "#{File.dirname(__FILE__)}/as3/ide"
|
30
30
|
require "#{File.dirname(__FILE__)}/as3/doc"
|
31
|
-
require File.dirname(__FILE__)
|
31
|
+
require "#{File.dirname(__FILE__)}/as3/test"
|
data/lib/buildr/as3/toolkits.rb
CHANGED
@@ -21,8 +21,10 @@
|
|
21
21
|
#
|
22
22
|
|
23
23
|
require "#{File.dirname(__FILE__)}/toolkits/base"
|
24
|
-
require "#{File.dirname(__FILE__)}/toolkits/flexsdk"
|
25
24
|
require "#{File.dirname(__FILE__)}/toolkits/apparat"
|
26
25
|
require "#{File.dirname(__FILE__)}/toolkits/alchemy"
|
26
|
+
require "#{File.dirname(__FILE__)}/toolkits/flexsdk"
|
27
|
+
require "#{File.dirname(__FILE__)}/toolkits/airsdk"
|
28
|
+
require "#{File.dirname(__FILE__)}/toolkits/player"
|
27
29
|
|
28
30
|
include Buildr::AS3::Toolkits
|
@@ -0,0 +1,62 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (C) 2012 by Justin Walsh / http://theJustinWalsh.com
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
# of this software and associated documentation files (the "Software"), to deal
|
6
|
+
# in the Software without restriction, including without limitation the rights
|
7
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
# copies of the Software, and to permit persons to whom the Software is
|
9
|
+
# furnished to do so, subject to the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be included in
|
12
|
+
# all copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
20
|
+
# THE SOFTWARE.
|
21
|
+
#
|
22
|
+
|
23
|
+
module Buildr
|
24
|
+
module AS3
|
25
|
+
module Toolkits
|
26
|
+
class AirSDK < Buildr::AS3::Toolkits::ZipToolkiteBase
|
27
|
+
|
28
|
+
attr_reader :home, :version
|
29
|
+
|
30
|
+
def initialize(version)
|
31
|
+
@version = version
|
32
|
+
@spec = "com.adobe.air:sdk:zip:#{version.gsub(/ /, '-')}"
|
33
|
+
@zip = Buildr.artifact(@spec)
|
34
|
+
@home = @zip_destination = File.join(File.dirname(@zip.to_s), "sdk-#{version.gsub(/ /, '-')}")
|
35
|
+
self
|
36
|
+
end
|
37
|
+
|
38
|
+
def invoke #:nodoc:
|
39
|
+
@url ||= generate_url_from_version @version
|
40
|
+
super
|
41
|
+
self
|
42
|
+
end
|
43
|
+
|
44
|
+
def from(url)
|
45
|
+
@url = url
|
46
|
+
self
|
47
|
+
end
|
48
|
+
private
|
49
|
+
|
50
|
+
def generate_url_from_version(version)
|
51
|
+
version_major = version.split(".")[0]
|
52
|
+
version_minor = version.split(".")[1]
|
53
|
+
version_id = "#{version_major}.#{version_minor}"
|
54
|
+
os = Buildr::Util.win_os? ? "win" : "mac"
|
55
|
+
ext = Buildr::Util.win_os? ? "zip" : "tbz2"
|
56
|
+
|
57
|
+
"http://airdownload.adobe.com/air/#{os}/download/#{version_id}/AdobeAIRSDK.#{ext}"
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
@@ -33,7 +33,7 @@ module Buildr
|
|
33
33
|
@version = version
|
34
34
|
@spec = "com.googlecode:apparat-bin:zip:#{@version}"
|
35
35
|
@zip = Buildr.artifact(@spec)
|
36
|
-
@zip_destination = File.join(File.dirname(@zip.to_s),
|
36
|
+
@zip_destination = File.join(File.dirname(@zip.to_s),"apparat")
|
37
37
|
generate_paths @zip_destination, @version
|
38
38
|
end
|
39
39
|
|
@@ -65,7 +65,7 @@ module Buildr
|
|
65
65
|
end
|
66
66
|
|
67
67
|
def generate_paths(home_dir, version)
|
68
|
-
@home = home_dir
|
68
|
+
@home = "#{home_dir}/apparat-#{version}"
|
69
69
|
bat_ext = Buildr::Util.win_os? ? "" : ""
|
70
70
|
@apparat = "#{@home}/apparat#{bat_ext}"
|
71
71
|
@asmifier = "#{@home}/asmifier#{bat_ext}"
|
@@ -91,8 +91,8 @@ module Buildr
|
|
91
91
|
compile.options[:apparat].invoke
|
92
92
|
cmd_args = []
|
93
93
|
cmd_args << "apparat.tools.tdsi.TurboDieselSportInjection"
|
94
|
-
cmd_args << "-i #{output}"
|
95
|
-
cmd_args << "-o #{output}"
|
94
|
+
cmd_args << "-i" << "#{output}"
|
95
|
+
cmd_args << "-o" << "#{output}"
|
96
96
|
reserved = []
|
97
97
|
options.to_hash.reject { |key, value| reserved.include?(key) }.
|
98
98
|
each do |key, value|
|
@@ -106,8 +106,8 @@ module Buildr
|
|
106
106
|
compile.options[:apparat].invoke
|
107
107
|
cmd_args = []
|
108
108
|
cmd_args << "apparat.tools.reducer.Reducer"
|
109
|
-
cmd_args << "-i #{output}"
|
110
|
-
cmd_args << "-o #{output}"
|
109
|
+
cmd_args << "-i" << "#{output}"
|
110
|
+
cmd_args << "-o" << "#{output}"
|
111
111
|
reserved = []
|
112
112
|
options.to_hash.reject { |key, value| reserved.include?(key) }.
|
113
113
|
each do |key, value|
|
@@ -121,7 +121,12 @@ module Buildr
|
|
121
121
|
def call_system(args)
|
122
122
|
unless Buildr.application.options.dryrun
|
123
123
|
cp = compile.options[:apparat].scala_dependencies + compile.options[:apparat].apparat_dependencies
|
124
|
-
|
124
|
+
sep = Buildr::Util.win_os? ? ";" : ":"
|
125
|
+
cmd_args = ['-classpath', cp.join(sep)] + args
|
126
|
+
unless Buildr.application.options.dryrun
|
127
|
+
trace(cmd_args.join(' '))
|
128
|
+
Java::Commands.java cmd_args
|
129
|
+
end
|
125
130
|
end
|
126
131
|
end
|
127
132
|
|
@@ -20,6 +20,8 @@
|
|
20
20
|
# THE SOFTWARE.
|
21
21
|
#
|
22
22
|
|
23
|
+
include Archive::Tar
|
24
|
+
|
23
25
|
module Buildr
|
24
26
|
module AS3
|
25
27
|
module Toolkits
|
@@ -32,8 +34,15 @@ module Buildr
|
|
32
34
|
else
|
33
35
|
Buildr::download(Buildr::artifact(@spec) => @url).invoke
|
34
36
|
end unless File.exists? @zip.to_s
|
35
|
-
|
36
|
-
|
37
|
+
begin
|
38
|
+
unarchive(@zip,@zip_destination).invoke
|
39
|
+
rescue Exception => e
|
40
|
+
if Buildr::Util.win_os? and e.message.include? "symlink() function is unimplemented"
|
41
|
+
warn "Disregarding symlink() issue on Windows"
|
42
|
+
else
|
43
|
+
raise e
|
44
|
+
end
|
45
|
+
end
|
37
46
|
|
38
47
|
self
|
39
48
|
end
|
@@ -42,9 +51,9 @@ module Buildr
|
|
42
51
|
# from(url) => self
|
43
52
|
#
|
44
53
|
# * You can pass a url where the ToolkitArtifact should be downloaded from as a string:
|
45
|
-
#
|
54
|
+
# from("http://domain.tld/toolkit.zip")
|
46
55
|
# * You can pass :maven as a parameter to download it from a maven repository:
|
47
|
-
#
|
56
|
+
# from(:maven)
|
48
57
|
# * If you don't call this function at all, buildr-as3 will try and resolve a url on automatically
|
49
58
|
def from(url)
|
50
59
|
@url = url
|
@@ -53,28 +62,13 @@ module Buildr
|
|
53
62
|
|
54
63
|
protected
|
55
64
|
|
56
|
-
def
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
Dir.chdir project_dir
|
61
|
-
end
|
62
|
-
|
63
|
-
def unzip_toolkit(zip,destination)
|
64
|
-
unless File.exists? destination
|
65
|
-
puts "Unzipping Archive, this might take a while."
|
66
|
-
if Buildr::Util.win_os?
|
67
|
-
puts "Please make sure unzip is installed and in your PATH variable!"
|
68
|
-
system_unzip_toolkit zip, destination
|
69
|
-
else
|
70
|
-
begin
|
71
|
-
# Buildr.unzip(destination.to_s=>zip.to_s).target.invoke
|
72
|
-
# rescue TypeError
|
73
|
-
# puts "RubyZip extract failed, trying system unzip now."
|
74
|
-
puts "Please make sure unzip is installed and in your PATH variable!"
|
75
|
-
system_unzip_toolkit zip, destination
|
76
|
-
end
|
65
|
+
def unarchive(archive,destination)
|
66
|
+
if @url.to_s =~ /\.tar\.bz2$/ || @url.to_s =~ /\.tbz2$/
|
67
|
+
file destination => archive do
|
68
|
+
Minitar.unpack(archive, destination)
|
77
69
|
end
|
70
|
+
else
|
71
|
+
Buildr.unzip( destination => archive ).target
|
78
72
|
end
|
79
73
|
end
|
80
74
|
|
@@ -20,29 +20,45 @@
|
|
20
20
|
# THE SOFTWARE.
|
21
21
|
#
|
22
22
|
|
23
|
+
require "fileutils"
|
24
|
+
require "rexml/document"
|
25
|
+
include REXML
|
26
|
+
|
23
27
|
module Buildr
|
24
28
|
module AS3
|
25
29
|
module Toolkits
|
26
30
|
class FlexSDK < Buildr::AS3::Toolkits::ZipToolkiteBase
|
27
31
|
|
32
|
+
SDK_OPTIONS = [:player, :airsdk]
|
33
|
+
|
28
34
|
attr_reader :home, :mxmlc_jar, :compc_jar, :asdoc_jar, :fcsh_jar, :flex_config,
|
29
|
-
:asdoc_templates, :default_options, :air_config, :bin, :adt_jar, :adl
|
35
|
+
:asdoc_templates, :default_options, :air_config, :airmobile_config, :bin, :adt_jar, :adl
|
30
36
|
|
31
37
|
attr_writer :flex_config, :air_config, :asdoc_templates
|
32
38
|
|
33
|
-
def initialize(version)
|
39
|
+
def initialize(version, options={})
|
34
40
|
@version = version
|
35
41
|
@default_options = []
|
36
42
|
@spec = "com.adobe.flex:sdk:zip:#{@version}"
|
37
43
|
@zip = Buildr.artifact(@spec)
|
38
44
|
@zip_destination = File.join(File.dirname(@zip.to_s), "sdk-#{@version}")
|
45
|
+
|
46
|
+
@player = options[:player] if options[:player].instance_of?(Player)
|
47
|
+
@airsdk = options[:airsdk] if options[:airsdk].instance_of?(AirSDK)
|
48
|
+
|
39
49
|
generate_paths @zip_destination
|
40
50
|
self
|
41
51
|
end
|
42
52
|
|
43
53
|
def invoke #:nodoc:
|
54
|
+
@player.invoke unless @player.nil?
|
55
|
+
@airsdk.invoke unless @airsdk.nil?
|
44
56
|
@url ||= generate_url_from_version @version
|
45
57
|
super
|
58
|
+
|
59
|
+
# Configuration files must be generated after the SDKs are installed
|
60
|
+
generate_configs
|
61
|
+
|
46
62
|
self
|
47
63
|
end
|
48
64
|
|
@@ -102,15 +118,88 @@ module Buildr
|
|
102
118
|
@mxmlc_jar = "#{@home}/lib/mxmlc.jar"
|
103
119
|
@compc_jar = "#{@home}/lib/compc.jar"
|
104
120
|
@asdoc_jar = "#{@home}/lib/asdoc.jar"
|
105
|
-
@adt_jar = "#{@home}/lib/adt.jar"
|
106
|
-
@adl = Buildr::Util.win_os? ? "#{@home}/bin/adl.exe" : "#{@home}/bin/adl"
|
107
121
|
@asdoc_templates = "#{@home}/asdoc/templates"
|
108
122
|
@fcsh_jar = "#{@home}/lib/fcsh.jar"
|
109
|
-
@flex_config = "#{@home}/frameworks/flex-config.xml"
|
110
|
-
@air_config = "#{@home}/frameworks/air-config.xml"
|
111
123
|
@bin = "#{@home}/bin"
|
124
|
+
|
125
|
+
air_home = @airsdk ? @airsdk.home : @home
|
126
|
+
@adt_jar = "#{air_home}/lib/adt.jar"
|
127
|
+
@adl = Buildr::Util.win_os? ? "#{air_home}/bin/adl.exe" : "#{air_home}/bin/adl"
|
112
128
|
true
|
113
129
|
end
|
130
|
+
|
131
|
+
def generate_configs
|
132
|
+
config_version = @version
|
133
|
+
config_version += ".#{@player.version}" if @player
|
134
|
+
config_version += ".#{@airsdk.version}" if @airsdk
|
135
|
+
|
136
|
+
if @player || @airsdk
|
137
|
+
# Generate config files
|
138
|
+
# TODO: Pretty sure these files are being generated everytime and that the artificate syntax is incorrect
|
139
|
+
# Additionally, I tried to use the .content method of the artifact, but it generated errors
|
140
|
+
|
141
|
+
flex_config = Buildr.artifact("com.adobe.flex:config:xml:flex:#{@config_version}")
|
142
|
+
configure("#{@home}/frameworks/flex-config.xml", flex_config)
|
143
|
+
@flex_config = flex_config.to_s
|
144
|
+
|
145
|
+
air_config = Buildr.artifact("com.adobe.flex:config:xml:air:#{@config_version}")
|
146
|
+
configure("#{@home}/frameworks/air-config.xml", air_config)
|
147
|
+
@air_config = air_config.to_s
|
148
|
+
|
149
|
+
airmobile_config = Buildr.artifact("com.adobe.flex:config:xml:airmobile:#{@config_version}")
|
150
|
+
configure("#{@home}/frameworks/airmobile-config.xml", airmobile_config)
|
151
|
+
@airmobile_config = airmobile_config.to_s
|
152
|
+
else
|
153
|
+
@flex_config = "#{@home}/frameworks/flex-config.xml"
|
154
|
+
@air_config = "#{@home}/frameworks/air-config.xml"
|
155
|
+
@airmobile_config = "#{@home}/frameworks/airmobile-config.xml"
|
156
|
+
end
|
157
|
+
end
|
158
|
+
|
159
|
+
def configure(template, artifact)
|
160
|
+
xml = Document.new(File.open(template))
|
161
|
+
|
162
|
+
# Expand theme into a full path
|
163
|
+
theme = xml.elements['/flex-config/compiler/theme/filename']
|
164
|
+
theme.text = "#{@home}/frameworks/#{theme.text}" if theme
|
165
|
+
|
166
|
+
# Expand RSLs into full path
|
167
|
+
xml.each_element('/flex-config/runtime-shared-library-path/path-element') { |p|
|
168
|
+
p.text = "#{@home}/frameworks/#{p.text}"
|
169
|
+
}
|
170
|
+
|
171
|
+
# Expand frameworks into full path
|
172
|
+
xml.each_element('/flex-config/compiler/namespaces/namespace/manifest') { |p|
|
173
|
+
p.text = "#{@home}/frameworks/#{p.text}"
|
174
|
+
}
|
175
|
+
|
176
|
+
if @player
|
177
|
+
# Overwrite the playrglobal.swc and update the default version and target-player
|
178
|
+
xml.elements['/flex-config/swf-version'].text = @player.swf_version unless @player.swf_version.nil?
|
179
|
+
xml.elements['/flex-config/target-player'].text = @player.version
|
180
|
+
xml.elements['/flex-config/compiler/external-library-path/path-element'].text = @player.swc
|
181
|
+
end
|
182
|
+
|
183
|
+
# Expand the library paths and determine if this config file is an air config file
|
184
|
+
is_air_config = false
|
185
|
+
air_home = @airsdk ? @airsdk.home : @home
|
186
|
+
xml.each_element('/flex-config/compiler/library-path/path-element') { |p|
|
187
|
+
if p.text == 'libs/air'
|
188
|
+
is_air_config = true
|
189
|
+
p.text = "#{air_home}/frameworks/#{p.text}"
|
190
|
+
else
|
191
|
+
p.text = "#{@home}/frameworks/#{p.text}"
|
192
|
+
end
|
193
|
+
}
|
194
|
+
|
195
|
+
# Overwrite the playerglobal.swc w/ airglobal.swc if this is an adobe air config file
|
196
|
+
xml.elements['/flex-config/compiler/external-library-path/path-element'].text = "#{air_home}/frameworks/libs/air/airglobal.swc" if is_air_config
|
197
|
+
|
198
|
+
# Write out the file
|
199
|
+
# TODO: This would not be needed if I could figure how to use Artifict::content
|
200
|
+
FileUtils.mkdir_p File.dirname(artifact.to_s)
|
201
|
+
File.open(artifact.to_s, 'w') {|f| f.write(xml) }
|
202
|
+
end
|
114
203
|
end
|
115
204
|
end
|
116
205
|
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (C) 2012 by Justin Walsh / http://theJustinWalsh.com
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
# of this software and associated documentation files (the "Software"), to deal
|
6
|
+
# in the Software without restriction, including without limitation the rights
|
7
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
# copies of the Software, and to permit persons to whom the Software is
|
9
|
+
# furnished to do so, subject to the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be included in
|
12
|
+
# all copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
20
|
+
# THE SOFTWARE.
|
21
|
+
#
|
22
|
+
|
23
|
+
module Buildr
|
24
|
+
module AS3
|
25
|
+
module Toolkits
|
26
|
+
class Player
|
27
|
+
|
28
|
+
attr_reader :home, :version, :swf_version, :swc
|
29
|
+
|
30
|
+
def initialize(version, swf_version=nil)
|
31
|
+
@version = version
|
32
|
+
if v = /^[0-9.]+/.match(@version) then @version = v[0] end
|
33
|
+
@swf_version = swf_version
|
34
|
+
@spec = "com.adobe.flex:player:swc:#{version.gsub(/ /, '-')}"
|
35
|
+
@playerglobal = Buildr.artifact(@spec)
|
36
|
+
@home = File.dirname(@playerglobal.to_s)
|
37
|
+
@swc = @playerglobal.to_s
|
38
|
+
self
|
39
|
+
end
|
40
|
+
|
41
|
+
def invoke #:nodoc:
|
42
|
+
@url ||= generate_url_from_version @version
|
43
|
+
|
44
|
+
Buildr::download(Buildr::artifact(@spec) => @url).invoke
|
45
|
+
return unless File.exists? @playerglobal.to_s
|
46
|
+
|
47
|
+
self
|
48
|
+
end
|
49
|
+
|
50
|
+
def from(url)
|
51
|
+
@url = url
|
52
|
+
self
|
53
|
+
end
|
54
|
+
|
55
|
+
private
|
56
|
+
|
57
|
+
def generate_url_from_version(version)
|
58
|
+
version_major = version.split(".")[0]
|
59
|
+
version_minor = version.split(".")[1]
|
60
|
+
version_minor = 0 # Adobe doesn't seem to store the player global properly
|
61
|
+
version_id = "#{version_major}_#{version_minor}"
|
62
|
+
|
63
|
+
"http://fpdownload.macromedia.com/pub/flashplayer/updaters/#{version_major}/playerglobal#{version_id}.swc"
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: buildr-as3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.33.pre
|
5
5
|
prerelease: 7
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,43 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-03-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: archive-tar-minitar
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 0.5.2
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 0.5.2
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: buildr
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ~>
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: 1.4.6
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 1.4.6
|
14
46
|
- !ruby/object:Gem::Dependency
|
15
47
|
name: shoulda
|
16
|
-
requirement:
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
17
49
|
none: false
|
18
50
|
requirements:
|
19
51
|
- - ! '>='
|
@@ -21,32 +53,47 @@ dependencies:
|
|
21
53
|
version: '0'
|
22
54
|
type: :development
|
23
55
|
prerelease: false
|
24
|
-
version_requirements:
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
25
62
|
- !ruby/object:Gem::Dependency
|
26
63
|
name: bundler
|
27
|
-
requirement:
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
28
65
|
none: false
|
29
66
|
requirements:
|
30
67
|
- - ~>
|
31
68
|
- !ruby/object:Gem::Version
|
32
|
-
version: 1.
|
69
|
+
version: 1.1.3
|
33
70
|
type: :development
|
34
71
|
prerelease: false
|
35
|
-
version_requirements:
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ~>
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 1.1.3
|
36
78
|
- !ruby/object:Gem::Dependency
|
37
79
|
name: jeweler
|
38
|
-
requirement:
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
39
81
|
none: false
|
40
82
|
requirements:
|
41
83
|
- - ~>
|
42
84
|
- !ruby/object:Gem::Version
|
43
|
-
version: 1.
|
85
|
+
version: 1.8.3
|
44
86
|
type: :development
|
45
87
|
prerelease: false
|
46
|
-
version_requirements:
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ~>
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: 1.8.3
|
47
94
|
- !ruby/object:Gem::Dependency
|
48
95
|
name: buildr
|
49
|
-
requirement:
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
50
97
|
none: false
|
51
98
|
requirements:
|
52
99
|
- - ~>
|
@@ -54,10 +101,15 @@ dependencies:
|
|
54
101
|
version: 1.4.6
|
55
102
|
type: :development
|
56
103
|
prerelease: false
|
57
|
-
version_requirements:
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ~>
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: 1.4.6
|
58
110
|
- !ruby/object:Gem::Dependency
|
59
111
|
name: simplecov
|
60
|
-
requirement:
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
61
113
|
none: false
|
62
114
|
requirements:
|
63
115
|
- - ! '>='
|
@@ -65,10 +117,15 @@ dependencies:
|
|
65
117
|
version: '0'
|
66
118
|
type: :development
|
67
119
|
prerelease: false
|
68
|
-
version_requirements:
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - ! '>='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
69
126
|
- !ruby/object:Gem::Dependency
|
70
127
|
name: simplecov-rcov
|
71
|
-
requirement:
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
72
129
|
none: false
|
73
130
|
requirements:
|
74
131
|
- - ! '>='
|
@@ -76,10 +133,15 @@ dependencies:
|
|
76
133
|
version: '0'
|
77
134
|
type: :development
|
78
135
|
prerelease: false
|
79
|
-
version_requirements:
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
138
|
+
requirements:
|
139
|
+
- - ! '>='
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: '0'
|
80
142
|
- !ruby/object:Gem::Dependency
|
81
143
|
name: rspec
|
82
|
-
requirement:
|
144
|
+
requirement: !ruby/object:Gem::Requirement
|
83
145
|
none: false
|
84
146
|
requirements:
|
85
147
|
- - ~>
|
@@ -87,10 +149,15 @@ dependencies:
|
|
87
149
|
version: 2.1.0
|
88
150
|
type: :development
|
89
151
|
prerelease: false
|
90
|
-
version_requirements:
|
152
|
+
version_requirements: !ruby/object:Gem::Requirement
|
153
|
+
none: false
|
154
|
+
requirements:
|
155
|
+
- - ~>
|
156
|
+
- !ruby/object:Gem::Version
|
157
|
+
version: 2.1.0
|
91
158
|
- !ruby/object:Gem::Dependency
|
92
159
|
name: ci_reporter
|
93
|
-
requirement:
|
160
|
+
requirement: !ruby/object:Gem::Requirement
|
94
161
|
none: false
|
95
162
|
requirements:
|
96
163
|
- - ~>
|
@@ -98,10 +165,15 @@ dependencies:
|
|
98
165
|
version: 1.6.5
|
99
166
|
type: :development
|
100
167
|
prerelease: false
|
101
|
-
version_requirements:
|
168
|
+
version_requirements: !ruby/object:Gem::Requirement
|
169
|
+
none: false
|
170
|
+
requirements:
|
171
|
+
- - ~>
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: 1.6.5
|
102
174
|
- !ruby/object:Gem::Dependency
|
103
175
|
name: buildr
|
104
|
-
requirement:
|
176
|
+
requirement: !ruby/object:Gem::Requirement
|
105
177
|
none: false
|
106
178
|
requirements:
|
107
179
|
- - ! '>='
|
@@ -109,7 +181,12 @@ dependencies:
|
|
109
181
|
version: 1.4.6
|
110
182
|
type: :runtime
|
111
183
|
prerelease: false
|
112
|
-
version_requirements:
|
184
|
+
version_requirements: !ruby/object:Gem::Requirement
|
185
|
+
none: false
|
186
|
+
requirements:
|
187
|
+
- - ! '>='
|
188
|
+
- !ruby/object:Gem::Version
|
189
|
+
version: 1.4.6
|
113
190
|
description: Build like you code - now supporting ActionScript 3 & Flex
|
114
191
|
email: dominic @nospam@ devboy.org
|
115
192
|
executables:
|
@@ -149,10 +226,12 @@ files:
|
|
149
226
|
- lib/buildr/as3/test/base.rb
|
150
227
|
- lib/buildr/as3/test/flexunit4.rb
|
151
228
|
- lib/buildr/as3/toolkits.rb
|
229
|
+
- lib/buildr/as3/toolkits/airsdk.rb
|
152
230
|
- lib/buildr/as3/toolkits/alchemy.rb
|
153
231
|
- lib/buildr/as3/toolkits/apparat.rb
|
154
232
|
- lib/buildr/as3/toolkits/base.rb
|
155
233
|
- lib/buildr/as3/toolkits/flexsdk.rb
|
234
|
+
- lib/buildr/as3/toolkits/player.rb
|
156
235
|
- rake/jeweler.rb
|
157
236
|
- rake/jeweler_prerelease_tasks.rb
|
158
237
|
- rake/pre_release_gemspec.rb
|
@@ -180,7 +259,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
180
259
|
version: '0'
|
181
260
|
segments:
|
182
261
|
- 0
|
183
|
-
hash:
|
262
|
+
hash: 1242639871802554092
|
184
263
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
185
264
|
none: false
|
186
265
|
requirements:
|
@@ -189,16 +268,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
189
268
|
version: 1.3.1
|
190
269
|
requirements: []
|
191
270
|
rubyforge_project:
|
192
|
-
rubygems_version: 1.8.
|
271
|
+
rubygems_version: 1.8.21
|
193
272
|
signing_key:
|
194
273
|
specification_version: 3
|
195
274
|
summary: Buildr extension to allow ActionScript3/Flex development.
|
196
|
-
test_files:
|
197
|
-
- spec/as3/compiler/aircompc_spec.rb
|
198
|
-
- spec/as3/compiler/airmxmlc_spec.rb
|
199
|
-
- spec/as3/compiler/compc_spec.rb
|
200
|
-
- spec/as3/compiler/mxmlc_spec.rb
|
201
|
-
- spec/as3/compiler/task_spec.rb
|
202
|
-
- spec/as3/project_spec.rb
|
203
|
-
- spec/sandbox.rb
|
204
|
-
- spec/spec_helper.rb
|
275
|
+
test_files: []
|