buildr-as3 0.1.17 → 0.1.18

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -6,23 +6,15 @@
6
6
 
7
7
  == 0.1.17
8
8
 
9
- * [FXIED]
10
- Actually no files were updated in version 0.1.16 because of a git hick-up,
11
- now the changes meant for 0.1.16 are applied in 0.1.17.
9
+ * [FXIED] Actually no files were updated in version 0.1.16 because of a git hick-up, now the changes meant for 0.1.16 are applied in 0.1.17.
12
10
 
13
11
  == 0.1.16
14
12
 
15
- * [FEATURE]
16
- API for Framworks and Toolkits integration has been refactored and updated.
13
+ * [FEATURE] API for Framworks and Toolkits integration has been refactored and updated.
17
14
 
18
- * [FIXED] Issue 15
19
- Zip file extraction is now handled with gnuwin32 unzip on Windows, and the equivalent
20
- on *nix platforms as a fallback for rubyzip.
21
- On Windows gnuwin32 unzip needs to be installed and added to the PATH variable.
15
+ * [FIXED] Issue 15: Zip file extraction is now handled with gnuwin32 unzip on Windows, and the equivalent on *nix platforms as a fallback for rubyzip. On Windows gnuwin32 unzip needs to be installed and added to the PATH variable.
22
16
 
23
- * [FIXED] Issue 16
24
- Binarymode was not set on target-file, which caused the downloaded archive to be corrupt.
25
- This is an issue of buildr and was reported.
17
+ * [FIXED] Issue 16: Binarymode was not set on target-file, which caused the downloaded archive to be corrupt. This is an issue of buildr and was reported.
26
18
 
27
19
  == 0.1.13
28
20
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.17
1
+ 0.1.18
data/buildr-as3.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{buildr-as3}
8
- s.version = "0.1.17"
8
+ s.version = "0.1.18"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Dominic Graefen"]
12
- s.date = %q{2011-02-07}
12
+ s.date = %q{2011-02-10}
13
13
  s.description = %q{Build like you code - now supporting ActionScript 3 & Flex}
14
14
  s.email = %q{dominic @nospam@ devboy.org}
