Skip to content

Commit 4e9b624

Browse files
authored
Merge pull request #458 from Inxton/fix-issue-when-apax-malformed-exception
fix issue with malformed apax.yaml files, skip bin/obj and report proper exception
2 parents d149133 + 8bebacd commit 4e9b624

3 files changed

Lines changed: 9 additions & 1 deletion

File tree

src/AXSharp.compiler/src/AXSharp.Compiler/Apax.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ public static Apax TryCreateApaxDto(string projectFile)
109109
{
110110
throw new FileNotFoundException(
111111
"'apax.yml' file was not found in the working directory. Make sure your current directory is simatic-ax project directory or provide source directory argument (for details see ixc --help)");
112+
}
113+
catch(YamlDotNet.Core.YamlException ex)
114+
{
115+
throw new InvalidDataException($"Failed to process apax file: '{projectFile}' {ex.ToString()}");
112116
}
113117
}
114118

src/AXSharp.compiler/src/AXSharp.Compiler/AxProject.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ private IEnumerable<object> GetProjectDependencies()
244244

245245
nearByProjects = SearchForApaxFiles(GetStartDirectory(this.ProjectFolder, 4), 0, 4)
246246
.Select(p => new FileInfo(p))
247-
.Where(p => !p.Directory.FullName.Contains(".apax"))
247+
.Where(p => !(p.Directory.FullName.Contains(".apax") || p.Directory.FullName.Contains("bin") || p.Directory.FullName.Contains("obj")))
248248
.Select(a => new NearByProjects() { Apax = Apax.TryCreateApaxDto(a.FullName), ApaxFile = a })
249249
.ToList(); ;
250250

src/AXSharp.compiler/src/ixc/Properties/launchSettings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
"commandName": "Project",
55
"workingDirectory": "c:\\W\\Develop\\gh\\inxton\\statemachine\\"
66
},
7+
"ixc-tom": {
8+
"commandName": "Project",
9+
"workingDirectory": "D:\\github\\Inxton\\axopen\\src\\components.elements\\app"
10+
},
711
"integration_plc": {
812
"commandName": "Project",
913
"workingDirectory": "c:\\W\\Develop\\gh\\inxton\\axopen\\src\\integrations\\ctrl\\"

0 commit comments

Comments
 (0)