Skip to content

Commit

Permalink
Adding Lazarus package generator
Browse files Browse the repository at this point in the history
  • Loading branch information
rlebeau committed Apr 26, 2024
1 parent 13cd81d commit ae0d033
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Builder/Package Generator/Package.pas
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ function iif(ATest: Boolean; const ATrue: Boolean; const AFalse: Boolean): Boole
IndyVersion_Major = 10;
IndyVersion_Minor = 6;
IndyVersion_Release = 3;
IndyVersion_Build = 1;
IndyVersion_Build = 2;

implementation

Expand Down
10 changes: 5 additions & 5 deletions Builder/Package Generator/PackageProtocols.pas
Original file line number Diff line number Diff line change
Expand Up @@ -392,24 +392,24 @@ procedure TPackageProtocols.GenerateRC(ACompiler: TCompiler; const AFlags: TGene
FDesc := 'Protocols Run-Time';

FExt := '.rc.tmpl';
inherited GenerateRC(ACompiler, AFlags - [gfDesignTime] + [gfTemplate]);
inherited GenerateRC(ACompiler, LFlags - [gfDesignTime] + [gfTemplate]);
WriteFile;

FExt := '.rc';
inherited GenerateRC(ACompiler, AFlags - [gfDesignTime, gfTemplate]);
inherited GenerateRC(ACompiler, LFlags - [gfDesignTime, gfTemplate]);
WriteFile;
end;

if gfDesignTime in AFlags then begin
if gfDesignTime in LFlags then begin
FName := 'dclIndyProtocols' + GCompilerID[ACompiler];
FDesc := 'Protocols Design-Time';

FExt := '.rc.tmpl';
inherited GenerateRC(ACompiler, AFlags - [gfRunTime] + [gfTemplate]);
inherited GenerateRC(ACompiler, LFlags - [gfRunTime] + [gfTemplate]);
WriteFile;

FExt := '.rc';
inherited GenerateRC(ACompiler, AFlags - [gfRunTime, gfTemplate]);
inherited GenerateRC(ACompiler, LFlags - [gfRunTime, gfTemplate]);
WriteFile;
end;
end;
Expand Down
18 changes: 11 additions & 7 deletions Builder/Package Generator/PackageVersInc.pas
Original file line number Diff line number Diff line change
Expand Up @@ -144,29 +144,33 @@ procedure TVersInc.Generate(ACompiler: TCompiler; const AFlags: TGenerateFlags);
procedure TVersInc.GenIdVers;
var
FileVersion : string;
BuildStr: String;
MajorStr, MinorStr, ReleaseStr, BuildStr: String;
begin
FCode.Clear;

MajorStr := IntToStr(IndyVersion_Major);
MinorStr := IntToStr(IndyVersion_Minor);
ReleaseStr := IntToStr(IndyVersion_Release);

if FTemplate then
BuildStr := '$WCREV$'
else
BuildStr := IntToStr(IndyVersion_Build);

FileVersion := FProductVersion + '.' + BuildStr;

Code(' gsIdVersionMajor = ' + IntToStr(IndyVersion_Major) + ';');
Code(' gsIdVersionMajor = ' + MajorStr + ';');
Code(' {$NODEFINE gsIdVersionMajor}');
Code(' gsIdVersionMinor = ' + IntToStr(IndyVersion_Minor) + ';');
Code(' gsIdVersionMinor = ' + MinorStr + ';');
Code(' {$NODEFINE gsIdVersionMinor}');
Code(' gsIdVersionRelease = ' + IntToStr(IndyVersion_Release) + ';');
Code(' gsIdVersionRelease = ' + ReleaseStr + ';');
Code(' {$NODEFINE gsIdVersionRelease}');
Code(' gsIdVersionBuild = ' + BuildStr + ';');
Code(' {$NODEFINE gsIdVersionBuild}');
Code('');
Code(' (*$HPPEMIT ''#define gsIdVersionMajor ' + IntToStr(IndyVersion_Major) + '''*)');
Code(' (*$HPPEMIT ''#define gsIdVersionMinor ' + IntToStr(IndyVersion_Minor) + '''*)');
Code(' (*$HPPEMIT ''#define gsIdVersionRelease ' + IntToStr(IndyVersion_Release) + '''*)');
Code(' (*$HPPEMIT ''#define gsIdVersionMajor ' + MajorStr + '''*)');
Code(' (*$HPPEMIT ''#define gsIdVersionMinor ' + MinorStr + '''*)');
Code(' (*$HPPEMIT ''#define gsIdVersionRelease ' + ReleaseStr + '''*)');
Code(' (*$HPPEMIT ''#define gsIdVersionBuild ' + BuildStr + '''*)');
Code(' (*$HPPEMIT ''''*)');
Code('');
Expand Down
19 changes: 13 additions & 6 deletions Builder/Package Generator/PkgGen.dpr
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ uses
PackageBuildRes in 'PackageBuildRes.pas',
PackageVersInc in 'PackageVersInc.pas',
PackageCleanCmd in 'PackageCleanCmd.pas',
PackageLazarus in 'PackageLazarus.pas',
DModule in 'DModule.pas';

procedure Main;
Expand All @@ -114,22 +115,28 @@ begin
Exit;
end;

LDebugFlag := [];
if FindCmdLineSwitch('debugPkgs') then begin
Include(LDebugFlag, gfDebug);
end;

WriteLn('Generating Visual Studio Package...');

with TPackageVisualStudio.Create do try
Load('DotNet=True, DesignUnit=False', True);
Generate(ctDotNet);

Load('DotNet=True, DesignUnit=False', True);
Generate(ctDotNet, [gfDebug]);
Generate(ctDotNet, [gfDebug]{LDebugFlag});
finally Free; end;

// TODO: Add a package generator for FreePascal/Lazarus packages and makefiles...
WriteLn('Generating Lazarus Package...');

LDebugFlag := [];
if FindCmdLineSwitch('debugPkgs') then begin
Include(LDebugFlag, gfDebug);
end;
with TPackageLazarus.Create do try
// nothing to load from the database...
//Load('FPC=True, FPCListInPkg=True');
Generate(ctUnversioned, []{LDebugFlag});
finally Free; end;

WriteLn('Generating D8 Master Package...');

Expand Down

0 comments on commit ae0d033

Please sign in to comment.