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

JNetReflector supports JVM options in configuration file #595

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
30 changes: 29 additions & 1 deletion src/net/JNetReflector/JNetReflectorCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,19 @@ public ClassAndPatterns(string className, string[] patterns)
public IEnumerable<string> Patterns { get; set; }
}

public struct JVMOption
{
public JVMOption(string optionName, string optionValue)
{
OptionName = optionName;
OptionValue = optionValue;
}
public string OptionName { get; set; }
public string OptionValue { get; set; }
}

public IEnumerable<JVMOption> JVMOptions { get; set; }

public string CopyrightFile { get; set; }

public string JavaPLocationPath { get; set; }
Expand Down Expand Up @@ -822,7 +835,22 @@ protected override string[] ProcessCommandLine()
return result;
}

protected override IDictionary<string, string> Options => new Dictionary<string, string>();
protected override IDictionary<string, string> Options
{
get
{
if (_ConfigurationFromFile.JVMOptions != null)
{
Dictionary<string, string> dict = new();
foreach (var item in _ConfigurationFromFile.JVMOptions)
{
dict.Add(item.OptionName, item.OptionValue);
}
return dict;
}
return null;
}
}

/// <inheritdoc cref="JNetCoreBase{T}.PathToParse"/>
protected override IList<string> PathToParse
Expand Down
Loading