buildr-as3 0.1.19 → 0.1.20

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -2,8 +2,23 @@
2
2
 
3
3
  "build like you code" - now supporting ActionScript 3 & Flex
4
4
 
5
+ = Contributing to buildr_as3
6
+
7
+ * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
8
+ * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
9
+ * Fork the project
10
+ * Start a feature/bugfix branch
11
+ * Commit and push until you are happy with your contribution
12
+ * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
13
+ * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
14
+
5
15
  = Changelog
6
16
 
17
+ == 0.1.20
18
+
19
+ * [FIXED] directories of dependencies are now added as source folders in all compilers
20
+ * [FEATURE] added :append option (Array) to add additional parameters to the compiler
21
+
7
22
  == 0.1.19
8
23
 
9
24
  * [FEATURE] compile.with now works with directories, which allows to use other as3-source-folders to be referenced in your project.
@@ -37,16 +52,6 @@
37
52
  * Updated compiler-wrapper for Adobe AIR (":airmxmlc" & ":aircompc")
38
53
  * Implemented packaging task for .air files "package(:air).sign(...).include(...)"
39
54
 
40
- = Contributing to buildr_as3
41
-
42
- * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
43
- * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
44
- * Fork the project
45
- * Start a feature/bugfix branch
46
- * Commit and push until you are happy with your contribution
47
- * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
48
- * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
49
-
50
55
  = Copyright
51
56
 
52
57
  Copyright (c) 2011 Dominic Graefen. See LICENSE.txt for
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.19
1
+ 0.1.20
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.19"
8
+ s.version = "0.1.20"
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-20}
12
+ s.date = %q{2011-02-23}
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 = [
@@ -32,6 +32,7 @@ Gem::Specification.new do |s|
32
32
  "lib/buildr/as3/flexsdk.rb",
33
33
  "lib/buildr/as3/ide/fdt4.rb",
34
34
  "lib/buildr/as3/packaging.rb",
35
+ "lib/buildr/as3/tests.rb",
35
36
  "test/helper.rb",
36
37
  "test/test_buildr_as3.rb"
37
38
  ]
data/lib/buildr/as3.rb CHANGED
@@ -26,6 +26,7 @@ require "#{File.dirname(__FILE__)}/as3/doc"
26
26
  require "#{File.dirname(__FILE__)}/as3/alchemy"
27
27
  require "#{File.dirname(__FILE__)}/as3/apparat"
28
28
  require "#{File.dirname(__FILE__)}/as3/ide/fdt4"
29
+ require "#{File.dirname(__FILE__)}/as3/tests"
29
30
  include Buildr::AS3::Flex
30
31
  include Buildr::AS3::Apparat
31
32
  include Buildr::AS3::Alchemy
@@ -127,8 +127,6 @@ module Buildr
127
127
  cmd_args << "-#{key} #{value}"
128
128
  end
129
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")
130
- # puts "path:", ENV["PATH"]
131
- # puts "tdsi:",cmd_args.join(" "), system(cmd_args.join " ")
132
130
  system(cmd_args.join " ")
133
131
  end
134
132
 
@@ -25,6 +25,19 @@ module Buildr
25
25
  module AS3
26
26
  module Compiler
27
27
  module CompilerUtils
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
+
28
41
  def self.get_output(project, target, package, options)
29
42
  return options[:output] if options.has_key? :output
30
43
  return "#{target}/#{File.basename(options[:main].to_s, File.extname(options[:main].to_s))}.swf" if package == :swf
@@ -77,12 +90,16 @@ module Buildr
77
90
  end
78
91
 
79
92
  def move_dependency_dirs_to_source( sources, dependencies )
93
+ moves = []
80
94
  dependencies.each do |dependency|
81
95
  if File.directory? dependency
82
- dependencies.delete dependency
83
- sources << dependency
96
+ moves << dependency
84
97
  end
85
98
  end
99
+ moves.each do |move|
100
+ dependencies.delete move
101
+ sources << move
102
+ end
86
103
  end
87
104
  end
88
105
 
@@ -102,6 +119,7 @@ module Buildr
102
119
  include CompilerUtils
103
120
 
104
121
  def compile(sources, target, dependencies)
122
+ puts dependencies.join("\n")
105
123
  flex_sdk = options[:flexsdk].invoke
106
124
  output = CompilerUtils::get_output(project, target, :swf, options)
107
125
  move_dependency_dirs_to_source( sources, dependencies)
@@ -111,12 +129,12 @@ module Buildr
111
129
  cmd_args << options[:main]
112
130
  cmd_args << "-output" << output
113
131
  cmd_args << "-load-config" << flex_sdk.flex_config
132
+ append_args(cmd_args,options[:append])
114
133
  sources.each {|source| cmd_args << "-source-path+=#{source}"}
115
134
  # cmd_args << "-source-path" << sources.join(" ")
116
135
  cmd_args << "-library-path+=#{dependencies.join(",")}" unless dependencies.empty?
117
136
  options[:debug] = Buildr.options.debug.to_s
118
- reserved = [:flexsdk, :main, :apparat]
119
- options.to_hash.reject { |key, value| reserved.include?(key) }.
137
+ options.to_hash.reject { |key, value| reserved_options.include?(key) }.
120
138
  each do |key, value|
