Skip to content

Commit 5bb2560

Browse files
committed
style: Proper indentation on automation scripts
1 parent fe60463 commit 5bb2560

File tree

2 files changed

+36
-32
lines changed

2 files changed

+36
-32
lines changed

utilities/common/utilities.data.config.pas

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ interface
3131
{ TConfig }
3232
TConfig = class(TObject)
3333
private
34-
FRootFolder: String;
35-
FEntriesFolder: String;
36-
FResultsFolder: String;
37-
FBinFolder: String;
38-
FInput: String;
39-
FHyperfine: String;
40-
FLazbuild: String;
41-
FOutputHash: String;
34+
FRootFolder: TJSONStringType;
35+
FEntriesFolder: TJSONStringType;
36+
FResultsFolder: TJSONStringType;
37+
FBinFolder: TJSONStringType;
38+
FInput: TJSONStringType;
39+
FHyperfine: TJSONStringType;
40+
FLazbuild: TJSONStringType;
41+
FOutputHash: TJSONStringType;
4242
FEntries: TEntries;
4343

4444
//procedure setFromJSON(const AJSON: TJSONStringType);
@@ -52,28 +52,28 @@ TConfig = class(TObject)
5252

5353
destructor Destroy; override;
5454

55-
property RootFolder: String
55+
property RootFolder: TJSONStringType
5656
read FRootFolder
5757
write FRootFolder;
58-
property EntriesFolder: String
58+
property EntriesFolder: TJSONStringType
5959
read FEntriesFolder
6060
write FEntriesFolder;
61-
property ResultsFolder: String
61+
property ResultsFolder: TJSONStringType
6262
read FResultsFolder
6363
write FResultsFolder;
64-
property BinFolder: String
64+
property BinFolder: TJSONStringType
6565
read FBinFolder
6666
write FBinFolder;
67-
property Input: String
67+
property Input: TJSONStringType
6868
read FInput
6969
write FInput;
70-
property Hyperfine: String
70+
property Hyperfine: TJSONStringType
7171
read FHyperfine
7272
write FHyperfine;
73-
property Lazbuild: String
73+
property Lazbuild: TJSONStringType
7474
read FLazbuild
7575
write FLazbuild;
76-
property OutputHash: String
76+
property OutputHash: TJSONStringType
7777
read FOutputHash
7878
write FOutputHash;
7979
property Entries: TEntries