15
15
  s.extra_rdoc_files = [
@@ -24,44 +24,113 @@ module Buildr
24
24
  module Alchemy
25
25
  class AlchemyToolkit
26
26
 
27
- attr_reader :home, :achacks, :gcc, :flex_sdk, :alchemy_setup, :bin
27
+ attr_reader :home, :achacks, :gcc, :flex_sdk, :alchemy_setup, :bin, :swfbridge
28
28
 
29
29
  def initialize(flex_sdk)
30
+ @version = "1.0-PR1"
31
+ @system = Buildr::Util.win_os? ? "win" : "unix"
32
+ @spec = "com.adobe.alchemy:toolkit:zip:#{@system}:#{@version}"
33
+ @flex_sdk = flex_sdk
34
+ @alchemy_zip = Buildr.artifact(@spec)
35
+ @alchemy_dir = File.join(File.dirname(@alchemy_zip.to_s), "alchemy-#{@system}-#{@version}", get_alchemy_toolkit_subfolder(@system) )
36
+ generate_paths @alchemy_dir
37
+ self
38
+ end
30
39
 
31
- fail("Alchemy support currently only on *nix based systems.") if Buildr::Util.win_os?
40
+ def invoke
41
+ @url ||= get_alchemy_toolkit_url(@system)
42
+
43
+ # if @url
44
+ # Buildr.artifact(@spec).from(Buildr.download(@url)).invoke unless File.exists? @alchemy_zip.to_s
45
+ # else
46
+ # Buildr.artifact(@spec).invoke unless File.exists? @alchemy_zip.to_s
47
+ # end
48
+
49
+ if Buildr::Util.win_os?
50
+ unless File.exists? @alchemy_zip.to_s
51
+ FileUtils.mkdir_p File.dirname(@alchemy_zip.to_s) unless File.directory? File.dirname(@alchemy_zip.to_s)
52
+ File.open @alchemy_zip.to_s, 'w' do |file|
53
+ file.binmode()
54
+ URI.read(@url, {:progress=>true}) { |chunk| file.write chunk }
55
+ end
56
+ end
57
+ else
58
+ Buildr.artifact(@spec).from(Buildr.download(@url)).invoke unless File.exists? @alchemy_zip.to_s
59
+ end
32
60
 
33
- @flex_sdk = flex_sdk
61
+ unless File.exists? @alchemy_dir
62
+ puts "Unzipping Alchemy, this might take a while."
63
+ unzip_dir = File.dirname @alchemy_dir
64
+ if Buildr::Util.win_os?
65
+ puts "Please make sure unzip is installed and in your PATH variable!"
66
+ unzip @alchemy_zip, unzip_dir
67
+ else
68
+ begin
69
+ Buildr.unzip(unzip_dir.to_s=>@alchemy_zip.to_s).target.invoke
70
+ rescue TypeError
71
+ puts "RubyZip extract failed, trying system unzip now."
72
+ unzip @alchemy_zip, unzip_dir
73
+ end
74
+ end
75
+ end
76
+ setup unless File.exists? @alchemy_setup
77
+ self
78
+ end
34
79
 
35
- toolkit_version = "1.0.0"
36
- toolkit_url = "http://download.macromedia.com/pub/labs/alchemy/alchemy_sdk_darwin_p1_121008.zip"
80
+ def from(url)
81
+ @url = url
82
+ self
83
+ end
37
84
 
38
- toolkit_zip = Buildr::artifact("com.adobe.alchemy:toolkit:zip:#{toolkit_version}").from(Buildr::download(toolkit_url))
39
- toolkit_zip.invoke unless File.exists? toolkit_zip.to_s
85
+ protected
40
86
 
41
- toolkit_dir = File.join(File.dirname(toolkit_zip.to_s), "toolkit-#{toolkit_version}")
87
+ def unzip(zip, destination)
88
+ project_dir = Dir.getwd
89
+ Dir.chdir File.dirname(zip.to_s)
90
+ system("unzip #{File.basename(zip.to_s).to_s} -d #{File.basename(destination).to_s}")
91
+ Dir.chdir project_dir
92
+ end
42
93
 
43
- unless File.exists? toolkit_dir
44
- puts "Unzipping Alchemy Toolkit, this may take a while."
45
- Buildr::unzip("#{toolkit_dir}"=>toolkit_zip.to_s).target.invoke
94
+ def setup
95
+ project_dir = Dir.getwd
96
+ ENV["PATH"] = "#{flex_sdk.bin}#{File::PATH_SEPARATOR}#{ENV["PATH"]}"
97
+ Dir.chdir @home
98
+ system("sh ./config")
99
+ if Buildr::Util.win_os?
100
+ Dir.chdir @bin
101
+ system("ln -sf llvm-stub llvm-stub.exe")
46
102
  end
103
+ Dir.chdir project_dir
104
+ end
47
105
 
48
- @home = "#{toolkit_dir}/alchemy-darwin-v0.5a"
106
+ def generate_paths(home_dir)
107
+ @home = home_dir
49
108
  @achacks = "#{@home}/achacks"
50
109
  @gcc = "#{@achacks}/gcc"
51
110
  @alchemy_setup = "#{@home}/alchemy-setup"
52
111
  @config = "#{@home}/config"
53
112
  @bin = "#{@home}/bin"
113
+ @swfbridge = Buildr::Util.win_os? ? "#{@bin}/swfbridge.exe" : "#{@bin}/swfbridge"
114
+ end
54
115
 
55
- # Run config script if alchemy-setup doesn't exist
56
- unless File.exists? @alchemy_setup
57
- project_dir = Dir.getwd
58
- ENV["PATH"] = "#{ENV["PATH"]}:#{flex_sdk.bin}"
59
- Dir.chdir @home
60
- system("sh ./config")
61
- Dir.chdir project_dir
116
+ def get_alchemy_toolkit_subfolder(system)
117
+ if system == "win"
118
+ folder = "alchemy-cygwin-v0.5a"
119
+ else
120
+ folder = "alchemy-darwin-v0.5a"
62
121
  end
122
+ folder
123
+ end
63
124
 
125
+ def get_alchemy_toolkit_url(system)
126
+ if system == "win"
127
+ url = "http://download.macromedia.com/pub/labs/alchemy/alchemy_sdk_cygwin_p1_121008.zip"
128
+ else
129
+ url = "http://download.macromedia.com/pub/labs/alchemy/alchemy_sdk_darwin_p1_121008.zip"
130
+ end
131
+ url
64
132
  end
133
+
65
134
  end
66
135
 
67
136
  module Compiler
@@ -81,7 +150,7 @@ module Buildr
81
150
  include Buildr::AS3::Compiler::CompilerUtils
82
151
 
83
152
  def compile(sources, target, dependencies)
84
- alchemy_tk = options[:alchemy]
153
+ alchemy_tk = options[:alchemy].invoke
85
154
  flex_sdk = alchemy_tk.flex_sdk
86
155
  output = Buildr::AS3::Compiler::CompilerUtils::get_output(project, target, :swc, options)
87
156
 
@@ -101,10 +170,11 @@ module Buildr
101
170
  unless Buildr.application.options.dryrun
102
171
  ENV["ALCHEMY_HOME"]= alchemy_tk.home
103
172
  ENV["ALCHEMY_VER"] = "0.4a"
104
- ENV["PATH"] = "#{alchemy_tk.bin}:#{ENV["PATH"]}"
173
+ ENV["PATH"] = "#{alchemy_tk.bin}#{File::PATH_SEPARATOR}#{ENV["PATH"]}"
105
174
  ENV["ASC"]="#{alchemy_tk.home}/bin/asc.jar"
106
- ENV["SWFBRIDGE"]="#{alchemy_tk.home}/bin/swfbridge"
107
- ENV["PATH"] = "#{alchemy_tk.achacks}:#{ENV["PATH"]}"
175
+ ENV["ADL"]=alchemy_tk.flex_sdk.adl
176
+ ENV["SWFBRIDGE"]=alchemy_tk.swfbridge
177
+ ENV["PATH"] = "#{alchemy_tk.achacks}#{File::PATH_SEPARATOR}#{ENV["PATH"]}"
108
178
  ENV["PATH"] = "#{ENV["PATH"]}:#{flex_sdk.bin}"
109
179
  project_dir = Dir.getwd
110
180
  Dir.chdir File.dirname options[:main]
@@ -100,7 +100,6 @@ module Buildr
100
100
  end
101
101
  end
102
102
 
103
-
104
103
  module Tasks
105
104
  include Extension
106
105
 
@@ -119,7 +118,7 @@ module Buildr
119
118
  output = Buildr::AS3::Compiler::CompilerUtils::get_output(project, compile.target, compile.packaging, compile.options)
120
119
  apparat_tk = compile.options[:apparat].invoke
121
120
  cmd_args = []
122
- cmd_args << "\"#{apparat_tk.tdsi}\""
121
+ cmd_args << "#{apparat_tk.tdsi}"
123
122
  cmd_args << "-i #{output}"
124
123
  cmd_args << "-o #{output}"
125
124
  reserved = []
@@ -128,15 +127,16 @@ module Buildr
128
127
  cmd_args << "-#{key} #{value}"
129
128
  end
130
129
  ENV["PATH"] = "#{apparat_tk.scala_home}/bin#{File::PATH_SEPARATOR}#{ENV["PATH"]}" if apparat_tk.scala_home && !ENV["PATH"].include?("#{apparat_tk.scala_home}/bin")
131
- puts "path:", ENV["PATH"]
132
- puts "tdsi:",cmd_args.join(" "), system(cmd_args.join " ")
130
+ # puts "path:", ENV["PATH"]
131
+ # puts "tdsi:",cmd_args.join(" "), system(cmd_args.join " ")
132
+ system(cmd_args.join " ")
133
133
  end
134
134
 
135
135
  def apparat_reducer(quality)
136
136
  output = Buildr::AS3::Compiler::CompilerUtils::get_output(project, compile.target, compile.packaging, compile.options)
137
137
  apparat_tk = compile.options[:apparat].invoke
138
138
  cmd_args = []
139
- cmd_args << "\"#{apparat_tk.reducer}\""
139
+ cmd_args << "#{apparat_tk.reducer}"
140
140
  cmd_args << "-i #{output}"
141
141
  cmd_args << "-o #{output}"
142
142
  cmd_args << "-q"
@@ -29,7 +29,7 @@ module Buildr
29
29
  class FlexSDK
30
30
 
31
31
  attr_reader :home, :mxmlc_jar, :compc_jar, :asdoc_jar, :fcsh_jar, :flex_config,
32
- :asdoc_templates, :default_options, :air_config, :bin, :adt_jar
32
+ :asdoc_templates, :default_options, :air_config, :bin, :adt_jar, :adl
33
33
 
34
34
  attr_writer :flex_config, :air_config, :asdoc_templates
35
35
 
@@ -100,9 +100,12 @@ module Buildr
100
100
  path = dependency.to_s
101
101
  end
102
102
  target = project.path_to(:lib, :main, :as3) + "/" + File.basename(path)
103
- unless target != path
104
- File.delete(target) if File.exists?(target)
105
- File.symlink path, target
103
+ if target != path
104
+ unless File.exists?(target) && !File.symlink?(target)
105
+ puts "Creating symlink: #{target}"
106
+ File.delete(target) if File.exists?(target)
107
+ File.symlink path, target
108
+ end
106
109
  end
107
110
  target
108
111
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: buildr-as3
3
3
  version: !ruby/object:Gem::Version
4
- hash: 57
4
+ hash: 63
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 17
10
- version: 0.1.17
9
+ - 18
10
+ version: 0.1.18
11
11
  platform: ruby
12
12
  authors:
13
13
  - Dominic Graefen
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-02-07 00:00:00 +01:00
18
+ date: 2011-02-10 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency