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.
- data/lib/rake/delphi/dcc32.rb +19 -5
- data/lib/rake/delphi/version.rb +1 -1
- data/test/test-delphi.rb +4 -0
- metadata +1 -1
data/lib/rake/delphi/dcc32.rb
CHANGED
@@ -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
|
-
|
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
|
data/lib/rake/delphi/version.rb
CHANGED
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
|
|