rake-delphi 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -80,6 +80,18 @@ module Rake
80
80
  @dcc32Tool.versionInfoClass
81
81
  end
82
82
 
83
+ def dcu=(value)
84
+ # delete previously defined
85
+ @prerequisites.delete_if do |d|
86
+ if d.kind_of?(Rake::FileCreationTask)
87
+ d.name.casecmp(@dcu) == 0
88
+ end
89
+ end
90
+ @dcu = value
91
+ dcu_task = directory @dcu
92
+ enhance([dcu_task])
93
+ end
94
+
83
95
  private
84
96
  def initvars
85
97
  @exeoutput = nil
@@ -99,7 +111,7 @@ module Rake
99
111
  # for XE and above set default aliases and namespaces
100
112
  if ENV['DELPHI_VERSION'].to_i >= 14
101
113
  @aliases = 'Generics.Collections=System.Generics.Collections;Generics.Defaults=System.Generics.Defaults;WinTypes=Winapi.Windows;WinProcs=Winapi.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE'
102
- @namespaces = 'Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;System;Xml;Data;Datasnap;Web;Soap'
114
+ @namespaces = 'Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;System;Xml;Data;Datasnap;Web;Soap;Vcl'
103
115
  Logger.trace(Logger::TRACE, 'Aliases and namespaces are set for Delphi XE')
104
116
  end
105
117
  end
@@ -164,6 +176,10 @@ module Rake
164
176
  return @dcuoutput || @dcu || @_source.pathmap('%d%sdcu')
165
177
  end
166
178
 
179
+ def console?
180
+ return @console.nil? ? '' : (@console ? '-CC' : '-CG')
181
+ end
182
+
167
183
  def map
168
184
  # segments -> -GS
169
185
  # publics -> -GP
@@ -199,7 +215,7 @@ module Rake
199
215
 
200
216
  def build_args
201
217
  args = []
202
- args << build? << warnings? << hints? << quiet? << debug? << alldebuginfo << map
218
+ args << build? << console? << warnings? << hints? << quiet? << debug? << alldebuginfo << map
203
219
  args << defines << writeableconst << aliases << namespaces
204
220
  args << _source << outputs << implicitpaths
205
221
  args.flatten
@@ -217,11 +233,9 @@ module Rake
217
233
  end
218
234
  @_source = properties[:projectfile].pathmap('%X.dpr')
219
235
  src = @_source.gsub('\\', '/')
220
- dcu = src.pathmap('%d%sdcu')
221
236
  # make sure to create dir for output dcu
222
237
  # for now default is <PROJECTDIR>/dcu
223
- directory dcu
224
- enhance([dcu])
238
+ self.dcu = src.pathmap('%d%sdcu') unless @dcu
225
239
  # mainicon is usually requested by RCTemplate
226
240
  @mainicon ||= Rake.quotepath('', src.pathmap('%X.ico'))
227
241
  @rc_template_task.output = src
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Rake
4
4
  module Delphi
5
- VERSION = '0.0.8'
5
+ VERSION = '0.0.9'
6
6
  end
7
7
  end
data/test/test-delphi.rb CHANGED
@@ -31,7 +31,10 @@ private
31
31
  end
32
32
 
33
33
  bin_dir = File.dirname(exe)
34
+ dcu_dir_rel = '../../tmp/dcu'
35
+ dcu_dir = bin_dir + '/../' + dcu_dir_rel
34
36
  FileUtils.mkdir_p(bin_dir)
37
+ FileUtils.mkdir_p(dcu_dir)
35
38
  # reenable task for subsequent calls
36
39
  prepare_task = ::Rake::Task['test:prepare']
37
40
  prepare_task.reenable
@@ -39,6 +42,7 @@ private
39
42
  useresources = prepare_args[:useresources]
40
43
  prepare_args.delete(:useresources)
41
44
  prepare_args[:bin] = bin_dir
45
+ prepare_args[:dcu] = dcu_dir_rel.gsub('/', '\\')
42
46
 
43
47
  prepare_task.invoke(useresources, prepare_args)
44
48
 
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.8
4
+ version: 0.0.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: