Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,7 @@ __recovery/
# Boss dependency manager vendor folder https://github.com/HashLoad/boss
modules/

# Indy package build output - all Full*.bat scripts emit here
/Output/

# End of https://www.gitignore.io/api/delphi
3 changes: 3 additions & 0 deletions Builder/Package Generator/Data/PkgGen.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[Settings]
LastVersion=10.7.0.0

903 changes: 664 additions & 239 deletions Builder/Package Generator/Package.pas

Large diffs are not rendered by default.

78 changes: 38 additions & 40 deletions Builder/Package Generator/PackageBuildRes.pas
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,15 @@ TBuildRes = class(TPackage)
procedure RunBuildRes;
public
constructor Create; override;
procedure Generate(ACompilers: TCompilers; const AFlags: TGenerateFlags); override;
procedure Generate(ACompilers : TCompilers; const AFlags : TGenerateFlags); override;
end;

implementation

uses
SysUtils, DModule, Windows;
SysUtils,
DModule,
Windows;

{ TBuildRes }

Expand All @@ -48,50 +50,44 @@ constructor TBuildRes.Create;
FOutputSubDir := 'Lib';
end;

procedure TBuildRes.Generate(ACompilers: TCompilers; const AFlags: TGenerateFlags);
procedure TBuildRes.Generate(ACompilers : TCompilers; const AFlags : TGenerateFlags);
var
LCompiler: TCompiler;
LCompiler : TCompiler;
LFolder : string;

