Skip to content

Commit 9174964

Browse files
committed
feat: Now can use trunk lazbuild
1 parent a2c9da6 commit 9174964

File tree

4 files changed

+25
-2
lines changed

4 files changed

+25
-2
lines changed

entries/entries.json.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"name": "Official Baseline",
1414
"notes": "Beeing the last of all",
1515
"compiler": "fpc",
16+
"use-trunk": false,
1617
"entry-folder": "../baseline/Lazarus/src",
1718
"entry-binary": "baseline",
1819
"lpi": "baseline.lpi",
@@ -26,6 +27,7 @@
2627
"name": "Gustavo Carreno",
2728
"notes": "Using 30 threads",
2829
"compiler": "fpc",
30+
"use-trunk": false,
2931
"entry-folder": "gcarreno/src",
3032
"entry-binary": "gcarreno",
3133
"lpi": "gcarreno.lpi",

utilities/common/utilities.data.config.pas

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ TConfig = class(TObject)
4646
FHyperfine: TJSONStringType;
4747

4848
FLazbuild: TJSONStringType;
49+
FLazbuildTrunk: TJSONStringType;
4950
FDelphiCompiler: TJSONStringType;
5051

5152
FOutputHash: TJSONStringType;
@@ -95,6 +96,9 @@ TConfig = class(TObject)
9596
property Lazbuild: TJSONStringType
9697
read FLazbuild
9798
write FLazbuild;
99+
property LazbuildTrunk: TJSONStringType
100+
read FLazbuildTrunk
101+
write FLazbuildTrunk;
98102
property DelphiCompiler: TJSONStringType
99103
read FDelphiCompiler
100104
write FDelphiCompiler;
@@ -120,6 +124,7 @@ implementation
120124
cJSONInput = 'input';
121125
cJSONHyperfine = 'hyperfine';
122126
cJSONLazbuild = 'lazbuild';
127+
cJSONLazbuildTrunk = 'lazbuild-trunk';
123128
cJSONDelphiCompiler = 'delphi-compiler';
124129
cJSONOutpuHash = 'output-hash';
125130
cJSONEntries = 'entries';
@@ -144,6 +149,7 @@ constructor TConfig.Create;
144149
FInput:= '';
145150
FHyperfine:= '';
146151
FLazbuild:= '';
152+
FLazbuildTrunk:= '';
147153
FDelphiCompiler:= '';
148154
FOutputHash:= '';
149155
end;
@@ -187,6 +193,7 @@ procedure TConfig.setFromJSONObject(const AJSONObject: TJSONObject);
187193
FHyperfine:= AJSONObject.Get(cJSONHyperfine, FHyperfine);
188194

189195
FLazbuild:= AJSONObject.Get(cJSONLazbuild, FLazbuild);
196+
FLazbuildTrunk:= AJSONObject.Get(cJSONLazbuildTrunk, FLazbuildTrunk);
190197
FDelphiCompiler:= AJSONObject.Get(cJSONDelphiCompiler, FDelphiCompiler);
191198

192199
FOutputHash:= AJSONObject.Get(cJSONOutpuHash, FOutputHash);

utilities/common/utilities.data.entries.pas

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ TEntry = class(TObject)
3737
FName: TJSONStringType;
3838
FNotes: TJSONStringType;
3939
FCompiler: TJSONStringType;
40+
FUseTrunk: Boolean;
4041
FEntryFolder: TJSONStringType;
4142
FEntryBinary: TJSONStringType;
4243
FLPI: TJSONStringType;
@@ -68,6 +69,9 @@ TEntry = class(TObject)
6869
property Compiler: TJSONStringType
6970
read FCompiler
7071
write FCompiler;
72+
property UseTrunk: Boolean
73+
read FUseTrunk
74+
write FUseTrunk;
7175
property EntryFolder: TJSONStringType
7276
read FEntryFolder
7377
write FEntryFolder;
@@ -146,6 +150,7 @@ implementation
146150
cJSONName = 'name';
147151
cJSONNotes = 'notes';
148152
cJSONCompiler = 'compiler';
153+
cJSONUseTrunk = 'use-trunk';
149154
cJSONEntryFolder = 'entry-folder';
150155
cJSONEntryBinary = 'entry-binary';
151156
cJSONLPI = 'lpi';
@@ -169,6 +174,7 @@ constructor TEntry.Create;
169174
FName:= '';
170175
FNotes:= '';
171176
FCompiler:= '';
177+
FUseTrunk:= False;
172178
FEntryFolder:= '';
173179
FEntryBinary:= '';
174180
FLPI:= '';
@@ -204,6 +210,7 @@ procedure TEntry.setFromJSONObject(const AJSONObject: TJSONObject);
204210
FName:= AJSONObject.Get(cJSONName, FName);
205211
FNotes:= AJSONObject.Get(cJSONNotes, FNotes);
206212
FCompiler:= AJSONObject.Get(cJSONCompiler, FCompiler);
213+
FUseTrunk:= AJSONObject.Get(cJSONUseTrunk, FUseTrunk);
207214
FEntryFolder:= AJSONObject.Get(cJSONEntryFolder, FEntryFolder);
208215
FEntryBinary:= AJSONObject.Get(cJSONEntryBinary, FEntryBinary);
209216
FLPI:= AJSONObject.Get(cJSONLPI, FLPI);

utilities/script_builder/Common/scriptbuilder.common.pas

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,15 +171,22 @@ function TBuilder.GetVariablesBash: String;
171171
end;
172172

173173
function TBuilder.GetFunctionCompileBash(const AEntry: TEntry): String;
174+
var
175+
lazbuild: String;
174176
begin
175177
Result:= 'function ' + AEntry.EntryBinary + '() {' + LineEnding;
176178
Result:= Result + ' echo "===== '+ UTF8Encode(AEntry.Name) +' ======"' + LineEnding;
177179
{$IFDEF UNIX}
180+
if AEntry.UseTrunk then
181+
lazbuild:= FConfig.LazbuildTrunk
182+
else
183+
lazbuild:= FConfig.Lazbuild;
184+
178185
if AEntry.HasRelease then
179186
begin
180187
Result:= Result + ' ' +
181188
Format(cLazbuildRelease, [
182-
FConfig.Lazbuild,
189+
lazbuild,
183190
'${ENTRIES}/' + AEntry.EntryFolder + '/' + AEntry.LPI
184191
] ) +
185192
LineEnding;
@@ -188,7 +195,7 @@ function TBuilder.GetFunctionCompileBash(const AEntry: TEntry): String;
188195
begin
189196
Result:= Result + ' ' +
190197
Format(cLazbuildDefault, [
191-
FConfig.Lazbuild,
198+
lazbuild,
192199
'${ENTRIES}/' + AEntry.EntryFolder + '/' + AEntry.LPI
193200
] ) +
194201
LineEnding;

0 commit comments

Comments
 (0)