Class: Rake::Delphi::RCTask

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

Instance Attribute Summary collapse

Attributes inherited from Task

#logger

Instance Method Summary collapse

Methods inherited from Task

#execute_base, #initialize_base, #out, #shortname, #trace?

Constructor Details

#initialize(name, app) ⇒ RCTask



99
100
101
102
103
104
# File 'lib/rake/delphi/resources.rb', line 99

def initialize(name, app)
    super
    @output = nil
    @is_rc = false
    @is_main_icon = false
end

Instance Attribute Details

#inputObject

Returns the value of attribute input.



97
98
99
# File 'lib/rake/delphi/resources.rb', line 97

def input
  @input
end

#is_main_iconObject

Returns the value of attribute is_main_icon.



98
99
100
# File 'lib/rake/delphi/resources.rb', line 98

def is_main_icon
  @is_main_icon
end

#outputObject

Returns the value of attribute output.



97
98
99
# File 'lib/rake/delphi/resources.rb', line 97

def output
  @output
end

Instance Method Details

#execute(args = nil) ⇒ Object



119
120
121
122
123
124
125
126
127
128
129
130
131
# File 'lib/rake/delphi/resources.rb', line 119

def execute(args=nil)
    v, path, tool = RCResourceCompiler.find(true)
    a = []
    a << '/dRC' if @is_rc
    a << '/dMAIN_ICON' if @is_main_icon
    a |= ['/fo', Rake.quotepath('', output), '/r', Rake.quotepath('', input) ]
    opts = { :args => a }
    opts.merge!(args)
    cmd = ([Rake.quotepath('', tool)] | opts[:args]).join(' ')
    RakeFileUtils.verbose(Logger.debug?) do
        sh cmd
    end
end

#is_rc=(value) ⇒ Object



111
112
113
# File 'lib/rake/delphi/resources.rb', line 111

def is_rc=(value)
    @is_rc = ! value.to_s.empty?
end