Skip to content

Commit 462a191

Browse files
authored
Merge branch 'dev' into dev-flux
2 parents 7000363 + 4e9b624 commit 462a191

5 files changed

Lines changed: 35 additions & 4 deletions

File tree

GitVersion.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
mode: ContinuousDeployment
2-
next-version: 0.43.1
2+
next-version: 0.44.1
33
branches:
44
main:
55
regex: ^master$|^main$

src/AXSharp.compiler/src/AXSharp.Compiler/AXSharpProject.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,7 @@ public AXSharpProject(AxProject axProject, IEnumerable<Type> builderTypes, Type
101101
public void Generate()
102102
{
103103
Log.Logger.Information($"Compilation of project '{AxProject.SrcFolder}' started");
104-
105-
var projectSources = AxProject.Sources.Select(p => (parseTree: STParser.ParseTextAsync(p).Result, source: p));
104+
var projectSources = AxProject.Sources.Select(p => (parseTree: STParser.ParseTextAsync(p, SyntaxTreeOptions.Default, this.AxProject.ProjectInfo.Variables?.DefinedPreprocessorSymbols).Result, source: p));
106105

107106
TargetProject.ProvisionProjectStructure();
108107

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ public Apax()
6161
/// </summary>
6262
public IDictionary<string, string>? Dependencies { get; set; }
6363

64+
/// <summary>
65+
/// Gets or sets variables section.
66+
/// This maps to the `variables` node in apax.yml.
67+
/// </summary>
68+
public ApaxVariables? Variables { get; set; }
69+
6470
/// <summary>
6571
/// Creates new instance of <see cref="Apax"/>.
6672
/// </summary>
@@ -103,6 +109,10 @@ public static Apax TryCreateApaxDto(string projectFile)
103109
{
104110
throw new FileNotFoundException(
105111
"'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()}");
106116
}
107117
}
108118

@@ -135,4 +145,22 @@ public static void UpdateVersion(string apaxFile, string version)
135145
"'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)");
136146
}
137147
}
148+
}
149+
150+
/// <summary>
151+
/// Represents the `variables` section of apax.yml.
152+
/// </summary>
153+
public class ApaxVariables
154+
{
155+
/// <summary>
156+
/// Values for APAX build arguments. Maps to the YAML key `APAX_BUILD_ARGS`.
157+
/// </summary>
158+
[YamlMember(Alias = "APAX_BUILD_ARGS", ApplyNamingConventions = false)]
159+
public IEnumerable<string>? ApaxBuildArgs { get; set; }
160+
161+
/// <summary>
162+
/// Values for defined preprocessor symbols. Maps to the YAML key `DEFINED_PREPROCESSOR_SYMBOLS`.
163+
/// </summary>
164+
[YamlMember(Alias = "DEFINED_PREPROCESSOR_SYMBOLS", ApplyNamingConventions = false)]
165+
public IEnumerable<string>? DefinedPreprocessorSymbols { get; set; }
138166
}

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)