Skip to content

Commit

Permalink
fixed ixc CLI argument (#283)
Browse files Browse the repository at this point in the history
During the fist buil by ixc, build args. was not overrided by CLI args

Co-authored-by: blazej.kuhajda <blazej.kuhajda@mts.sk>
  • Loading branch information
kuh0005 and blazej.kuhajda authored Feb 8, 2024
1 parent 538f6ef commit f7bcfa1
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/AXSharp.compiler/src/AXSharp.Compiler/AXSharpConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ public class AXSharpConfig : ICompilerOptions
[Obsolete($"Use 'Create {nameof(RetrieveAXSharpConfig)} instead.")]
public AXSharpConfig()
{

}

/// <summary>
/// Ix config file name.
/// </summary>
public const string CONFIG_FILE_NAME = "AXSharp.config.json";




private string _outputProjectFolder = "ix";
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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);
}
Expand All @@ -120,7 +122,7 @@ public static AXSharpConfig UpdateAndGetAXSharpConfig(string directory, ICompile
return AXSharpConfig;
}


public static AXSharpConfig RetrieveAXSharpConfig(string ixConfigFilePath)
{
try
Expand All @@ -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)
Expand Down

0 comments on commit f7bcfa1

Please sign in to comment.