Class: Buildr::AS3::Apparat::ApparatToolkit

Inherits:
Object
  • Object
show all
Defined in:
lib/buildr/as3/apparat.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(version) ⇒ ApparatToolkit

Returns a new instance of ApparatToolkit.



30
31
32
33
34
35
36
# File 'lib/buildr/as3/apparat.rb', line 30

def initialize(version)
  @version = version
  @spec = "com.googlecode:apparat-bin:zip:#{@version}"
  @apparat_zip = Buildr.artifact(@spec)
  @apparat_dir = File.join(File.dirname(@apparat_zip.to_s), "apparat-bin-#{@version}", "apparat-#{@version}")
  generate_paths @apparat_dir, @version
end

Instance Attribute Details

#asm_swcObject (readonly)

Returns the value of attribute asm_swc.



26
27
28
# File 'lib/buildr/as3/apparat.rb', line 26

def asm_swc
  @asm_swc
end

#asmifierObject (readonly)

Returns the value of attribute asmifier.



26
27
28
# File 'lib/buildr/as3/apparat.rb', line 26

def asmifier
  @asmifier
end

#concreteObject (readonly)

Returns the value of attribute concrete.



26
27
28
# File 'lib/buildr/as3/apparat.rb', line 26

def concrete
  @concrete
end

#coverageObject (readonly)

Returns the value of attribute coverage.



26
27
28
# File 'lib/buildr/as3/apparat.rb', line 26

def coverage
  @coverage
end

#dumpObject (readonly)

Returns the value of attribute dump.



26
27
28
# File 'lib/buildr/as3/apparat.rb', line 26

def dump
  @dump
end

#ersatz_swcObject (readonly)

Returns the value of attribute ersatz_swc.



26
27
28
# File 'lib/buildr/as3/apparat.rb', line 26

def ersatz_swc
  @ersatz_swc
end

#homeObject (readonly)

Returns the value of attribute home.



26
27
28
# File 'lib/buildr/as3/apparat.rb', line 26

def home
  @home
end

#jitbObject (readonly)

Returns the value of attribute jitb.



26
27
28
# File 'lib/buildr/as3/apparat.rb', line 26

def jitb
  @jitb
end

#lzma_decoder_swcObject (readonly)

Returns the value of attribute lzma_decoder_swc.



26
27
28
# File 'lib/buildr/as3/apparat.rb', line 26

def lzma_decoder_swc
  @lzma_decoder_swc
end

#reducerObject (readonly)

Returns the value of attribute reducer.



26
27
28
# File 'lib/buildr/as3/apparat.rb', line 26

def reducer
  @reducer
end

#scala_homeObject (readonly)

Returns the value of attribute scala_home.



26
27
28
# File 'lib/buildr/as3/apparat.rb', line 26

def scala_home
  @scala_home
end

#stripperObject (readonly)

Returns the value of attribute stripper.



26
27
28
# File 'lib/buildr/as3/apparat.rb', line 26

def stripper
  @stripper
end

#tdsiObject (readonly)

Returns the value of attribute tdsi.



26
27
28
# File 'lib/buildr/as3/apparat.rb', line 26

def tdsi
  @tdsi
end

Instance Method Details

#from(url) ⇒ Object



64
65
66
67
# File 'lib/buildr/as3/apparat.rb', line 64

def from(url)
  @url = url
  self
end

#invokeObject



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/buildr/as3/apparat.rb', line 38

def invoke

  if @url
    Buildr.artifact(@spec).from(Buildr.download(@url)).invoke unless File.exists? @apparat_zip.to_s
  else
    Buildr.artifact(@spec).invoke unless File.exists? @apparat_zip.to_s
  end

  unless File.exists? @apparat_dir
    puts "Unzipping Apparat, this might take a while."
    unzip_dir = File.dirname @apparat_dir
    if Buildr::Util.win_os?
      puts "Please make sure unzip is installed and in your PATH variable!"
      unzip @apparat_zip, unzip_dir
    else
      begin
        Buildr.unzip(unzip_dir.to_s=>@apparat_zip.to_s).target.invoke
      rescue TypeError
        puts "RubyZip extract failed, trying system unzip now."
        unzip @apparat_zip, unzip_dir
      end
    end
  end
  self
end

#scala(scala_home) ⇒ Object



69
70
71
72
# File 'lib/buildr/as3/apparat.rb', line 69

def scala(scala_home)
  @scala_home = scala_home
  self
end