rake-delphi 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -229,6 +229,11 @@ module Rake
229
229
  @rc_template_task[:releaseCandidate] = properties[:releaseCandidate]
230
230
  @rc_task.input = src
231
231
  @rc_task.is_rc = properties[:releaseCandidate]
232
+ mainicon_path = File.expand_path2(Rake.unquotepath(@mainicon))
233
+ @rc_task.is_main_icon = File.exists?(mainicon_path)
234
+ unless @rc_task.is_main_icon
235
+ warn "WARNING! Icon file '#{mainicon_path}' does not exists. Application icon is disabled."
236
+ end
232
237
  return unless properties[:resources_additional]
233
238
  res_add = properties[:resources_additional]
234
239
  if res_add.kind_of?(String)
@@ -95,10 +95,12 @@ module Rake
95
95
 
96
96
  class RCTask < Rake::Task
97
97
  attr_accessor :output, :input
98
+ attr_reader :is_main_icon
98
99
  def initialize(name, app)
99
100
  super
100
101
  @output = nil
101
102
  @is_rc = false
103
+ @is_main_icon = false
102
104
  end
103
105
 
104
106
  def input=(value)
@@ -110,10 +112,15 @@ module Rake
110
112
  @is_rc = ! value.to_s.empty?
111
113
  end
112
114
 
115
+ def is_main_icon=(value)
116
+ @is_main_icon = value
117
+ end
118
+
113
119
  def execute(args=nil)
114
120
  v, path, tool = RCResourceCompiler.find(true)
115
121
  a = []
116
122
  a << '/dRC' if @is_rc
123
+ a << '/dMAIN_ICON' if @is_main_icon
117
124
  a |= ['/fo', Rake.quotepath('', output), '/r', Rake.quotepath('', input) ]
118
125
  opts = { :args => a }
119
126
  opts.merge!(args)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Rake
4
4
  module Delphi
5
- VERSION = '0.0.5'
5
+ VERSION = '0.0.6'
6
6
  end
7
7
  end
@@ -20,6 +20,10 @@ module Rake
20
20
  return ! path.to_s.empty? ? "#{switch}\"#{path.to_s}\"" : ''
21
21
  end
22
22
 
23
+ def self.unquotepath(path)
24
+ return path.to_s.gsub(/^"|"$/, '')
25
+ end
26
+
23
27
  def self.ruby18?
24
28
  /^1\.8/.match(RUBY_VERSION)
25
29
  end
@@ -21,7 +21,9 @@
21
21
  #define _FILEFLAGS (VER_PRERELEASE|VER_DEBUG)
22
22
 
23
23
  LANGUAGE <%= language %>, <%= sublanguage %>
24
+ #ifdef MAIN_ICON
24
25
  MAINICON ICON <%= mainicon %>
26
+ #endif
25
27
  1 VERSIONINFO
26
28
  FILEVERSION <%= version.comma %>
27
29
  PRODUCTVERSION <%= product.comma %>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rake-delphi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: