Class: Rake::Delphi::RCTask
Instance Attribute Summary collapse
-
#input ⇒ Object
Returns the value of attribute input.
-
#mainicon_path ⇒ Object
Returns the value of attribute mainicon_path.
-
#output ⇒ Object
Returns the value of attribute output.
Attributes inherited from Task
Instance Method Summary collapse
- #execute(args = nil) ⇒ Object
-
#initialize(name, app) ⇒ RCTask
constructor
A new instance of RCTask.
- #is_main_icon ⇒ Object
- #is_rc=(value) ⇒ Object
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 @main_icon_path = nil end |
Instance Attribute Details
#input ⇒ Object
Returns the value of attribute input.
98 99 100 |
# File 'lib/rake/delphi/resources.rb', line 98 def input @input end |
#mainicon_path ⇒ Object
Returns the value of attribute mainicon_path.
98 99 100 |
# File 'lib/rake/delphi/resources.rb', line 98 def mainicon_path @mainicon_path end |
#output ⇒ Object
Returns the value of attribute output.
98 99 100 |
# File 'lib/rake/delphi/resources.rb', line 98 def output @output end |
Instance Method Details
#execute(args = nil) ⇒ Object
124 125 126 127 128 129 130 131 132 133 134 135 136 |
# File 'lib/rake/delphi/resources.rb', line 124 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_main_icon ⇒ Object
115 116 117 118 119 120 121 122 |
# File 'lib/rake/delphi/resources.rb', line 115 def is_main_icon mainicon_path_unquoted = File.(Rake.unquotepath(@mainicon_path), '-ml') is_main_icon = File.exists?(mainicon_path_unquoted) unless is_main_icon warn "WARNING! Icon file '#{mainicon_path_unquoted}' does not exists. Application icon is disabled." end return is_main_icon 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 |