Class: Rake::Delphi::AndroidManifestTask

Inherits:
Task
  • Object
show all
Defined in:
lib/rake/delphi/androidmanifest.rb

Instance Attribute Summary collapse

Attributes inherited from Task

#logger

Instance Method Summary collapse

Methods inherited from Task

#execute_base, #initialize_base, #needed=, #needed?, #out, #reenable_chain, #shortname, #trace?

Constructor Details

#initialize(name, application) ⇒ AndroidManifestTask

Returns a new instance of AndroidManifestTask.



33
34
35
36
37
38
39
# File 'lib/rake/delphi/androidmanifest.rb', line 33

def initialize(name, application)
  super
  self.needed = false
  @template = 'AndroidManifest.erb'
  @output = 'AndroidManifest.xml'
  @template_obj = AndroidManifestInfo.new(self)
end

Instance Attribute Details

#dccTaskObject (readonly)

Returns the value of attribute dccTask.



31
32
33
# File 'lib/rake/delphi/androidmanifest.rb', line 31

def dccTask
  @dccTask
end

#outputObject (readonly)

Returns the value of attribute output.



31
32
33
# File 'lib/rake/delphi/androidmanifest.rb', line 31

def output
  @output
end

Instance Method Details

#execute(args = nil) ⇒ Object



41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/rake/delphi/androidmanifest.rb', line 41

def execute(args = nil)
  super
  paclientTaskName = name.gsub(/:manifest$/, '')
  @dccTask = application[paclientTaskName].dccTask
  ChDir.new(self, File.dirname(@dccTask.dpr)) do |dir|
    RakeFileUtils.verbose(Logger.debug?) do
      erb = ERB.new(IO.read(@template))
      text = erb.result(@template_obj.get_binding)
      File.open(@output, 'w') do |f|
        f.write(text)
      end
    end
  end
end