buildr-as3 0.1.20 → 0.1.28

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -14,6 +14,20 @@
14
14
 
15
15
  = Changelog
16
16
 
17
+ == 0.1.28
18
+
19
+ * [CLOSED] Issue 10: Added packaging task for unsigned AIR files *.airi
20
+ * [CLOSED] Issue 19: Added conditional compilation arguments (CONFIG::debug & CONFIG::environment) which reflect the buildr settings.
21
+ * [CLOSED] Issue 4: Alchemy will be supported on demand
22
+ * [CLOSED] Issue 9: Alchemy will be supported on demand
23
+ * [FIXED] Issue 17: Apparat tasks work on windows now
24
+ * [FIXED] Issue 24: New asdoc task has been added
25
+ * [FIXED] Issue 18: RDoc has been added to most modules
26
+ * [FIXED] Issue 20: Apparat task failed message has been added
27
+ * [FIXED] Issue 3: Trace info has been added
28
+ * [FIXED] Issue 23: Download functions for artifacts have been updated to work across platforms
29
+ * [FIXED] Issue 1: Compiler module has been rewritten from scratch
30
+
17
31
  == 0.1.20
18
32
 
19
33
  * [FIXED] directories of dependencies are now added as source folders in all compilers
data/Rakefile CHANGED
@@ -18,7 +18,7 @@ Jeweler::Tasks.new do |gem|
18
18
  gem.description = "Build like you code - now supporting ActionScript 3 & Flex"
19
19
  gem.email = "dominic @nospam@ devboy.org"
20
20
  gem.authors = ["Dominic Graefen"]
21
- gem.add_runtime_dependency("buildr",">=1.4.4")
21
+ gem.add_runtime_dependency("buildr",">=1.4.5")
22
22
  end
23
23
  Jeweler::RubygemsDotOrgTasks.new
24
24
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.20
1
+ 0.1.28
data/bin/buildr-as3 ADDED
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # Copyright (C) 2011 by Dominic Graefen / http://devboy.org
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in
13
+ # all copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ # THE SOFTWARE.
22
+ #
23
+
24
+ require 'rubygems'
25
+ require 'buildr'
26
+ require 'buildr/as3'
27
+ Buildr.application.run
data/buildr-as3.gemspec CHANGED
@@ -5,13 +5,15 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{buildr-as3}
8
- s.version = "0.1.20"
8
+ s.version = "0.1.28"
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-23}
12
+ s.date = %q{2011-04-15}
13
+ s.default_executable = %q{buildr-as3}
13
14
  s.description = %q{Build like you code - now supporting ActionScript 3 & Flex}
14
15
  s.email = %q{dominic @nospam@ devboy.org}
16
+ s.executables = ["buildr-as3"]
15
17
  s.extra_rdoc_files = [
16
18
  "LICENSE.txt",
17
19
  "README.rdoc"
@@ -23,23 +25,40 @@ Gem::Specification.new do |s|
23
25
  "README.rdoc",
24
26
  "Rakefile",
25
27
  "VERSION",
28
+ "bin/buildr-as3",
26
29
  "buildr-as3.gemspec",
27
30
  "lib/buildr/as3.rb",
28
- "lib/buildr/as3/alchemy.rb",
29
- "lib/buildr/as3/apparat.rb",
30
31
  "lib/buildr/as3/compiler.rb",
32
+ "lib/buildr/as3/compiler/aircompc.rb",
33
+ "lib/buildr/as3/compiler/airmxmlc.rb",
34
+ "lib/buildr/as3/compiler/base.rb",
35
+ "lib/buildr/as3/compiler/compc.rb",
36
+ "lib/buildr/as3/compiler/mxmlc.rb",
31
37
  "lib/buildr/as3/doc.rb",
32
- "lib/buildr/as3/flexsdk.rb",
38
+ "lib/buildr/as3/doc/asdoc.rb",
39
+ "lib/buildr/as3/ide.rb",
33
40
  "lib/buildr/as3/ide/fdt4.rb",
34
41
  "lib/buildr/as3/packaging.rb",
35
- "lib/buildr/as3/tests.rb",
42
+ "lib/buildr/as3/packaging/air.rb",
43
+ "lib/buildr/as3/packaging/airi.rb",
44
+ "lib/buildr/as3/packaging/swc.rb",
45
+ "lib/buildr/as3/packaging/swf.rb",
46
+ "lib/buildr/as3/project.rb",
47
+ "lib/buildr/as3/test.rb",
48
+ "lib/buildr/as3/test/base.rb",
49
+ "lib/buildr/as3/test/flexunit4.rb",
50
+ "lib/buildr/as3/toolkits.rb",
51
+ "lib/buildr/as3/toolkits/alchemy.rb",
52
+ "lib/buildr/as3/toolkits/apparat.rb",
53
+ "lib/buildr/as3/toolkits/base.rb",
54
+ "lib/buildr/as3/toolkits/flexsdk.rb",
36
55
  "test/helper.rb",
37
56
  "test/test_buildr_as3.rb"
38
57
  ]
