From 868b9e219ae9333791f749f3b536a87a6bd62b67 Mon Sep 17 00:00:00 2001 From: IX-BOT <137874481+IX-BOT@users.noreply.github.com> Date: Tue, 26 Mar 2024 07:07:19 +0100 Subject: [PATCH 1/3] Create draft PR for #298 From ba8431590eb85f52e60f8360d7c5deac702deb03 Mon Sep 17 00:00:00 2001 From: PTKu <61538034+PTKu@users.noreply.github.com> Date: Tue, 26 Mar 2024 07:08:20 +0100 Subject: [PATCH 2/3] starting directoy for nearby project given by worspace file directory --- .../src/AXSharp.Compiler/AxProject.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/AXSharp.compiler/src/AXSharp.Compiler/AxProject.cs b/src/AXSharp.compiler/src/AXSharp.Compiler/AxProject.cs index 85984103..93365b6f 100644 --- a/src/AXSharp.compiler/src/AXSharp.Compiler/AxProject.cs +++ b/src/AXSharp.compiler/src/AXSharp.Compiler/AxProject.cs @@ -117,6 +117,15 @@ 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 { @@ -232,7 +241,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 }) From abe733d3422f103f021f39fcaa4911b25225e5ee Mon Sep 17 00:00:00 2001 From: PTKu <61538034+PTKu@users.noreply.github.com> Date: Tue, 26 Mar 2024 09:09:41 +0100 Subject: [PATCH 3/3] add message about workspace file --- src/AXSharp.compiler/src/AXSharp.Compiler/AxProject.cs | 1 + src/AXSharp.compiler/src/ixc/Properties/launchSettings.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/AXSharp.compiler/src/AXSharp.Compiler/AxProject.cs b/src/AXSharp.compiler/src/AXSharp.Compiler/AxProject.cs index 93365b6f..ef90f789 100644 --- a/src/AXSharp.compiler/src/AXSharp.Compiler/AxProject.cs +++ b/src/AXSharp.compiler/src/AXSharp.Compiler/AxProject.cs @@ -129,6 +129,7 @@ private static string GetStartDirectory(string givenDirectory, int levelsUp) } 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 } } 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",