From 27d4606b57ab5b8f3d83c2f420ee641650122204 Mon Sep 17 00:00:00 2001 From: Juan Marcelo Tondato Date: Tue, 26 Oct 2021 17:13:24 -0300 Subject: [PATCH] Adds api to get the list of supported jdk infos - VisualStudio needs to know this list to set the default jdk on the android settings property page --- src/Xamarin.Android.Tools.AndroidSdk/AndroidSdkInfo.cs | 2 +- src/Xamarin.Android.Tools.AndroidSdk/JdkInfo.cs | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Xamarin.Android.Tools.AndroidSdk/AndroidSdkInfo.cs b/src/Xamarin.Android.Tools.AndroidSdk/AndroidSdkInfo.cs index b7b594db..0b9cf605 100644 --- a/src/Xamarin.Android.Tools.AndroidSdk/AndroidSdkInfo.cs +++ b/src/Xamarin.Android.Tools.AndroidSdk/AndroidSdkInfo.cs @@ -185,7 +185,7 @@ public static void DetectAndSetPreferredJavaSdkPathToLatest (Action> GetJavaProperties (string java) return props; } - // Keep ordering in sync w/ GetPreferredJdkInfos + // Keep ordering in sync w/ GetSupportedJdkInfos public static IEnumerable GetKnownSystemJdkInfos (Action? logger = null) { logger = logger ?? AndroidSdkInfo.DefaultConsoleLogger; @@ -302,8 +302,10 @@ public static IEnumerable GetKnownSystemJdkInfos (Action GetPreferredJdkInfos (Action logger) + public static IEnumerable GetSupportedJdkInfos (Action? logger = null) { + logger = logger ?? AndroidSdkInfo.DefaultConsoleLogger; + return MicrosoftOpenJdkLocations.GetMicrosoftOpenJdks (logger) .Concat (EclipseAdoptiumJdkLocations.GetEclipseAdoptiumJdks (logger)) .Concat (MicrosoftDistJdkLocations.GetMicrosoftDistJdks (logger))