121
139
  cmd_args << "-#{key}=#{value}"
122
140
  end
@@ -124,6 +142,7 @@ module Buildr
124
142
  cmd_args << "-#{key}=#{value}"
125
143
  end
126
144
 
145
+ puts "args:", cmd_args
127
146
  unless Buildr.application.options.dryrun
128
147
  Java::Commands.java cmd_args
129
148
  end
@@ -160,8 +179,7 @@ module Buildr
160
179
  sources.each {|source| cmd_args << "-source-path+=#{source}"}
161
180
  cmd_args << "-library-path+=#{dependencies.join(",")}" unless dependencies.empty?
162
181
  options[:debug] = Buildr.options.debug.to_s
163
- reserved = [:flexsdk, :main, :apparat]
164
- options.to_hash.reject { |key, value| reserved.include?(key) }.
182
+ options.to_hash.reject { |key, value| reserved_options.include?(key) }.
165
183
  each do |key, value|
166
184
  cmd_args << "-#{key}=#{value}"
167
185
  end
@@ -200,9 +218,8 @@ module Buildr
200
218
  cmd_args << "-load-config" << flex_sdk.flex_config
201
219
  sources.each {|source| cmd_args << "-include-sources+=#{source}"}
202
220
  cmd_args << "-library-path+=#{dependencies.join(",")}" unless dependencies.empty?
203
- reserved = [:flexsdk, :main, :apparat]
204
221
  options[:debug] = Buildr.options.debug.to_s
205
- options.to_hash.reject { |key, value| reserved.include?(key) }.
222
+ options.to_hash.reject { |key, value| reserved_options.include?(key) }.
206
223
  each do |key, value|
207
224
  cmd_args << "-#{key}=#{value}"
208
225
  end
@@ -243,8 +260,7 @@ module Buildr
243
260
  sources.each {|source| cmd_args << "-include-sources+=#{source}"}
244
261
  cmd_args << "-library-path+=#{dependencies.join(",")}" unless dependencies.empty?
245
262
  options[:debug] = Buildr.options.debug.to_s
246
- reserved = [:flexsdk, :main, :apparat]
247
- options.to_hash.reject { |key, value| reserved.include?(key) }.
263
+ options.to_hash.reject { |key, value| reserved_options.include?(key) }.
248
264
  each do |key, value|
249
265
  cmd_args << "-#{key}=#{value}"
250
266
  end
@@ -252,6 +268,7 @@ module Buildr
252
268
  cmd_args << "-#{key}=#{value}"
253
269
  end
254
270
 
271
+
255
272
  unless Buildr.application.options.dryrun
256
273
  Java::Commands.java cmd_args
257
274
  end
@@ -0,0 +1,54 @@
1
+ # Licensed to the Apache Software Foundation (ASF) under one or more
2
+ # contributor license agreements. See the NOTICE file distributed with this
3
+ # work for additional information regarding copyright ownership. The ASF
4
+ # licenses this file to you under the Apache License, Version 2.0 (the
5
+ # "License"); you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
+ # License for the specific language governing permissions and limitations under
14
+ # the License.
15
+
16
+ require 'buildr/core/test'
17
+ require 'buildr/core/build'
18
+ require 'buildr/core/compile'
19
+ require 'buildr/java/ant'
20
+
21
+
22
+ module Buildr
23
+
24
+ class FlexUnit4 < TestFramework::Base
25
+
26
+ class << self
27
+ taskdef_spec = "org.flexunit:flexUnitTasks:jar:4.1.0"
28
+ def applies_to?(project) #:nodoc:
29
+ project.test.compile.language == :actionscript
30
+ end
31
+ end
32
+
33
+ # def initialize
34
+ # puts "FlexUnit4 init"
35
+ # end
36
+
37
+ def tests(dependencies) #:nodoc:
38
+ puts "FlexUnit4 run"
39
+ []
40
+ end
41
+
42
+ def run(tests, dependencies) #:nodoc:
43
+ puts "FlexUnit4 run"
44
+ Buildr.ant('flexunit') do |ant|
45
+ taskdef = Buildr.artifact(FlexUnit4.taskdef_spec)
46
+ taskdef.invoke
47
+ ant.taskdef :name=>'flexunit', :resource=>"flexUnitTasks.tasks", :classpath=>taskdef.to_s
48
+ end
49
+ end
50
+ end
51
+
52
+ end
53
+
54
+ Buildr::TestFramework.add Buildr::FlexUnit4
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: 61
4
+ hash: 51
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 19
10
- version: 0.1.19
9
+ - 20
10
+ version: 0.1.20
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-20 00:00:00 +01:00
18
+ date: 2011-02-23 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -119,6 +119,7 @@ files:
119
119
  - lib/buildr/as3/flexsdk.rb
120
120
  - lib/buildr/as3/ide/fdt4.rb
121
121
  - lib/buildr/as3/packaging.rb
122
+ - lib/buildr/as3/tests.rb
122
123
  - test/helper.rb
123
124
  - test/test_buildr_as3.rb
124
125
  has_rdoc: true