Class: Buildr::AS3::Packaging::AiriTask

Inherits:
Rake::FileTask
  • Object
show all
Includes:
Extension
Defined in:
lib/buildr/as3/packaging/airi.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ AiriTask

:nodoc:



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/buildr/as3/packaging/airi.rb', line 36

def initialize(*args) #:nodoc:
  super
  enhance do
    fail "File not found: #{src_swf}" unless File.exists? src_swf
    cmd_args = []
    cmd_args << "-jar" << flexsdk.adt_jar
    cmd_args << "-prepare"
    cmd_args << target_air
    cmd_args << appdescriptor
    cmd_args << "-C" << File.dirname(src_swf) << File.basename(src_swf)
    libs.each do |key, value|
      puts "key,value", key, value
      cmd_args << "-C" << key << value
    end unless libs.nil?

    puts cmd_args.join " "

    unless Buildr.application.options.dryrun
      Java::Commands.java cmd_args
    end
  end
end

Instance Attribute Details

#appdescriptorObject (readonly)

Returns the value of attribute appdescriptor



34
35
36
# File 'lib/buildr/as3/packaging/airi.rb', line 34

def appdescriptor
  @appdescriptor
end

#flexsdkObject

Returns the value of attribute flexsdk



34
35
36
# File 'lib/buildr/as3/packaging/airi.rb', line 34

def flexsdk
  @flexsdk
end

#keystoreObject (readonly)

Returns the value of attribute keystore



34
35
36
# File 'lib/buildr/as3/packaging/airi.rb', line 34

def keystore
  @keystore
end

#libsObject (readonly)

Returns the value of attribute libs



34
35
36
# File 'lib/buildr/as3/packaging/airi.rb', line 34

def libs
  @libs
end

#src_swfObject

Returns the value of attribute src_swf



34
35
36
# File 'lib/buildr/as3/packaging/airi.rb', line 34

def src_swf
  @src_swf
end

#storepassObject (readonly)

Returns the value of attribute storepass



34
35
36
# File 'lib/buildr/as3/packaging/airi.rb', line 34

def storepass
  @storepass
end

#storetypeObject (readonly)

Returns the value of attribute storetype



34
35
36
# File 'lib/buildr/as3/packaging/airi.rb', line 34

def storetype
  @storetype
end

#target_airObject

Returns the value of attribute target_air



34
35
36
# File 'lib/buildr/as3/packaging/airi.rb', line 34

def target_air
  @target_air
end

Instance Method Details

#needed?Boolean

Returns:

  • (Boolean)


59
60
61
62
# File 'lib/buildr/as3/packaging/airi.rb', line 59

def needed?
  return true unless File.exists?(target_air)
  File.stat(src_swf).mtime > File.stat(target_air).mtime
end

#sign(*args) ⇒ Object



75
76
77
78
79
80
# File 'lib/buildr/as3/packaging/airi.rb', line 75

def sign(*args)
  args.each do |arg|
    @appdescriptor = arg[:appdescriptor] if arg.has_key? :appdescriptor
  end
  self
end

#with(*args) ⇒ Object



82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/buildr/as3/packaging/airi.rb', line 82

def with(*args)
  @libs ||= Hash.new
  args.each do |arg|
    case arg
      when Hash
        arg.each do |key, value|
          @libs[key] = value
        end
    end
  end
  self
end