Skip to content

Commit

Permalink
Merge pull request #597 from iterate-ch/feature/load-runtimeconfig-pr…
Browse files Browse the repository at this point in the history
…operties

Load IKVM.Properties from RuntimeHost Configuration
  • Loading branch information
wasabii authored Sep 28, 2024
2 parents b9ffe68 + 09f3dd1 commit 69bd301
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/IKVM.Runtime/JVM.Properties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,19 @@ static void InitSystemProperties(Dictionary<string, string> p)
}
#endif

#if NET
if (AppContext.GetData("IKVM.Properties") is string ikvmPropertiesContext && !string.IsNullOrWhiteSpace(ikvmPropertiesContext))
{
foreach (var ikvmSystemProperty in ikvmPropertiesContext.Split(';', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries))
{
if (AppContext.GetData(ikvmSystemProperty) is string ikvmPropertyValue)
{
p[ikvmSystemProperty] = ikvmPropertyValue;
}
}
}
#endif

// set the properties that were specfied
if (user != null)
foreach (var kvp in user)
Expand Down

0 comments on commit 69bd301

Please sign in to comment.