Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NEW-FEATURE] Compiler should look for nearby project from the directory containing workspace file #299

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/AXSharp.compiler/src/AXSharp.Compiler/AxProject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down Expand Up @@ -232,7 +242,7 @@ private IEnumerable<object> 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 })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading