Skip to content

Commit 2ecacb8

Browse files
Chasing random av
1 parent 636990f commit 2ecacb8

64 files changed

Lines changed: 764 additions & 1582 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,5 @@ Packages
6868
Source/DSpecCreator/__recovery
6969
*.user
7070
*.dll
71+
__recovery
72+
*.jdbg

Build/BuildDPM.fbp8

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@ begin
1919
propertysetname = DPMVersion
2020
propertyset.win32.info
2121
begin
22+
legalcopyright = "© 2019 -2025 Vincent Parrett and Contributors"
23+
linkproductversion = false
24+
minorversion = 2
2225
name = DPMVersion
23-
productversion = 0.0.0.0
26+
productname = "DPM IDE Support for Delphi12"
2427
productversionstring = 0.2.0-alpha
2528
end
2629
end
@@ -89,7 +92,7 @@ begin
8992
end
9093
action.group
9194
begin
92-
description = "Build Tests - 11.0"
95+
description = "Build Tests - 12.0"
9396
id = {6BFDB7C5-1968-4220-9E27-9899822374AA}
9497
action.continua.set-buildstatus
9598
begin
@@ -117,7 +120,7 @@ begin
117120
terminateontimeout = true
118121
timeoutlength = 2
119122
as.projectpath = %SRC_ROOT%\\DPM.Core.Tests.dproj
120-
as.compilerversion = 11.0
123+
as.compilerversion = 12.0
121124
as.verbosity = Debug
122125
as.nobanner = True
123126
end
@@ -135,7 +138,7 @@ begin
135138
compileridl = true
136139
configname = Release
137140
debugversionnumbers = false
138-
delphiversion = Delphi11
141+
delphiversion = Delphi12
139142
enabletimeout = false
140143
eurekalogverboselogging = false
141144
frameworktype = VCL
@@ -357,7 +360,7 @@ begin
357360
terminateontimeout = true
358361
timeoutlength = 2
359362
as.projectpath = %SRC_ROOT%\\dpm.dproj
360-
as.compilerversion = 11.0
363+
as.compilerversion = 12.0
361364
as.verbosity = Debug
362365
as.nobanner = True
363366
end
@@ -375,7 +378,7 @@ begin
375378
compileridl = true
376379
configname = Release
377380
debugversionnumbers = false
378-
delphiversion = Delphi11
381+
delphiversion = Delphi12
379382
enabletimeout = false
380383
eurekalogverboselogging = false
381384
frameworktype = VCL
@@ -415,8 +418,8 @@ begin
415418
usepropertyset = true
416419
useversionfromdof = false
417420
verboseoutput = false
418-
versioninfokeys = "LegalCopyright\=© 2019 -2024 Vincent Parrett and Contributors" +
419-
"ProductName\=DPM Package Manager" +
421+
versioninfokeys = "LegalCopyright\=© 2019 -2025 Vincent Parrett and Contributors" +
422+
"ProductName\=DPM Package Manager Command Line Tool" +
420423
"ProductVersion\=0.2.0-alpha" +
421424
""
422425
versioninfopropertysetname = DPMVersion
@@ -616,7 +619,7 @@ begin
616619
terminateontimeout = true
617620
timeoutlength = 2
618621
as.projectpath = %SRC_ROOT%\\DSpecCreator\\DspecCreator.dproj
619-
as.compilerversion = 11.0
622+
as.compilerversion = 12.0
620623
as.verbosity = Debug
621624
as.nobanner = True
622625
end
@@ -635,7 +638,7 @@ begin
635638
configname = Release
636639
customvclstyles = C:\\Users\\Public\\Documents\\Embarcadero\\Studio\\22.0\\Styles\\Windows10.vsf
637640
debugversionnumbers = false
638-
delphiversion = Delphi11
641+
delphiversion = Delphi12
639642
enabletimeout = false
640643
eurekalogverboselogging = false
641644
frameworktype = VCL
@@ -657,7 +660,7 @@ begin
657660
manifestfile = %SRC_ROOT%\\dpmManifest.xml
658661
minorversion = 2
659662
noconfig = false
660-
platform = Win32
663+
platform = Win64
661664
platformsdktype = ProjectSDK
662665
projectfile = %SRC_ROOT%\\DSpecCreator\\DspecCreator.dpr
663666
regenerateresource = true
@@ -675,7 +678,7 @@ begin
675678
usepropertyset = true
676679
useversionfromdof = false
677680
verboseoutput = false
678-
versioninfokeys = "LegalCopyright\=© 2019 -2024 Vincent Parrett and Contributors" +
681+
versioninfokeys = "LegalCopyright\=© 2019 -2025 Vincent Parrett and Contributors" +
679682
"ProductName\=DSpec Creator for DPM Package Manager" +
680683
"ProductVersion\=0.2.0-alpha" +
681684
""
@@ -728,7 +731,7 @@ begin
728731
mapfile = 0
729732
maxstacksize = 1048576
730733
minstacksize = 16384
731-
namespaceprefixes = System;Xml;Data;Datasnap;Web;Soap;Winapi;System.Win;Data.Win;Web.Win;Soap.Win;Bde;
734+
namespaceprefixes = System;Xml;Data;Datasnap;Web;Soap;Winapi;System.Win;Data.Win;Web.Win;Soap.Win;
732735
openstrings = true
733736
optimisation = true
734737
outputdir = %OUTPUT_DIR%
@@ -1346,7 +1349,7 @@ begin
13461349
terminateontimeout = true
13471350
timeoutlength = 2
13481351
as.projectpath = %SRC_ROOT%\\%ProjectFile%oj
1349-
as.compilerversion = XE7
1352+
as.compilerversion = 12
13501353
as.verbosity = Debug
13511354
as.nobanner = True
13521355
action.script
@@ -1374,7 +1377,7 @@ begin
13741377
compileridl = true
13751378
configname = Release
13761379
debugversionnumbers = false
1377-
delphiversion = DelphiXE7
1380+
delphiversion = Delphi12
13781381
enabletimeout = false
13791382
eurekalogverboselogging = false
13801383
frameworktype = VCL
@@ -1395,7 +1398,7 @@ begin
13951398
manifestfile = %SRC_ROOT%\\dpmManifest.xml
13961399
minorversion = 2
13971400
noconfig = false
1398-
platform = Win32
1401+
platform = Win64
13991402
platformsdktype = ProjectSDK
14001403
projectfile = %SRC_ROOT%\\%ProjectFile%
14011404
regenerateresource = true
@@ -1413,8 +1416,8 @@ begin
14131416
usepropertyset = true
14141417
useversionfromdof = false
14151418
verboseoutput = false
1416-
versioninfokeys = "LegalCopyright\=© 2019 -2024 Vincent Parrett and Contributors" +
1417-
"ProductName\=DPM IDE Support for DelphiXE7" +
1419+
versioninfokeys = "LegalCopyright\=© 2019 -2025 Vincent Parrett and Contributors" +
1420+
"ProductName\=DPM IDE Support for Delphi12" +
14181421
"ProductVersion\=0.2.0-alpha" +
14191422
""
14201423
versioninfopropertysetname = DPMVersion

