From c2e188604c022456e4fedfdf0cf7ad54280aeeca Mon Sep 17 00:00:00 2001 From: "blazej.kuhajda" Date: Thu, 8 Feb 2024 09:56:56 +0100 Subject: [PATCH] fixed ixc CLI argument During the fist buil by ixc, build args. was not overrided by CLI args --- .../src/AXSharp.Compiler/AXSharpConfig.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/AXSharp.compiler/src/AXSharp.Compiler/AXSharpConfig.cs b/src/AXSharp.compiler/src/AXSharp.Compiler/AXSharpConfig.cs index 53eaeaea..5f5d4f68 100644 --- a/src/AXSharp.compiler/src/AXSharp.Compiler/AXSharpConfig.cs +++ b/src/AXSharp.compiler/src/AXSharp.Compiler/AXSharpConfig.cs @@ -23,7 +23,7 @@ public class AXSharpConfig : ICompilerOptions [Obsolete($"Use 'Create {nameof(RetrieveAXSharpConfig)} instead.")] public AXSharpConfig() { - + } /// @@ -31,7 +31,7 @@ public AXSharpConfig() /// public const string CONFIG_FILE_NAME = "AXSharp.config.json"; - + private string _outputProjectFolder = "ix"; @@ -68,7 +68,7 @@ public string OutputProjectFolder [JsonIgnore] public string AxProjectFolder { - get => _axProjectFolder.Replace("\\",Path.DirectorySeparatorChar.ToString()); + get => _axProjectFolder.Replace("\\", Path.DirectorySeparatorChar.ToString()); set => _axProjectFolder = value; } @@ -103,6 +103,8 @@ public static AXSharpConfig UpdateAndGetAXSharpConfig(string directory, ICompile #pragma warning disable CS0618 AXSharpConfig = AXSharpConfig == null ? new AXSharpConfig() { AxProjectFolder = directory } : AXSharpConfig; #pragma warning restore CS0618 + OverridesFromCli(AXSharpConfig, newCompilerOptions); + JsonSerializer serializer = new JsonSerializer(); serializer.Serialize(file, AXSharpConfig); } @@ -120,7 +122,7 @@ public static AXSharpConfig UpdateAndGetAXSharpConfig(string directory, ICompile return AXSharpConfig; } - + public static AXSharpConfig RetrieveAXSharpConfig(string ixConfigFilePath) { try @@ -139,7 +141,7 @@ public static AXSharpConfig RetrieveAXSharpConfig(string ixConfigFilePath) { throw new FailedToReadIxConfigurationFileException($"Unable to process '{ixConfigFilePath}'", ex); } - + } private static void OverridesFromCli(ICompilerOptions fromConfig, ICompilerOptions? newCompilerOptions)