buildr-as3 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.6
1
+ 0.1.7
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.6"
8
+ s.version = "0.1.7"
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-01-26}
12
+ s.date = %q{2011-01-27}
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 = [
@@ -26,6 +26,7 @@ Gem::Specification.new do |s|
26
26
  "buildr-as3.gemspec",
27
27
  "lib/buildr/as3.rb",
28
28
  "lib/buildr/as3/alchemytk.rb",
29
+ "lib/buildr/as3/apparat.rb",
29
30
  "lib/buildr/as3/compiler.rb",
30
31
  "lib/buildr/as3/doc.rb",
31
32
  "lib/buildr/as3/flexsdk.rb",
data/lib/buildr/as3.rb CHANGED
@@ -23,4 +23,5 @@ require "#{File.dirname(__FILE__)}/as3/compiler"
23
23
  require "#{File.dirname(__FILE__)}/as3/packaging"
24
24
  require "#{File.dirname(__FILE__)}/as3/flexsdk"
25
25
  require "#{File.dirname(__FILE__)}/as3/doc"
26
- require "#{File.dirname(__FILE__)}/as3/alchemytk"
26
+ require "#{File.dirname(__FILE__)}/as3/alchemytk"
27
+ require "#{File.dirname(__FILE__)}/as3/apparat"
@@ -0,0 +1,104 @@
1
+ #
2
+ # Copyright (C) 2011 by Dominic Graefen / http://devboy.org
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
+ module Buildr
23
+ module BuildrAs3
24
+ class ApparatToolkit
25
+ attr_reader :home, :asmifier, :concrete, :coverage, :dump, :jitb, :reducer, :stripper, :tdsi, :asm_swc,
26
+ :ersatz_swc, :lzma_decoder_swc
27
+
28
+ def initialize(apparat_version,apparat_url)
29
+
30
+ apparat_zip = Buildr::artifact("com.googlecode:apparat-bin:zip:#{apparat_version}").from(Buildr::download(apparat_url))
31
+ apparat_zip.invoke unless File.exists? apparat_zip.to_s
32
+ apparat_dir = File.join(File.dirname(apparat_zip.to_s), "apparat-bin-#{apparat_version}")
33
+ unless File.exists? apparat_dir
34
+ puts "Unzipping Apparat, this may take a while."
35
+ Buildr::unzip(apparat_dir=>apparat_zip.to_s).target.invoke
36
+ end
37
+
38
+ @home = apparat_dir
39
+ bat_ext = Buildr::Util.win_os? ? ".bat" : ""
40
+ @apparat = "#{@home}/apparat#{bat_ext}"
41
+ @asmifier = "#{@home}/asmifier#{bat_ext}"
42
+ @concrete = "#{@home}/concrete#{bat_ext}"
43
+ @coverage = "#{@home}/coverage#{bat_ext}"
44
+ @dump = "#{@home}/dump#{bat_ext}"
45
+ @jitb = "#{@home}/jitb#{bat_ext}"
46
+ @reducer = "#{@home}/reducer#{bat_ext}"
47
+ @stripper = "#{@home}/stripper#{bat_ext}"
48
+ @tdsi = "#{@home}/tdsi#{bat_ext}"
49
+ @asm_swc = "#{@home}/apparat-asm-#{apparat_version}.swc"
50
+ @ersatz_swc = "#{@home}/apparat-ersatz-#{apparat_version}.swc"
51
+ @lzma_decoder_swc = "#{@home}/apparat-lzma-decoder-#{apparat_version}.swc"
52
+ end
53
+ end
54
+ module Apparat
55
+ include Extension
56
+
57
+ first_time do
58
+ # Define task not specific to any projet.
59
+ Project.local_task('apparat_tdsi')
60
+ Project.local_task('apparat_reducer')
61
+ end
62
+
63
+ before_define do |project|
64
+ end
65
+
66
+ after_define do |project|
67
+ end
68
+
69
+ def apparat_tdsi(apparat_tk,options = {})
70
+ puts "aparat_tdsi"
71
+ main = compile.options[:main]
72
+ mainfile = File.basename(main, File.extname(main))
73
+ output = (compile.options[:output] || "#{compile.target}/#{mainfile}.swf")
74
+ cmd_args = []
75
+ cmd_args << apparat_tk.tdsi
76
+ cmd_args << "-i #{output}"
77
+ cmd_args << "-o #{output}"
78
+ reserved = []
79
+ options.to_hash.reject { |key, value| reserved.include?(key) }.
80
+ each do |key, value|
81
+ cmd_args << "-#{key}=#{value}"
82
+ end
83
+ system(cmd_args.join " ")
84
+ end
85
+
86
+ def apparat_reducer(apparat_tk,quality)
87
+ puts "aparat_reducer"
88
+ main = compile.options[:main]
89
+ mainfile = File.basename(main, File.extname(main))
90
+ output = (compile.options[:output] || "#{compile.target}/#{mainfile}.swf")
91
+ cmd_args = []
92
+ cmd_args << apparat_tk.reducer
93
+ cmd_args << "-i #{output}"
94
+ cmd_args << "-o #{output}"
95
+ cmd_args << "-q"
96
+ cmd_args << quality || 80
97
+ system(cmd_args.join " ")
98
+ end
99
+ end
100
+ end
101
+ class Project
102
+ include Buildr::BuildrAs3::Apparat
103
+ end
104
+ 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: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 6
10
- version: 0.1.6
9
+ - 7
10
+ version: 0.1.7
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-01-26 00:00:00 +01:00
18
+ date: 2011-01-27 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -113,6 +113,7 @@ files:
113
113
  - buildr-as3.gemspec
114
114
  - lib/buildr/as3.rb
115
115
  - lib/buildr/as3/alchemytk.rb
116
+ - lib/buildr/as3/apparat.rb
116
117
  - lib/buildr/as3/compiler.rb
117
118
  - lib/buildr/as3/doc.rb
118
119
  - lib/buildr/as3/flexsdk.rb