lib/rake/delphi/dcc32.rb in rake-delphi-0.0.27 vs lib/rake/delphi/dcc32.rb in rake-delphi-0.0.28
- old
+ new
@@ -219,10 +219,34 @@
args << _defines << _writeableconst << _aliases << _namespaces
args << _source << outputs << implicitpaths
args.flatten
end
+ def add_resources(src, properties)
+ return unless properties[:resources_additional]
+ res_add = properties[:resources_additional]
+ if res_add.kind_of?(String)
+ res_add = res_add.split(';')
+ end
+ c = 0
+ res_add.each do |res|
+ if res.kind_of?(Symbol)
+ rc_task_add = res
+ else
+ c = c.next
+ rc_task_add = application.define_task(RCTask, shortname + ':rc:add' + c.to_s)
+ input, output = res.split(':', 2)
+ rc_task_add.input = src.pathmap('%d%s') + input
+ if output
+ # if extension is present set it to output
+ rc_task_add.output = rc_task_add.output.pathmap('%d%s') + output
+ end
+ end
+ enhance([rc_task_add])
+ end
+ end
+
public
def dpr
@_source
end
@@ -247,25 +271,11 @@
@rc_template_task[:version] = properties[:version]
@rc_template_task[:releaseCandidate] = properties[:releaseCandidate]
@rc_task.input = src
@rc_task.is_rc = properties[:releaseCandidate]
@rc_task.mainicon_path = @mainicon
- return unless properties[:resources_additional]
- res_add = properties[:resources_additional]
- if res_add.kind_of?(String)
- res_add = res_add.split(';')
- end
- c = 0
- res_add.each do |res|
- if res.kind_of?(Symbol)
- rc_task_add = res
- else
- c = c.next
- rc_task_add = application.define_task(RCTask, shortname + ':rc:add' + c.to_s)
- rc_task_add.input = src.pathmap('%d%s') + res
- end
- enhance([rc_task_add])
- end
+
+ add_resources(src, properties)
end
def init_libs(libs = nil)
unless libs
# call parent to find libs