procedure BuildRC(const ABase : string);
begin
Code('brcc32 "' + LFolder + '\' + PackageName(ABase, LCompiler) + '.rc"');
end;

begin
//We don't call many of the inherited Protected methods because
//those are for Packages while I'm making a unit.
//inherited;

FName := 'buildres';
FExt := '.bat';
// buildres now lives at the Packages\ root and compiles each version's .rc files
// (which were relocated into Packages\<version>\ with de-suffixed names for D6+).
FOutputSubDir := 'Packages';

FCompiler := ctUnversioned;
FCode.Clear;
FDesignTime := False;

for LCompiler := Low(TCompiler) to High(TCompiler) do begin
if LCompiler in ACompilers then begin
Code('brcc32 System\IndySystem'+GPackageVer[LCompiler]+'.rc');
end;
end;

for LCompiler := Low(TCompiler) to High(TCompiler) do begin
if LCompiler in ACompilers then begin
Code('brcc32 Core\dclIndyCore'+GPackageVer[LCompiler]+'.rc');
end;
end;

Code('brcc32 Core\IdAboutVCL.rc');
// shared design-time resource still lives with the source under Lib\Core
Code('brcc32 "..\Lib\Core\IdAboutVCL.rc"');

for LCompiler := Low(TCompiler) to High(TCompiler) do begin
if LCompiler in ACompilers then begin
Code('brcc32 Core\IndyCore'+GPackageVer[LCompiler]+'.rc');
end;
end;

for LCompiler := Low(TCompiler) to High(TCompiler) do begin
if LCompiler in ACompilers then begin
Code('brcc32 Protocols\dclIndyProtocols'+GPackageVer[LCompiler]+'.rc');
end;
end;

for LCompiler := Low(TCompiler) to High(TCompiler) do begin
if LCompiler in ACompilers then begin
Code('brcc32 Protocols\IndyProtocols'+GPackageVer[LCompiler]+'.rc');
for LCompiler := Low(TCompiler) to High(TCompiler) do
begin
if (LCompiler in ACompilers) and (GPackageFolder[LCompiler] <> '') then
begin
LFolder := GPackageFolder[LCompiler];
BuildRC('IndySystem');
BuildRC('IndyCore');
BuildRC('dclIndyCore');
BuildRC('IndyProtocols');
BuildRC('dclIndyProtocols');
end;
end;

Expand All @@ -103,15 +99,16 @@ procedure TBuildRes.Generate(ACompilers: TCompilers; const AFlags: TGenerateFlag

procedure TBuildRes.RunBuildRes;
var
LPathname: string;
LSubDir: string;
LCmdLine: string;
SI: TStartupInfo;
PI: TProcessInformation;
LExitCode: DWORD;
LPathname : string;
LSubDir : string;
LCmdLine : string;
SI : TStartupInfo;
PI : TProcessInformation;
LExitCode : DWORD;
begin
LPathname := SysUtils.IncludeTrailingPathDelimiter(DM.OutputPath);
if FOutputSubDir <> '' then begin
if FOutputSubDir <> '' then
begin
LSubDir := SysUtils.IncludeTrailingPathDelimiter(FOutputSubDir);
LPathname := LPathname + LSubDir;
end;
Expand All @@ -127,7 +124,8 @@ procedure TBuildRes.RunBuildRes;
CloseHandle(PI.hProcess);
if LExitCode <> 0 then
WriteLn('Error from ' + LSubDir + FName + FExt);
end else
end
else
begin
WriteLn('Unable to run ' + LSubDir + FName + FExt);
end;
Expand Down
107 changes: 58 additions & 49 deletions Builder/Package Generator/PackageCleanCmd.pas
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ interface
TCleanCmd = class(TPackage)
public
constructor Create; override;
procedure Generate(ACompiler: TCompiler; const AFlags: TGenerateFlags); override;
procedure Generate(ACompiler : TCompiler; const AFlags : TGenerateFlags); override;
end;

implementation
Expand All @@ -48,61 +48,68 @@ constructor TCleanCmd.Create;

type
TCleanInfo = record
ProductName: string;
Symbol: string;
FileSuffix: string;
ProductName : string;
Symbol : string;
FileSuffix : string;
end;
const
GCleanCompilers: array[TCompiler] of TCleanInfo = (
(ProductName: ''; Symbol: ''; FileSuffix: ''),
(ProductName: ''; Symbol: ''; FileSuffix: ''),
(ProductName: ''; Symbol: ''; FileSuffix: ''),
(ProductName: ''; Symbol: ''; FileSuffix: ''),
(ProductName: ''; Symbol: ''; FileSuffix: ''),
(ProductName: ''; Symbol: ''; FileSuffix: ''),
(ProductName: ''; Symbol: ''; FileSuffix: ''),
(ProductName: ''; Symbol: ''; FileSuffix: ''),
(ProductName: ''; Symbol: ''; FileSuffix: ''),
(ProductName: ''; Symbol: ''; FileSuffix: ''),
(ProductName: ''; Symbol: ''; FileSuffix: ''),
(ProductName: 'Delphi 2007'; Symbol: 'D12'; FileSuffix: '2007'),
(ProductName: ''; Symbol: ''; FileSuffix: ''),
(ProductName: 'Delphi 2009'; Symbol: 'D13'; FileSuffix: '2009'),
(ProductName: ''; Symbol: ''; FileSuffix: ''),
(ProductName: ''; Symbol: ''; FileSuffix: ''),
(ProductName: ''; Symbol: ''; FileSuffix: ''),
(ProductName: 'Delphi 2010'; Symbol: 'D14'; FileSuffix: '2010'),
(ProductName: 'Delphi XE'; Symbol: 'D15'; FileSuffix: 'XE'),
(ProductName: 'Delphi XE2'; Symbol: 'D16'; FileSuffix: 'XE2'),
(ProductName: 'Delphi XE3'; Symbol: 'D17'; FileSuffix: 'XE3'),
(ProductName: 'Delphi XE4'; Symbol: 'D18'; FileSuffix: 'XE4'),
(ProductName: 'Delphi XE5'; Symbol: 'D19'; FileSuffix: 'XE5'),
(ProductName: 'Delphi XE6'; Symbol: 'D20'; FileSuffix: 'XE6'),
(ProductName: 'Delphi XE7'; Symbol: 'D21'; FileSuffix: 'XE7'),
(ProductName: 'Delphi XE8'; Symbol: 'D22'; FileSuffix: 'XE8'),
(ProductName: 'Delphi 10.0 Seattle'; Symbol: 'D23'; FileSuffix: 'Seattle'),
(ProductName: 'Delphi 10.1 Berlin'; Symbol: 'D24'; FileSuffix: 'Berlin'),
(ProductName: 'Delphi 10.2 Tokyo'; Symbol: 'D25'; FileSuffix: 'Tokyo'),
(ProductName: 'Delphi 10.3 Rio'; Symbol: 'D26'; FileSuffix: 'Rio'),
(ProductName: 'Delphi 10.4 Sydney'; Symbol: 'D27'; FileSuffix: 'Sydney'),
(ProductName: 'Delphi 11 Alexandria'; Symbol: 'D28'; FileSuffix: 'Alexandria'),
(ProductName: 'Delphi 12 Athens'; Symbol: 'D29'; FileSuffix: 'Athens'),
(ProductName: 'Delphi 13 Florence'; Symbol: 'D37'; FileSuffix: 'Florence'),
(ProductName: ''; Symbol: ''; FileSuffix: ''),
(ProductName: ''; Symbol: ''; FileSuffix: '')
);

procedure TCleanCmd.Generate(ACompiler: TCompiler; const AFlags: TGenerateFlags);
GCleanCompilers : array[TCompiler] of TCleanInfo = (
(ProductName : ''; Symbol : ''; FileSuffix : ''),
(ProductName : ''; Symbol : ''; FileSuffix : ''),
(ProductName : ''; Symbol : ''; FileSuffix : ''),
(ProductName : ''; Symbol : ''; FileSuffix : ''),
(ProductName : ''; Symbol : ''; FileSuffix : ''),
(ProductName : ''; Symbol : ''; FileSuffix : ''),
(ProductName : ''; Symbol : ''; FileSuffix : ''),
(ProductName : ''; Symbol : ''; FileSuffix : ''),
(ProductName : ''; Symbol : ''; FileSuffix : ''),
(ProductName : ''; Symbol : ''; FileSuffix : ''),
(ProductName : ''; Symbol : ''; FileSuffix : ''),
(ProductName : 'Delphi 2007'; Symbol : 'D12'; FileSuffix : '2007'),
(ProductName : ''; Symbol : ''; FileSuffix : ''),
(ProductName : 'Delphi 2009'; Symbol : 'D13'; FileSuffix : '2009'),
(ProductName : ''; Symbol : ''; FileSuffix : ''),
(ProductName : ''; Symbol : ''; FileSuffix : ''),
(ProductName : ''; Symbol : ''; FileSuffix : ''),
(ProductName : 'Delphi 2010'; Symbol : 'D14'; FileSuffix : '2010'),
(ProductName : 'Delphi XE'; Symbol : 'D15'; FileSuffix : 'XE'),
(ProductName : 'Delphi XE2'; Symbol : 'D16'; FileSuffix : 'XE2'),
(ProductName : 'Delphi XE3'; Symbol : 'D17'; FileSuffix : 'XE3'),
(ProductName : 'Delphi XE4'; Symbol : 'D18'; FileSuffix : 'XE4'),
(ProductName : 'Delphi XE5'; Symbol : 'D19'; FileSuffix : 'XE5'),
(ProductName : 'Delphi XE6'; Symbol : 'D20'; FileSuffix : 'XE6'),
(ProductName : 'Delphi XE7'; Symbol : 'D21'; FileSuffix : 'XE7'),
(ProductName : 'Delphi XE8'; Symbol : 'D22'; FileSuffix : 'XE8'),
(ProductName : 'Delphi 10.0 Seattle'; Symbol : 'D23'; FileSuffix : 'Seattle'),
(ProductName : 'Delphi 10.1 Berlin'; Symbol : 'D24'; FileSuffix : 'Berlin'),
(ProductName : 'Delphi 10.2 Tokyo'; Symbol : 'D25'; FileSuffix : 'Tokyo'),
(ProductName : 'Delphi 10.3 Rio'; Symbol : 'D26'; FileSuffix : 'Rio'),
(ProductName : 'Delphi 10.4 Sydney'; Symbol : 'D27'; FileSuffix : 'Sydney'),
(ProductName : 'Delphi 11 Alexandria'; Symbol : 'D28'; FileSuffix : 'Alexandria'),
(ProductName : 'Delphi 12 Athens'; Symbol : 'D29'; FileSuffix : 'Athens'),
(ProductName : 'Delphi 13 Florence'; Symbol : 'D37'; FileSuffix : 'Florence'),
(ProductName : ''; Symbol : ''; FileSuffix : ''),
(ProductName : ''; Symbol : ''; FileSuffix : '')
);

procedure TCleanCmd.Generate(ACompiler : TCompiler; const AFlags : TGenerateFlags);
begin
//We don't call many of the inherited Protected methods because
//those are for Packages while I'm making a unit.
//inherited;

if (GCleanCompilers[ACompiler].ProductName = '') or
(GCleanCompilers[ACompiler].Symbol = '') then Exit;
(GCleanCompilers[ACompiler].Symbol = '') then
Exit;

FName := 'Clean_' + GCleanCompilers[ACompiler].FileSuffix;
FExt := '.cmd';
// Clean scripts live in each version's Packages\<version> folder; the shared
// Computil.exe and Clean_IDE.cmd live one level up at the Packages\ root.
if GPackageFolder[ACompiler] <> '' then
begin
FOutputSubDir := 'Packages\' + GPackageFolder[ACompiler];
end;

FCompiler := ACompiler;
FCode.Clear;
Expand All @@ -111,9 +118,11 @@ procedure TCleanCmd.Generate(ACompiler: TCompiler; const AFlags: TGenerateFlags)
Code('@echo off');
Code('set DelphiProd=' + GCleanCompilers[ACompiler].ProductName);
Code('');
Code('cd /d "%~dp0"');
Comment thread
vincentparrett marked this conversation as resolved.
Outdated
Code('');
Code('if exist SetEnv.bat del SetEnv.bat');
Code('if not exist computil.exe goto NoComputil');
Code('computil Setup' + GCleanCompilers[ACompiler].Symbol);
Code('if not exist "%~dp0..\Computil.exe" goto NoComputil');
Comment thread
vincentparrett marked this conversation as resolved.
Outdated
Code('"%~dp0..\Computil.exe" Setup' + GCleanCompilers[ACompiler].Symbol);
Code('if defined ND' + GCleanCompilers[ACompiler].Symbol + ' goto RSVARS');
Code('if not exist SetEnv.bat goto NoNDD');
Code('');
Expand All @@ -126,11 +135,11 @@ procedure TCleanCmd.Generate(ACompiler: TCompiler; const AFlags: TGenerateFlags)
Code('');
Code('set logfn=Clean' + GCleanCompilers[ACompiler].Symbol + '.log');
Code('');
Code('call Clean_IDE.cmd');
Code('call "%~dp0..\Clean_IDE.cmd"');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will remove

Code('goto END');
Code('');
Code(':NoCompUtil');
Code('echo Computil.exe not found--run this batch script from the "Lib" folder of the Indy repository, recently pulled from GitHub.');
Code('echo Computil.exe not found--run this batch script from its version folder under Packages.');
Code('goto END');
Code('');
Code(':NoNDD');
Expand Down
Loading