diff --git a/src/AXSharp.compiler/src/AXSharp.Compiler/AxProject.cs b/src/AXSharp.compiler/src/AXSharp.Compiler/AxProject.cs index 85984103..ef90f789 100644 --- a/src/AXSharp.compiler/src/AXSharp.Compiler/AxProject.cs +++ b/src/AXSharp.compiler/src/AXSharp.Compiler/AxProject.cs @@ -117,9 +117,19 @@ private static string GetStartDirectory(string givenDirectory, int levelsUp) if (dirInfo.Parent != null) { dirInfo = dirInfo.Parent; + var potentialapax = dirInfo.GetFiles().Where(p => p.Name == "apax.yml").FirstOrDefault(); + if (potentialapax != null) + { + var apax = Apax.CreateApaxDto(potentialapax.FullName); + if (apax.Type == "workspace") + { + return dirInfo.FullName; + } + } } else { + Log.Logger.Information("Workspace apax file was not located in the directory structure, project references won't be compiled."); return dirInfo.FullName; // Return root if we hit it before moving the desired levels up } } @@ -232,7 +242,7 @@ private IEnumerable GetProjectDependencies() ApaxFile = new FileInfo(Path.Combine(p, "apax.yml")) }).ToList(); - nearByProjects = SearchForApaxFiles(GetStartDirectory(this.ProjectFolder, 2), 0, 4) + nearByProjects = SearchForApaxFiles(GetStartDirectory(this.ProjectFolder, 4), 0, 4) .Select(p => new FileInfo(p)) .Where(p => !p.Directory.FullName.Contains(".apax")) .Select(a => new NearByProjects() { Apax = Apax.TryCreateApaxDto(a.FullName), ApaxFile = a }) diff --git a/src/AXSharp.compiler/src/ixc/Properties/launchSettings.json b/src/AXSharp.compiler/src/ixc/Properties/launchSettings.json index 7c0560bf..15ad3173 100644 --- a/src/AXSharp.compiler/src/ixc/Properties/launchSettings.json +++ b/src/AXSharp.compiler/src/ixc/Properties/launchSettings.json @@ -10,7 +10,7 @@ }, "ixc-simple-template": { "commandName": "Project", - "workingDirectory": "c:\\W\\Develop\\gh\\ix-ax\\_axopen\\axopen.template.simple\\ax" + "workingDirectory": "c:\\W\\Develop\\gh\\ix-ax\\_axopen\\axopen.templates\\axopen.template.simple\\ax" }, "ixc-template-ref": { "commandName": "Project",