mirror of https://gitlab.com/basile.b/dexed.git
fix #56, libman, the automatic registration using DUB is broken since DUB 0.9.24
This commit is contained in:
parent
7927990d03
commit
4e89d12c6e
|
@ -297,6 +297,7 @@ var
|
||||||
nme: string = '';
|
nme: string = '';
|
||||||
msg: string;
|
msg: string;
|
||||||
pth: string;
|
pth: string;
|
||||||
|
dfn: string;
|
||||||
str: TStringList;
|
str: TStringList;
|
||||||
itf: ICEMessagesDisplay;
|
itf: ICEMessagesDisplay;
|
||||||
err: integer;
|
err: integer;
|
||||||
|
@ -363,6 +364,26 @@ begin
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
// get the description
|
||||||
|
if FileExists(pth + DirectorySeparator + 'dub.json') then
|
||||||
|
dfn := pth + DirectorySeparator + 'dub.json'
|
||||||
|
else if FileExists(pth + DirectorySeparator + 'package.json') then
|
||||||
|
dfn := pth + DirectorySeparator + 'package.json'
|
||||||
|
else if FileExists(pth + DirectorySeparator + nme + DirectorySeparator + 'dub.json') then
|
||||||
|
dfn := pth + DirectorySeparator + nme + DirectorySeparator + 'dub.json'
|
||||||
|
else if FileExists(pth + DirectorySeparator + nme + DirectorySeparator + 'package.json') then
|
||||||
|
dfn := pth + DirectorySeparator + nme + DirectorySeparator + 'package.json'
|
||||||
|
else
|
||||||
|
dfn := '';
|
||||||
|
|
||||||
|
if not dfn.fileExists or dfn.isEmpty then
|
||||||
|
begin
|
||||||
|
itf.message('error, the DUB description is not found or it has not the JSON format',
|
||||||
|
nil, amcMisc, amkErr);
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
pth := dfn.extractFileDir;
|
||||||
|
|
||||||
// build
|
// build
|
||||||
dub := TProcess.Create(nil);
|
dub := TProcess.Create(nil);
|
||||||
try
|
try
|
||||||
|
@ -393,10 +414,7 @@ begin
|
||||||
EntitiesConnector.beginUpdate;
|
EntitiesConnector.beginUpdate;
|
||||||
prj := TCEDubProject.create(nil);
|
prj := TCEDubProject.create(nil);
|
||||||
try
|
try
|
||||||
if FileExists(pth + DirectorySeparator + 'dub.json') then
|
prj.loadFromFile(dfn);
|
||||||
prj.loadFromFile(pth + DirectorySeparator + 'dub.json')
|
|
||||||
else if FileExists(pth + DirectorySeparator + 'package.json') then
|
|
||||||
prj.loadFromFile(pth + DirectorySeparator + 'package.json');
|
|
||||||
if prj.json.isNotNil and TJSONObject(prj.json).Find('targetType').isNotNil
|
if prj.json.isNotNil and TJSONObject(prj.json).Find('targetType').isNotNil
|
||||||
and (TJSONObject(prj.json).Find('targetType').AsString = 'sourceLibrary')
|
and (TJSONObject(prj.json).Find('targetType').AsString = 'sourceLibrary')
|
||||||
then
|
then
|
||||||
|
@ -431,10 +449,7 @@ begin
|
||||||
EntitiesConnector.beginUpdate;
|
EntitiesConnector.beginUpdate;
|
||||||
prj := TCEDubProject.create(nil);
|
prj := TCEDubProject.create(nil);
|
||||||
try
|
try
|
||||||
if FileExists(pth + DirectorySeparator + 'dub.json') then
|
prj.loadFromFile(dfn);
|
||||||
prj.loadFromFile(pth + DirectorySeparator + 'dub.json')
|
|
||||||
else if FileExists(pth + DirectorySeparator + 'package.json') then
|
|
||||||
prj.loadFromFile(pth + DirectorySeparator + 'package.json');
|
|
||||||
if prj.filename.isNotEmpty and (prj.binaryKind = staticlib) then
|
if prj.filename.isNotEmpty and (prj.binaryKind = staticlib) then
|
||||||
begin
|
begin
|
||||||
if ovw then
|
if ovw then
|
||||||
|
|
Loading…
Reference in New Issue