utilities/script_builder/Common/scriptbuilder.common.pas

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ procedure TBuilder.BuildCompileScriptBash;
141141
var
142142
index: Integer;
143143
//entry: TEntry;
144-
line: String;
144+
line: TJSONStringType;
145145
begin
146146
FScriptFile:= IncludeTrailingPathDelimiter(FConfig.RootFolder) + cCompileBash;
147147
FScriptStream:= TFileStream.Create(FScriptFile, fmCreate);
@@ -157,7 +157,7 @@ procedure TBuilder.BuildCompileScriptBash;
157157
if FConfig.Entries[index].Compiler <> cCompilerFPC then continue;
158158
//if FConfig.Entries[index].EntryBinary = cBaselineBinary then continue;
159159
line:= line + 'function ' + FConfig.Entries[index].EntryBinary + '() {' + LineEnding + LineEnding;
160-
line:= line + 'echo "===== '+ FConfig.Entries[index].Name +' ======"' + LineEnding;
160+
line:= line + ' echo "===== '+ FConfig.Entries[index].Name +' ======"' + LineEnding;
161161
if FConfig.Entries[index].HasRelease then
162162
begin
163163
line:= line +
@@ -188,8 +188,8 @@ procedure TBuilder.BuildCompileScriptBash;
188188
] ) +
189189
LineEnding;
190190
end;
191-
line:= line + 'echo "==========="' + LineEnding;
192-
line:= line + 'echo' + LineEnding + LineEnding + '}' + LineEnding + LineEnding;
191+
line:= line + ' echo "==========="' + LineEnding;
192+
line:= line + ' echo' + LineEnding + LineEnding + '}' + LineEnding + LineEnding;
193193
end;
194194
line:= line + 'if [ $1 == "" ];then' + LineEnding;
195195
for index:= 0 to Pred(FConfig.Entries.Count) do
@@ -231,7 +231,7 @@ procedure TBuilder.BuildCompileScriptPowerShell;
231231
procedure TBuilder.BuildTestScriptBash;
232232
var
233233
index: Integer;
234-
line, tmpStr: String;
234+
line, tmpStr: TJSONStringType;
235235
begin
236236
FScriptFile:= IncludeTrailingPathDelimiter(FConfig.RootFolder) + cTestBash;
237237
FScriptStream:= TFileStream.Create(FScriptFile, fmCreate);
@@ -245,7 +245,7 @@ procedure TBuilder.BuildTestScriptBash;
245245
if not FConfig.Entries[index].Active then continue;
246246
//if FConfig.Entries[index].EntryBinary = cBaselineBinary then continue;
247247
line:= line + 'function ' + FConfig.Entries[index].EntryBinary + '() {' + LineEnding + LineEnding;
248-
line:= line + 'echo "===== '+ FConfig.Entries[index].Name +' ======"' + LineEnding;
248+
line:= line + ' echo "===== '+ FConfig.Entries[index].Name +' ======"' + LineEnding;
249249
tmpStr:= Format('%s%s %s', [
250250
IncludeTrailingPathDelimiter(FConfig.BinFolder),
251251
FConfig.Entries[index].EntryBinary,
@@ -263,22 +263,26 @@ procedure TBuilder.BuildTestScriptBash;
263263
],
264264
[rfReplaceAll]
265265
);
266-
tmpStr:= Format('%s > %s%s.output', [
266+
tmpStr:= Format(' %s > %s%s.output', [
267267
tmpStr,
268268
IncludeTrailingPathDelimiter(FConfig.ResultsFolder),
269269
FConfig.Entries[index].EntryBinary
270270
]);
271271
line:= line + tmpStr + LineEnding;
272-
tmpStr:= Format('sha256sum %s%s.output',[
272+
tmpStr:= Format(' sha256sum %s%s.output',[
273273
IncludeTrailingPathDelimiter(FConfig.ResultsFolder),
274274
FConfig.Entries[index].EntryBinary
275275
]);
276276
line:= line + tmpStr + LineEnding;
277-
line:= line + Format('echo "%s Official Output Hash"',[
277+
line:= line + Format(' echo "%s Official Output Hash"',[
278278
FConfig.OutputHash
279279
]) + LineEnding;
280-
line:= line + 'echo "==========="' + LineEnding;
281-
line:= line + 'echo' + LineEnding + LineEnding + '}' + LineEnding + LineEnding;
280+
line:= line + Format(' rm %s%s.output',[
281+
IncludeTrailingPathDelimiter(FConfig.ResultsFolder),
282+
FConfig.Entries[index].EntryBinary
283+
]) + LineEnding;
284+
line:= line + ' echo "==========="' + LineEnding;
285+
line:= line + ' echo' + LineEnding + LineEnding + '}' + LineEnding + LineEnding;
282286
end;
283287
line:= line + 'if [ $1 == "" ];then' + LineEnding;
284288
for index:= 0 to Pred(FConfig.Entries.Count) do
@@ -311,7 +315,7 @@ procedure TBuilder.BuildTestScriptBash;
311315
procedure TBuilder.BuildRunScriptBash;
312316
var
313317
index: Integer;
314-
line, tmpStr: String;
318+
line, tmpStr: TJSONStringType;
315319
begin
316320
FScriptFile:= IncludeTrailingPathDelimiter(FConfig.RootFolder) + cRunBash;
317321
FScriptStream:= TFileStream.Create(FScriptFile, fmCreate);
@@ -325,7 +329,7 @@ procedure TBuilder.BuildRunScriptBash;
325329
if not FConfig.Entries[index].Active then continue;
326330
if FConfig.Entries[index].EntryBinary = cBaselineBinary then continue;
327331
line:= line + 'function ' + FConfig.Entries[index].EntryBinary + '() {' + LineEnding + LineEnding;
328-
line:= line + 'echo "===== '+ FConfig.Entries[index].Name +' ======"' + LineEnding;
332+
line:= line + ' echo "===== '+ FConfig.Entries[index].Name +' ======"' + LineEnding;
329333
// Run for SSD
330334
tmpStr:= StringsReplace(
331335
FConfig.Hyperfine,
@@ -360,9 +364,9 @@ procedure TBuilder.BuildRunScriptBash;
360364
],
361365
[rfReplaceAll]
362366
);
363-
line:= line + 'echo "-- SSD --"' + LineEnding + tmpStr + LineEnding;
364-
line:= line + 'echo "==========="' + LineEnding;
365-
line:= line + 'echo' + LineEnding + LineEnding + '}' + LineEnding + LineEnding;
367+
line:= line + ' echo "-- SSD --"' + LineEnding + ' ' + tmpStr + LineEnding;
368+
line:= line + ' echo "==========="' + LineEnding;
369+
line:= line + ' echo' + LineEnding + LineEnding + '}' + LineEnding + LineEnding;
366370
end;
367371
line:= line + 'if [ $1 == "" ];then' + LineEnding;
368372
for index:= 0 to Pred(FConfig.Entries.Count) do

0 commit comments

Comments
 (0)