Class: Buildr::AS3::Packaging::AirTask

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Compiler::CompilerUtils

#append_args, #get_last_modified, get_output, #is_output_outdated?, #move_dependency_dirs_to_source, #older, #reserved_options, #timestamp_from_file

Constructor Details

#initialize(*args) ⇒ AirTask

:nodoc:



102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# File 'lib/buildr/as3/packaging.rb', line 102

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 << "-package"
    cmd_args << "-storetype" << storetype
    cmd_args << "-keystore" << keystore
    cmd_args << "-storepass" << storepass
    cmd_args << target_air
    cmd_args << appdescriptor
    cmd_args << "-C" << File.dirname(src_swf) << File.basename(src_swf)
#            puts libs unless libs.nil?
    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.



100
101
102
# File 'lib/buildr/as3/packaging.rb', line 100

def appdescriptor
  @appdescriptor
end

#flexsdkObject

Returns the value of attribute flexsdk.



100
101
102
# File 'lib/buildr/as3/packaging.rb', line 100

def flexsdk
  @flexsdk
end

#keystoreObject (readonly)

Returns the value of attribute keystore.



100
101
102
# File 'lib/buildr/as3/packaging.rb', line 100

def keystore
  @keystore
end

#libsObject (readonly)

Returns the value of attribute libs.



100
101
102
# File 'lib/buildr/as3/packaging.rb', line 100

def libs
  @libs
end

#src_swfObject

Returns the value of attribute src_swf.



100
101
102
# File 'lib/buildr/as3/packaging.rb', line 100

def src_swf
  @src_swf
end

#storepassObject (readonly)

Returns the value of attribute storepass.



100
101
102
# File 'lib/buildr/as3/packaging.rb', line 100

def storepass
  @storepass
end

#storetypeObject (readonly)

Returns the value of attribute storetype.



100
101
102
# File 'lib/buildr/as3/packaging.rb', line 100

def storetype
  @storetype
end

#target_airObject

Returns the value of attribute target_air.



100
101
102
# File 'lib/buildr/as3/packaging.rb', line 100

def target_air
  @target_air
end

Instance Method Details

#needed?Boolean

Returns:

  • (Boolean)


129
130
131
# File 'lib/buildr/as3/packaging.rb', line 129

def needed?
  is_output_outdated? target_air, src_swf
end

#sign(*args) ⇒ Object



144
145
146
147
148
149
150
151
152
# File 'lib/buildr/as3/packaging.rb', line 144

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

#with(*args) ⇒ Object



154
155
156
157
158
159
160
161
162
163
164
165
# File 'lib/buildr/as3/packaging.rb', line 154

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