Skip to content

Commit 70423a2

Browse files
authored
Merge branch 'dev' into dev-flux
2 parents 28a1d41 + ce8dcfe commit 70423a2

3 files changed

Lines changed: 26 additions & 3 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: 24 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>
@@ -135,4 +141,22 @@ public static void UpdateVersion(string apaxFile, string version)
135141
"'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)");
136142
}
137143
}
144+
}
145+
146+
/// <summary>
147+
/// Represents the `variables` section of apax.yml.
148+
/// </summary>
149+
public class ApaxVariables
150+
{
151+
/// <summary>
152+
/// Values for APAX build arguments. Maps to the YAML key `APAX_BUILD_ARGS`.
153+
/// </summary>
154+
[YamlMember(Alias = "APAX_BUILD_ARGS", ApplyNamingConventions = false)]
155+
public IEnumerable<string>? ApaxBuildArgs { get; set; }
156+
157+
/// <summary>
158+
/// Values for defined preprocessor symbols. Maps to the YAML key `DEFINED_PREPROCESSOR_SYMBOLS`.
159+
/// </summary>
160+
[YamlMember(Alias = "DEFINED_PREPROCESSOR_SYMBOLS", ApplyNamingConventions = false)]
161+
public IEnumerable<string>? DefinedPreprocessorSymbols { get; set; }
138162
}

0 commit comments

Comments
 (0)