Source/Core/Cache/DPM.Core.Cache.Interfaces.pas

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
interface
3030

3131
uses
32-
VSoft.Awaitable,
32+
VSoft.CancellationToken,
3333
DPM.Core.Types,
3434
DPM.Core.Package.Interfaces,
3535
DPM.Core.Manifest.Interfaces;
@@ -55,7 +55,7 @@ interface
5555
//then it will call InstallPackage to extract it.
5656
function EnsurePackage(const packageId : IPackageIdentity) : boolean;
5757

58-
function InstallPackageFromFile(const packageFileName : string; const saveFile : boolean) : boolean;
58+
function InstallPackageFromFile(const packageFileName : string) : boolean;
5959

6060
//gets the package info with dependencies. Calls EnsurePackage.
6161
function GetPackageInfo(const cancellationToken : ICancellationToken; const packageId : IPackageIdentity) : IPackageInfo;

Source/Core/Cache/DPM.Core.Cache.pas

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
interface
3030

3131
uses
32-
VSoft.Awaitable,
32+
VSoft.CancellationToken,
3333
DPM.Core.Types,
3434
DPM.Core.Logging,
3535
DPM.Core.Package.Interfaces,
@@ -65,7 +65,7 @@ TPackageCache = class(TInterfacedObject, IPackageCache)
6565

6666
// function InstallPackage(const packageId : IPackageIdentity; const saveFile : boolean; const source : string = '') : boolean;
6767

68-
function InstallPackageFromFile(const packageFileName : string; const saveFile : boolean) : boolean;
68+
function InstallPackageFromFile(const packageFileName : string) : boolean;
6969

7070
public
7171
constructor Create(const logger : ILogger; const manifestReader : IPackageManifestReader);
@@ -80,6 +80,7 @@ implementation
8080
System.RegularExpressions,
8181
DPM.Core.Constants,
8282
DPM.Core.Package.Classes,
83+
DPM.Core.Utils.System,
8384
DPM.Core.Utils.Strings;
8485