39
58
  s.homepage = %q{http://github.com/devboy/buildr_as3}
40
59
  s.licenses = ["MIT"]
41
60
  s.require_paths = ["lib"]
42
- s.rubygems_version = %q{1.5.0}
61
+ s.rubygems_version = %q{1.6.2}
43
62
  s.summary = %q{Buildr extension to allow ActionScript3/Flex development.}
44
63
  s.test_files = [
45
64
  "test/helper.rb",
@@ -54,20 +73,20 @@ Gem::Specification.new do |s|
54
73
  s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
55
74
  s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
56
75
  s.add_development_dependency(%q<rcov>, [">= 0"])
57
- s.add_runtime_dependency(%q<buildr>, [">= 1.4.4"])
76
+ s.add_runtime_dependency(%q<buildr>, [">= 1.4.5"])
58
77
  else
59
78
  s.add_dependency(%q<shoulda>, [">= 0"])
60
79
  s.add_dependency(%q<bundler>, ["~> 1.0.0"])
61
80
  s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
62
81
  s.add_dependency(%q<rcov>, [">= 0"])
63
- s.add_dependency(%q<buildr>, [">= 1.4.4"])
82
+ s.add_dependency(%q<buildr>, [">= 1.4.5"])
64
83
  end
65
84
  else
66
85
  s.add_dependency(%q<shoulda>, [">= 0"])
67
86
  s.add_dependency(%q<bundler>, ["~> 1.0.0"])
68
87
  s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
69
88
  s.add_dependency(%q<rcov>, [">= 0"])
70
- s.add_dependency(%q<buildr>, [">= 1.4.4"])
89
+ s.add_dependency(%q<buildr>, [">= 1.4.5"])
71
90
  end
72
91
  end
73
92
 
data/lib/buildr/as3.rb CHANGED
@@ -19,14 +19,13 @@
19
19
  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
20
  # THE SOFTWARE.
21
21
  #
22
+
23
+ require "buildr"
24
+
25
+ require "#{File.dirname(__FILE__)}/as3/project"
22
26
  require "#{File.dirname(__FILE__)}/as3/compiler"
23
27
  require "#{File.dirname(__FILE__)}/as3/packaging"
24
- require "#{File.dirname(__FILE__)}/as3/flexsdk"
28
+ require "#{File.dirname(__FILE__)}/as3/toolkits"
29
+ require "#{File.dirname(__FILE__)}/as3/ide"
25
30
  require "#{File.dirname(__FILE__)}/as3/doc"
26
- require "#{File.dirname(__FILE__)}/as3/alchemy"
27
- require "#{File.dirname(__FILE__)}/as3/apparat"
28
- require "#{File.dirname(__FILE__)}/as3/ide/fdt4"
29
- require "#{File.dirname(__FILE__)}/as3/tests"
30
- include Buildr::AS3::Flex
31
- include Buildr::AS3::Apparat
32
- include Buildr::AS3::Alchemy
31
+ require File.dirname(__FILE__) + '/as3/test'
@@ -19,265 +19,14 @@
19
19
  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
20
  # THE SOFTWARE.
21
21
  #
22
- #TODO: Refactor compiler classes, right now everything is copy&paste
23
22
 
24
- module Buildr
25
- module AS3
26
- module Compiler
27
- module CompilerUtils
23
+ require "#{File.dirname(__FILE__)}/compiler/base"
24
+ require "#{File.dirname(__FILE__)}/compiler/mxmlc"
25
+ require "#{File.dirname(__FILE__)}/compiler/compc"
26
+ require "#{File.dirname(__FILE__)}/compiler/airmxmlc"
27
+ require "#{File.dirname(__FILE__)}/compiler/aircompc"
28
28
 
29
- def reserved_options
30
- [:flexsdk, :main, :apparat, :output, :append]
31
- end
32
-
33
- def append_args( cmd_args, append_args )
34
- unless append_args.nil? || append_args.empty?
35
- append_args.each do |arg|
36
- cmd_args << arg
37
- end
38
- end
39
- end
40
-
41
- def self.get_output(project, target, package, options)
42
- return options[:output] if options.has_key? :output
43
- return "#{target}/#{File.basename(options[:main].to_s, File.extname(options[:main].to_s))}.swf" if package == :swf
44
- return "#{target}/#{project.name.gsub(":", "-")}.swc" if package == :swc
45
- fail("Could not guess output file.")
46
- end
47
-
48
- def needed?(sources, target, dependencies)
49
- output = CompilerUtils::get_output(project, target, project.compile.packaging, options)
50
- sources.each do |source|
51
- if is_output_outdated?(output, source)
52
- puts "Recompile of #{project.name} needed: Sources are newer than target"
53
- return true
54
- end
55
- end
56
- dependencies.each do |dependency|
57
- if is_output_outdated?(output, dependency)
58
- puts "Recompile of #{project.name} needed: Dependencies are newer than target"
59
- return true
60
- end
61
- end
62
- puts "Recompile of #{project.name} not needed."
63
- false
64
- end
65
-
66
- def is_output_outdated?(output, file_to_check)
67
- return true unless File.exists? output
68
- older(output, file_to_check)
69
- end
70
-
71
- def older(a, b) # a older than b
72
- timestamp_from_file(a) < timestamp_from_file(b)
73
- end
74
-
75
- def timestamp_from_file(file)
76
- File.directory?(file) ? get_last_modified(file) : File.mtime(file)
77
- end
78
-
79
- def get_last_modified(dir)
80
- file_mtimes = []
81
- dirs = Dir.new(dir).select { |file| file!= '.' && file!='..' && File.directory?(dir+"/"+file)==true }
82
- dirs = dirs.collect { |subdir| dir+"/"+subdir }
83
- dirs.each { |subdir| file_mtimes << get_last_modified(subdir) }
84
- files = Dir.new(dir).select { |file| file!= '.' && file!='..' && File.directory?(dir+"/"+file)==false }
85
- files = files.collect { |file| dir+'/'+file }
86
- files.each { |file| file_mtimes << File.mtime(file) }
87
- file_mtimes.sort!
88
- file_mtimes.reverse!
89
- file_mtimes.length > 0 ? file_mtimes.first : Time.at(0)
90
- end
91
-
92
- def move_dependency_dirs_to_source( sources, dependencies )
93
- moves = []
94
- dependencies.each do |dependency|
95
- if File.directory? dependency
96
- moves << dependency
97
- end
98
- end
99
- moves.each do |move|
100
- dependencies.delete move
101
- sources << move
102
- end
103
- end
104
- end
105
-
106
- class Mxmlc < Buildr::Compiler::Base
107
- specify :language => :actionscript,
108
- :sources => [:as3, :mxml], :source_ext => [:as, :mxml],
109
- :target => "bin", :target_ext => "swf",
110
- :packaging => :swf
111
-
112
- attr_reader :project
113
-
114
- def initialize(project, options)
115
- super
116
- @project = project
117
- end
118
-
119
- include CompilerUtils
120
-
121
- def compile(sources, target, dependencies)
122
- puts dependencies.join("\n")
123
- flex_sdk = options[:flexsdk].invoke
124
- output = CompilerUtils::get_output(project, target, :swf, options)
125
- move_dependency_dirs_to_source( sources, dependencies)
126
- cmd_args = []
127
- cmd_args << "-jar" << flex_sdk.mxmlc_jar
128
- cmd_args << "+flexlib" << "#{flex_sdk.home}/frameworks"
129
- cmd_args << options[:main]
130
- cmd_args << "-output" << output
131
- cmd_args << "-load-config" << flex_sdk.flex_config
132
- append_args(cmd_args,options[:append])
133
- sources.each {|source| cmd_args << "-source-path+=#{source}"}
134
- # cmd_args << "-source-path" << sources.join(" ")
135
- cmd_args << "-library-path+=#{dependencies.join(",")}" unless dependencies.empty?
136
- options[:debug] = Buildr.options.debug.to_s
137
- options.to_hash.reject { |key, value| reserved_options.include?(key) }.
138
- each do |key, value|
139
- cmd_args << "-#{key}=#{value}"
140
- end
141
- flex_sdk.default_options.each do |key, value|
142
- cmd_args << "-#{key}=#{value}"
143
- end
144
-
145
- puts "args:", cmd_args
146
- unless Buildr.application.options.dryrun
147
- Java::Commands.java cmd_args
148
- end
149
- end
150
- end
151
-
152
- class AirMxmlc < Buildr::Compiler::Base
153
-
154
- specify :language => :actionscript,
155
- :sources => [:as3, :mxml], :source_ext => [:as, :mxml],
156
- :target => "bin", :target_ext => "swf",
157
- :packaging => :swf
158
-
159
- attr_reader :project
160
-
161
- def initialize(project, options)
162
- super
163
- @project = project
164
- end
165
-
166
- include CompilerUtils
167
-
168
- def compile(sources, target, dependencies)
169
- flex_sdk = options[:flexsdk].invoke
170
- output = CompilerUtils::get_output(project, target, :swf, options)
171
- move_dependency_dirs_to_source( sources, dependencies)
172
- cmd_args = []
173
- cmd_args << "-jar" << flex_sdk.mxmlc_jar
174
- cmd_args << "+flexlib" << "#{flex_sdk.home}/frameworks"
175
- cmd_args << "+configname" << "air"
176
- cmd_args << options[:main]
177
- cmd_args << "-output" << output
178
- cmd_args << "-load-config" << flex_sdk.air_config
179
- sources.each {|source| cmd_args << "-source-path+=#{source}"}
180
- cmd_args << "-library-path+=#{dependencies.join(",")}" unless dependencies.empty?
181
- options[:debug] = Buildr.options.debug.to_s
182
- options.to_hash.reject { |key, value| reserved_options.include?(key) }.
183
- each do |key, value|
184
- cmd_args << "-#{key}=#{value}"
185
- end
186
- flex_sdk.default_options.each do |key, value|
187
- cmd_args << "-#{key}=#{value}"
188
- end
189
-
190
- unless Buildr.application.options.dryrun
191
- Java::Commands.java cmd_args
192
- end
193
- end
194
- end
195
-
196
- class Compc < Buildr::Compiler::Base
197
- specify :language => :actionscript,
198
- :sources => [:as3, :mxml], :source_ext => [:as, :mxml],
199
- :target => "bin", :target_ext => "swc",
200
- :packaging => :swc
201
- attr_reader :project
202
-
203
- def initialize(project, options)
204
- super
205
- @project = project
206
- end
207
-
208
- include CompilerUtils
209
-
210
- def compile(sources, target, dependencies)
211
- flex_sdk = options[:flexsdk].invoke
212
- output = CompilerUtils::get_output(project, target, :swc, options)
213
- move_dependency_dirs_to_source( sources, dependencies)
214
- cmd_args = []
215
- cmd_args << "-jar" << flex_sdk.compc_jar
216
- cmd_args << "-output" << output
217
- cmd_args << "+flexlib" << "#{flex_sdk.home}/frameworks"
218
- cmd_args << "-load-config" << flex_sdk.flex_config
219
- sources.each {|source| cmd_args << "-include-sources+=#{source}"}
220
- cmd_args << "-library-path+=#{dependencies.join(",")}" unless dependencies.empty?
221
- options[:debug] = Buildr.options.debug.to_s
222
- options.to_hash.reject { |key, value| reserved_options.include?(key) }.
223
- each do |key, value|
224
- cmd_args << "-#{key}=#{value}"
225
- end
226
- flex_sdk.default_options.each do |key, value|
227
- cmd_args << "-#{key}=#{value}"
228
- end
229
-
230
- unless Buildr.application.options.dryrun
231
- Java::Commands.java cmd_args
232
- end
233
- end
234
- end
235
-
236
- class AirCompc < Buildr::Compiler::Base
237
- specify :language => :actionscript,
238
- :sources => [:as3, :mxml], :source_ext => [:as, :mxml],
239
- :target => "bin", :target_ext => "swc",
240
- :packaging => :swc
241
- attr_reader :project
242
-
243
- def initialize(project, options)
244
- super
245
- @project = project
246
- end
247
-
248
- include CompilerUtils
249
-
250
- def compile(sources, target, dependencies)
251
- flex_sdk = options[:flexsdk].invoke
252
- output = CompilerUtils::get_output(project, target, :swc, options)
253
- move_dependency_dirs_to_source( sources, dependencies)
254
- cmd_args = []
255
- cmd_args << "-jar" << flex_sdk.compc_jar
256
- cmd_args << "-output" << output
257
- cmd_args << "-load-config" << flex_sdk.air_config
258
- cmd_args << "+flexlib" << "#{flex_sdk.home}/frameworks"
259
- cmd_args << "+configname" << "air"
260
- sources.each {|source| cmd_args << "-include-sources+=#{source}"}
261
- cmd_args << "-library-path+=#{dependencies.join(",")}" unless dependencies.empty?
262
- options[:debug] = Buildr.options.debug.to_s
263
- options.to_hash.reject { |key, value| reserved_options.include?(key) }.
264
- each do |key, value|
265
- cmd_args << "-#{key}=#{value}"
266
- end
267
- flex_sdk.default_options.each do |key, value|
268
- cmd_args << "-#{key}=#{value}"
269
- end
270
-
271
-
272
- unless Buildr.application.options.dryrun
273
- Java::Commands.java cmd_args
274
- end
275
- end
276
- end
277
- end
278
- end
279
- end
280
- Buildr::Compiler.compilers << Buildr::AS3::Compiler::Mxmlc
281
- Buildr::Compiler.compilers << Buildr::AS3::Compiler::Compc
282
- Buildr::Compiler.compilers << Buildr::AS3::Compiler::AirMxmlc
283
- Buildr::Compiler.compilers << Buildr::AS3::Compiler::AirCompc
29
+ Buildr::Compiler << Buildr::AS3::Compiler::Mxmlc
30
+ Buildr::Compiler << Buildr::AS3::Compiler::Compc
31
+ Buildr::Compiler << Buildr::AS3::Compiler::AirMxmlc
32
+ Buildr::Compiler << Buildr::AS3::Compiler::AirCompc