From 8f0c4a52adeec4472a32d5fcb8b94d8342fe17a5 Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Fri, 27 Apr 2018 10:50:35 +0200 Subject: [PATCH] DUB projects, detect dep import path from "path" property --- src/ce_dubproject.pas | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/ce_dubproject.pas b/src/ce_dubproject.pas index e6727880..35873087 100644 --- a/src/ce_dubproject.pas +++ b/src/ce_dubproject.pas @@ -1306,6 +1306,7 @@ procedure TCEDubProject.updateImportPathsFromJson; q: TSemVer; u: PSemVer; i: integer; + c: TJSONObject; begin if obj.findObject('dependencies' + suffix, deps) then begin @@ -1317,8 +1318,19 @@ procedure TCEDubProject.updateImportPathsFromJson; for i := 0 to deps.Count-1 do begin n := deps.Names[i]; - s := z + n; + // local path specified + if deps.findObject(n, c) and c.findAny('path', j) then + begin + s := expandFilenameEx(fBasePath, j.AsString); + if (s + 'source').dirExists then + fImportPaths.Add(s) + else if (s + 'src').dirExists then + fImportPaths.Add(s); + continue; + end; + + s := z + n; // Try to fetch if not present at all if not fLocalPackages.find(n, pck) and dubBuildOptions.autoFetch then begin