mirror of https://gitlab.com/basile.b/dexed.git
fix #465 - Attempt to fetch DUB dependencies even if they are directly in the description
This commit is contained in:
parent
779edd9fe5
commit
e8cd2338c5
|
@ -151,6 +151,7 @@ type
|
||||||
procedure executeDub(command: TDubCommand; const runArgs: string = '');
|
procedure executeDub(command: TDubCommand; const runArgs: string = '');
|
||||||
procedure restorePersistentMetadata;
|
procedure restorePersistentMetadata;
|
||||||
procedure storePersistentMetadata;
|
procedure storePersistentMetadata;
|
||||||
|
function getSubPackage(const value: string): TJSONObject;
|
||||||
public
|
public
|
||||||
constructor create(aOwner: TComponent); override;
|
constructor create(aOwner: TComponent); override;
|
||||||
destructor destroy; override;
|
destructor destroy; override;
|
||||||
|
@ -198,6 +199,7 @@ type
|
||||||
property json: TJSONObject read fJSON;
|
property json: TJSONObject read fJSON;
|
||||||
property packageName: string read fPackageName;
|
property packageName: string read fPackageName;
|
||||||
property isSDL: boolean read fIsSdl;
|
property isSDL: boolean read fIsSdl;
|
||||||
|
property subPackage[value: string]: TJSONObject read getSubPackage;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// these 9 built types always exist
|
// these 9 built types always exist
|
||||||
|
@ -1201,6 +1203,29 @@ function TDubProject.getPersistentEnvironment: TStrings;
|
||||||
begin
|
begin
|
||||||
result := fMetaEnv;
|
result := fMetaEnv;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TDubProject.getSubPackage(const value: string): TJSONObject;
|
||||||
|
var
|
||||||
|
i: integer;
|
||||||
|
a: TJSONArray;
|
||||||
|
o: TJSONObject;
|
||||||
|
d: TJSONData;
|
||||||
|
begin
|
||||||
|
result := nil;
|
||||||
|
if value.isBlank or fJSON.isNil or not fJSON.findArray('subPackages', a) then
|
||||||
|
exit;
|
||||||
|
for i := 0 to a.Count-1 do
|
||||||
|
begin
|
||||||
|
d := a.Items[i];
|
||||||
|
if d.JSONType <> jtObject then
|
||||||
|
continue;
|
||||||
|
o := TJSONObject(d);
|
||||||
|
if not o.findAny('name', d) then
|
||||||
|
continue;
|
||||||
|
result := o;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
{$ENDREGION --------------------------------------------------------------------}
|
{$ENDREGION --------------------------------------------------------------------}
|
||||||
|
|
||||||
{$REGION JSON to internal fields -----------------------------------------------}
|
{$REGION JSON to internal fields -----------------------------------------------}
|
||||||
|
@ -1500,6 +1525,7 @@ procedure TDubProject.updateImportPathsFromJson;
|
||||||
u: PSemVer;
|
u: PSemVer;
|
||||||
i: integer;
|
i: integer;
|
||||||
k: integer;
|
k: integer;
|
||||||
|
x: integer;
|
||||||
c: TJSONObject;
|
c: TJSONObject;
|
||||||
b: TStringList;
|
b: TStringList;
|
||||||
begin
|
begin
|
||||||
|
@ -1513,6 +1539,15 @@ procedure TDubProject.updateImportPathsFromJson;
|
||||||
begin
|
begin
|
||||||
n := deps.Names[i];
|
n := deps.Names[i];
|
||||||
|
|
||||||
|
// inline sub package
|
||||||
|
x := pos(':', n);
|
||||||
|
if x > 0 then
|
||||||
|
begin
|
||||||
|
// in case something has to be done with the subpackage...
|
||||||
|
// c := subPackage[n[x .. n.length]];
|
||||||
|
continue;
|
||||||
|
end;
|
||||||
|
|
||||||
// local path specified
|
// local path specified
|
||||||
if deps.findObject(n, c) and c.findAny('path', j) then
|
if deps.findObject(n, c) and c.findAny('path', j) then
|
||||||
begin
|
begin
|
||||||
|
|
Loading…
Reference in New Issue