Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed ixc CLI argument #283

Merged
merged 1 commit into from
Feb 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading