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, #needed=, #needed?, #out, #reenable_chain, #shortname, #trace?
Constructor Details
#initialize(name, app) ⇒ RCTask
Returns a new instance of RCTask.
100 101 102 103 104 105 |
# File 'lib/rake/delphi/resources.rb', line 100 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.
99 100 101 |
# File 'lib/rake/delphi/resources.rb', line 99 def input @input end |
#mainicon_path ⇒ Object
Returns the value of attribute mainicon_path.
99 100 101 |
# File 'lib/rake/delphi/resources.rb', line 99 def mainicon_path @mainicon_path end |
#output ⇒ Object
Returns the value of attribute output.
99 100 101 |
# File 'lib/rake/delphi/resources.rb', line 99 def output @output end |
Instance Method Details
#execute(args = nil) ⇒ Object
125 126 127 128 129 130 131 132 133 134 135 136 137 138 |
# File 'lib/rake/delphi/resources.rb', line 125 def execute(args=nil) super 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
116 117 118 119 120 121 122 123 |
# File 'lib/rake/delphi/resources.rb', line 116 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
112 113 114 |
# File 'lib/rake/delphi/resources.rb', line 112 def is_rc=(value) @is_rc = ! value.to_s.empty? end |