8586
{ TPackageCache }
@@ -215,20 +216,20 @@ function TPackageCache.EnsurePackage(const packageId : IPackageIdentity) : Boole
215216
//ok, if we still have the file, try install it again.
216217
packageFileName := IncludeTrailingPathDelimiter(packagesFolder) + packageId.ToString + cPackageFileExt;
217218
if FileExists(packageFileName) then
218-
result := InstallPackageFromFile(packageFileName, true)
219+
result := InstallPackageFromFile(packageFileName)
219220
end;
220221
end;
221222

222223

223-
function TPackageCache.InstallPackageFromFile(const packageFileName : string; const saveFile : boolean) : boolean;
224+
function TPackageCache.InstallPackageFromFile(const packageFileName : string) : boolean;
224225
var
225226
packageFilePath : string;
226227
fileName : string;
227228
packageIndentity : IPackageIdentity;
228229
packageFolder : string;
229230
begin
230231
result := false;
231-
// FLogger.Debug('[PackageCache] installing from file : ' + packageFileName);
232+
FLogger.Debug('[PackageCache] installing from file : ' + packageFileName);
232233
if not FileExists(packageFileName) then
233234
begin
234235
FLogger.Error('Package File [' + packageFileName + '] does not exist');
@@ -248,32 +249,32 @@ function TPackageCache.InstallPackageFromFile(const packageFileName : string; co
248249

249250
//creates the folder
250251
packageFolder := CreatePackagePath(packageIndentity);
252+
FLogger.Debug('[PackageCache] PackageFolder : ' + packageFolder);
251253

252-
if saveFile then
254+
if (not TStringUtils.StartsWith(packageFileName, GetPackagesFolder)) then
253255
begin
254-
if (not TStringUtils.StartsWith(packageFileName, GetPackagesFolder)) then
255-
begin
256-
packageFilePath := GetPackagesFolder + PathDelim + ExtractFileName(packageFileName);
257-
try
258-
TFile.Copy(packageFileName, packageFilePath, true);
259-
except
260-
on e : Exception do
261-
begin
262-
FLogger.Error('Unable to copy file [' + packageFileName + '] to the package cache');
263-
FLogger.Error(e.Message);
264-
exit;
265-
end;
256+
packageFilePath := GetPackagesFolder + PathDelim + ExtractFileName(packageFileName);
257+
FLogger.Debug('[PackageCache] Copying Package file to : ' + packageFilePath);
258+
259+
try
260+
TFile.Copy(packageFileName, packageFilePath, true);
261+
except
262+
on e : Exception do
263+
begin
264+
265+
FLogger.Error('Unable to copy file [' + packageFileName + '] to the package cache');
266+
FLogger.Error(e.Message);
267+
exit;
266268
end;
267-
end
268-
else
269-
packageFilePath := packageFileName;
269+
end;
270270
end
271271
else
272272
packageFilePath := packageFileName;
273273

274274
//work with packageFilePath now.
275275

276276
try
277+
FLogger.Debug('[PackageCache] Extracting Package file [' + packageFilePath + '] to : ' + packageFolder);
277278
TZipFile.ExtractZipFile(packageFilePath, packageFolder);
278279
result := FileExists(IncludeTrailingPathDelimiter(packageFolder) + cPackageManifestFile);
279280
if not result then
@@ -284,6 +285,7 @@ function TPackageCache.InstallPackageFromFile(const packageFileName : string; co
284285
except
285286
on e : exception do
286287
begin
288+
FLogger.Debug('[PackageCache] Error Extracting Package file : ' + e.Message);
287289
TDirectory.Delete(packageFolder, true); //just empties it but doesn't delete?
288290
if not RemoveDir(packageFolder) then
289291
begin

Source/Core/Compiler/DPM.Core.Compiler.MSBuild.pas

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ function TMSBuildCompiler.BuildProject(const cancellationToken : ICancellationTo
109109
commandLine : string;
110110
env : IEnvironmentBlock;
111111
i : integer;
112+
exitCode : Cardinal;
112113
begin
113114

114115
result := false;
@@ -141,21 +142,22 @@ function TMSBuildCompiler.BuildProject(const cancellationToken : ICancellationTo
141142
env.AddOrSet('ImportEnvOptions','false');
142143
FLogger.Debug('Compler - cmdline : ' + commandLine);
143144
try
144-
result := TProcess.Execute2(cancellationToken, 'cmd.exe', commandLine,'',env) = 0;
145+
exitCode := TProcess.Execute2(cancellationToken, 'cmd.exe', commandLine,'',env);
145146
except
146147
on e : Exception do
147148
begin
148149
FLogger.Error('Error executing compiler : ' + e.Message);
149150
exit;
150151
end;
151152
end;
152-
153+
result := exitCode = 0;
154+
if not result then
155+
FLogger.Error('Package compilation failed - exit code : ' + IntToStr(exitCode));
153156
//TODO : Doesn't give realtime feedback, remove when we have a CreateProcess version of TProcess.
154157
if TFile.Exists(FCompilerLogFile) then
155158
begin
156159
if not result then
157160
begin
158-
FLogger.Error('Package compilation failed.');
159161
FCompilerOutput.LoadFromFile(FCompilerLogFile);
160162
for i := 0 to FCompilerOutput.Count -1 do
161163
FLogger.Information(FCompilerOutput.Strings[i]);

Source/Core/DPM.Core.Types.pas

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,10 @@ interface
6060
RS10_3,
6161
RS10_4,
6262
RS11_0,
63-
RS12_0
63+
RS12_0//,
64+
65+
66+
// RS_MAX = RS12_0 //not sure if this won't cause problems
6467
);
6568

6669
TCompilerVersions = set of TCompilerVersion;

Source/Core/Dependency/DPM.Core.Dependency.Context.pas

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ TResolverContext = class(TInterfacedObject, IResolverContext)
9090
public
9191
constructor Create(const logger : ILogger; const packageInstallerContext : IPackageInstallerContext; const projectFile : string; const newPackage : IPackageInfo; const projectReferences : IList<IPackageReference>);overload;
9292
constructor Create(const logger : ILogger; const packageInstallerContext : IPackageInstallerContext; const projectFile : string; const compilerVersion : TCompilerVersion; const platform : TDPMPlatform; const projectReferences : IList<IPackageReference>);overload;
93+
destructor Destroy;override;
9394
end;
9495

9596

@@ -166,6 +167,7 @@ constructor TResolverContext.Create(const logger: ILogger; const packageInstalle
166167
end;
167168

168169
begin
170+
inherited Create;
169171
FCompilerVersion := compilerVersion;
170172
FPlatform := platform;
171173
FLogger := logger;
@@ -191,6 +193,17 @@ constructor TResolverContext.Create(const logger: ILogger; const packageInstalle
191193

192194
end;
193195

196+
destructor TResolverContext.Destroy;
197+
begin
198+
FLogger := nil;
199+
FPackageInstallerContext := nil;
200+
FNoGoods := nil;
201+
FResolved := nil;
202+
FOpenRequirements := nil;
203+
FVersionCache := nil;
204+
inherited;
205+
end;
206+
194207
constructor TResolverContext.Create(const logger : ILogger; const packageInstallerContext : IPackageInstallerContext; const projectFile : string; const newPackage : IPackageInfo; const projectReferences : IList<IPackageReference>);
195208
begin
196209
Assert(newPackage <> nil);

Source/Core/Dependency/DPM.Core.Dependency.Interfaces.pas

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,8 @@ interface
194194
['{B187F0DB-FEA1-48B4-81F2-CECF073C2FB0}']
195195
function Initialize(const config : IConfiguration) : boolean;
196196
//returns true if all dependencies were resolved. If true, the graph is fully populated and can be serialized.
197-
function ResolveForInstall(const cancellationToken : ICancellationToken; const compilerVersion : TCompilerVersion; const platform : TDPMPlatform; const projectFile : string; const options : TSearchOptions; const newPackage : IPackageInfo; const projectReferences : IList<IPackageReference>; var dependencyGraph : IPackageReference; out resolved : IList<IPackageInfo>) : boolean;
198-
function ResolveForRestore(const cancellationToken : ICancellationToken; const compilerVersion : TCompilerVersion; const platform : TDPMPlatform; const projectFile : string; const options : TSearchOptions; const projectReferences : IList<IPackageReference>; var dependencyGraph : IPackageReference; out resolved : IList<IPackageInfo>) : boolean;
197+
function ResolveForInstall(const cancellationToken : ICancellationToken; const compilerVersion : TCompilerVersion; const platform : TDPMPlatform; const projectFile : string; const options : TSearchOptions; const newPackage : IPackageInfo; const projectReferences : IList<IPackageReference>; out dependencyGraph : IPackageReference; out resolved : IList<IPackageInfo>) : boolean;
198+
function ResolveForRestore(const cancellationToken : ICancellationToken; const compilerVersion : TCompilerVersion; const platform : TDPMPlatform; const projectFile : string; const options : TSearchOptions; const projectReferences : IList<IPackageReference>; out dependencyGraph : IPackageReference; out resolved : IList<IPackageInfo>) : boolean;
199199
end;
200200

201201

0 commit comments

Comments
 (0)