@@ -34,13 +34,9 @@ TBuilder = class(TObject)
34
34
constructor Create(AConfigFile: String);
35
35
destructor Destroy; override;
36
36
37
- { $IFDEF UNIX}
38
37
procedure BuildCompileScriptBash ;
39
38
procedure BuildTestScriptBash ;
40
39
procedure BuildRunScriptBash ;
41
- { $ELSE}
42
- procedure BuildCompileScriptPowerShell ;
43
- { $ENDIF}
44
40
published
45
41
end ;
46
42
@@ -50,7 +46,9 @@ implementation
50
46
{ $IFDEF FPC}
51
47
fpjson
52
48
, jsonparser
49
+ { $IFDEF UNIX}
53
50
, BaseUnix
51
+ { $ENDIF}
54
52
{ $ELSE}
55
53
{ $ENDIF}
56
54
;
@@ -72,9 +70,8 @@ implementation
72
70
73
71
cBaselineBinary = ' baseline' ;
74
72
cCompilerFPC = ' fpc' ;
75
- // cCompilerDelphi = 'delphi';
73
+ cCompilerDelphi = ' delphi' ;
76
74
cSSD = ' SSD' ;
77
- // cHDD = 'HDD';
78
75
79
76
resourcestring
80
77
rsEPatternsLengthDOntMatch = ' Patterns length does not match' ;
@@ -86,7 +83,6 @@ constructor TBuilder.Create(AConfigFile: String);
86
83
configStream: TFileStream;
87
84
configJSONData: TJSONData;
88
85
begin
89
- { #todo 99 -ogcarreno : Config file must be used here }
90
86
configStream:= TFileStream.Create(AConfigFile, fmOpenRead);
91
87
try
92
88
configJSONData:= GetJSON(configStream);
@@ -154,10 +150,15 @@ procedure TBuilder.BuildCompileScriptBash;
154
150
begin
155
151
Write(GenerateProgressBar(index+1 , FConfig.Entries.Count, 50 ), lineBreak);
156
152
if not FConfig.Entries[index].Active then continue;
153
+ { $IFDEF UNIX}
157
154
if FConfig.Entries[index].Compiler <> cCompilerFPC then continue;
155
+ { $ELSE}
156
+ if FConfig.Entries[index].Compiler <> cCompilerDelphi then continue;
157
+ { $ENDIF}
158
158
// if FConfig.Entries[index].EntryBinary = cBaselineBinary then continue;
159
159
line:= line + ' function ' + FConfig.Entries[index].EntryBinary + ' () {' + LineEnding + LineEnding;
160
160
line:= line + ' echo "===== ' + FConfig.Entries[index].Name +' ======"' + LineEnding;
161
+ { $IFDEF UNIX}
161
162
if FConfig.Entries[index].HasRelease then
162
163
begin
163
164
line:= line +
@@ -188,22 +189,33 @@ procedure TBuilder.BuildCompileScriptBash;
188
189
] ) +
189
190
LineEnding;
190
191
end ;
192
+ { $ELSE}
193
+ line:= line + ' # Needs the Delphi command line stuff' + LineEnding;
194
+ { $ENDIF}
191
195
line:= line + ' echo "==========="' + LineEnding;
192
196
line:= line + ' echo' + LineEnding + LineEnding + ' }' + LineEnding + LineEnding;
193
197
end ;
194
198
line:= line + ' if [ $1 == "" ];then' + LineEnding;
195
199
for index:= 0 to Pred(FConfig.Entries.Count) do
196
200
begin
197
201
if not FConfig.Entries[index].Active then continue;
202
+ { $IFDEF UNIX}
198
203
if FConfig.Entries[index].Compiler <> cCompilerFPC then continue;
204
+ { $ELSE}
205
+ if FConfig.Entries[index].Compiler <> cCompilerDelphi then continue;
206
+ { $ENDIF}
199
207
line:= line + ' ' + FConfig.Entries[index].EntryBinary + LineEnding;
200
208
end ;
201
209
line:= line + ' else' + LineEnding;
202
210
line:= line + ' case $1 in' + LineEnding;
203
211
for index:= 0 to Pred(FConfig.Entries.Count) do
204
212
begin
205
213
if not FConfig.Entries[index].Active then continue;
214
+ { $IFDEF UNIX}
206
215
if FConfig.Entries[index].Compiler <> cCompilerFPC then continue;
216
+ { $ELSE}
217
+ if FConfig.Entries[index].Compiler <> cCompilerDelphi then continue;
218
+ { $ENDIF}
207
219
line:= line + ' ' + FConfig.Entries[index].EntryBinary + ' )' + LineEnding;
208
220
line:= line + ' ' + FConfig.Entries[index].EntryBinary + LineEnding;
209
221
line:= line + ' ;;' + LineEnding;
@@ -217,17 +229,11 @@ procedure TBuilder.BuildCompileScriptBash;
217
229
finally
218
230
FScriptStream.Free;
219
231
end ;
232
+ { $IFDEF UNIX}
220
233
FpChmod(PChar(FScriptFile), &775 );
234
+ { $ENDIF}
221
235
end ;
222
236
223
- { $IFNDEF UNIX}
224
- procedure TBuilder.BuildCompileScriptPowerShell ;
225
- begin
226
- { #todo 99 -ogcarreno : Using the command line compiler, compile the binary for Linux 64b }
227
- { #todo 99 -ogcarreno : Using scp copy the resulting binary to Linux }
228
- end ;
229
- { $ENDIF}
230
-
231
237
procedure TBuilder.BuildTestScriptBash ;
232
238
var
233
239
index: Integer;
@@ -308,7 +314,9 @@ procedure TBuilder.BuildTestScriptBash;
308
314
finally
309
315
FScriptStream.Free;
310
316
end ;
317
+ { $IFDEF UNIX}
311
318
FpChmod(PChar(FScriptFile), &775 );
319
+ { $ENDIF}
312
320
end ;
313
321
314
322
procedure TBuilder.BuildRunScriptBash ;
@@ -341,7 +349,7 @@ procedure TBuilder.BuildRunScriptBash;
341
349
FConfig.Entries[index].EntryBinary,
342
350
Format(' %s%s' , [
343
351
IncludeTrailingPathDelimiter(FConfig.ResultsFolder),
344
- FConfig.Entries[index].EntryBinary + ' -1_000_000_000-SSD .json'
352
+ FConfig.Entries[index].EntryBinary + ' -1_000_000_000-' + cSSD + ' .json'
345
353
]),
346
354
Format(' %s%s %s' , [
347
355
IncludeTrailingPathDelimiter(FConfig.BinFolder),
@@ -363,7 +371,7 @@ procedure TBuilder.BuildRunScriptBash;
363
371
],
364
372
[rfReplaceAll]
365
373
);
366
- line:= line + ' echo "-- SSD --"' + LineEnding + ' ' + tmpStr + LineEnding;
374
+ line:= line + ' echo "-- ' + cSSD + ' --"' + LineEnding + ' ' + tmpStr + LineEnding;
367
375
line:= line + ' echo "==========="' + LineEnding;
368
376
line:= line + ' echo' + LineEnding + LineEnding + ' }' + LineEnding + LineEnding;
369
377
end ;
@@ -393,7 +401,9 @@ procedure TBuilder.BuildRunScriptBash;
393
401
finally
394
402
FScriptStream.Free;
395
403
end ;
404
+ { $IFDEF UNIX}
396
405
FpChmod(PChar(FScriptFile), &775 );
406
+ { $ENDIF}
397
407
end ;
398
408
399
409
end .
0 commit comments