From 76c129bd777f974690ffa8ad31b946636a8f7e38 Mon Sep 17 00:00:00 2001 From: masesdevelopers <94312179+masesdevelopers@users.noreply.github.com> Date: Fri, 24 Jan 2025 19:01:48 +0100 Subject: [PATCH] JNetReflector supports JVM options in configuration file --- src/net/JNetReflector/JNetReflectorCore.cs | 30 +++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/src/net/JNetReflector/JNetReflectorCore.cs b/src/net/JNetReflector/JNetReflectorCore.cs index c541848746..b4ab1dbae7 100644 --- a/src/net/JNetReflector/JNetReflectorCore.cs +++ b/src/net/JNetReflector/JNetReflectorCore.cs @@ -65,6 +65,19 @@ public ClassAndPatterns(string className, string[] patterns) public IEnumerable 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 JVMOptions { get; set; } + public string CopyrightFile { get; set; } public string JavaPLocationPath { get; set; } @@ -822,7 +835,22 @@ protected override string[] ProcessCommandLine() return result; } - protected override IDictionary Options => new Dictionary(); + protected override IDictionary Options + { + get + { + if (_ConfigurationFromFile.JVMOptions != null) + { + Dictionary dict = new(); + foreach (var item in _ConfigurationFromFile.JVMOptions) + { + dict.Add(item.OptionName, item.OptionValue); + } + return dict; + } + return null; + } + } /// protected override IList PathToParse