fix, DUB, rel importPaths problem

This commit is contained in:
Basile Burg 2016-03-13 22:32:26 +01:00
parent 8d6b6f8b99
commit 7915a315ee
1 changed files with 9 additions and 2 deletions

View File

@ -734,14 +734,21 @@ procedure TCEDubProject.updateImportPathsFromJson;
var
arr: TJSONArray;
item: TJSONData;
pth: string;
i: integer;
begin
item := obj.Find('importPaths');
if assigned(item) then
begin
arr := TJSONArray(item);
for i:= 0 to arr.Count-1 do
fImportPaths.Add(arr.Strings[i]);
for i := 0 to arr.Count-1 do
begin
pth := TrimRightSet(arr.Strings[i], ['/','\']);
if pth.dirExists and FilenameIsAbsolute(pth) then
fImportPaths.Add(pth)
else
fImportPaths.Add(expandFilenameEx(fBasePath, pth));
end;
end;
end;
// note: dependencies are added as import to allow DCD completion