@@ -15,15 +15,30 @@ namespace Xamarin.Android.Prepare
1515 //
1616 partial class Configurables
1717 {
18+ const string JetBrainsOpenJDK11Version = "11.0.4" ;
19+ const string JetBrainsOpenJDK11Release = "546.1" ;
20+ static readonly string JetBrainsOpenJDK11DownloadVersion = JetBrainsOpenJDK11Version . Replace ( '.' , '_' ) ;
21+
22+ const string JetBrainsOpenJDK8Version = "8.202" ;
23+ const string JetBrainsOpenJDK8Release = "1483.37" ;
24+ static readonly string JetBrainsOpenJDK8DownloadVersion = JetBrainsOpenJDK8Version . Replace ( '.' , 'u' ) ;
25+
1826 const string CorrettoDistVersion = "8.242.08.1" ;
1927 const string CorrettoUrlPathVersion = CorrettoDistVersion ;
2028
2129 static Context ctx => Context . Instance ;
2230
2331 public static partial class Urls
2432 {
25- // Keep the trailing slash here - OS-specific code assumes it's there.
26- public const string Corretto_BaseUri = "https://corretto.aws/downloads/resources/" ;
33+ // https://bintray.com/jetbrains/intellij-jdk/download_file?file_path=jbrsdk-8u202-linux-x64-b1483.37.tar.gz
34+ // https://bintray.com/jetbrains/intellij-jdk/download_file?file_path=jbrsdk-8u202-osx-x64-b1483.37.tar.gz
35+ // https://bintray.com/jetbrains/intellij-jdk/download_file?file_path=jbrsdk-8u202-windows-x64-b1483.37.tar.gz
36+ public static readonly Uri JetBrainsOpenJDK8 = new Uri ( $ "https://bintray.com/jetbrains/intellij-jdk/download_file?file_path=jbrsdk-{ JetBrainsOpenJDK8DownloadVersion } -{ JetBrainsOpenJDKOperatingSystem } -b{ JetBrainsOpenJDK8Release } .tar.gz") ;
37+
38+ // https://bintray.com/jetbrains/intellij-jdk/download_file?file_path=jbrsdk-11_0_4-linux-x64-b546.1.tar.gz
39+ // https://bintray.com/jetbrains/intellij-jdk/download_file?file_path=jbrsdk-11_0_4-osx-x64-b546.1.tar.gz
40+ // https://bintray.com/jetbrains/intellij-jdk/download_file?file_path=jbrsdk-11_0_4-windows-x64-b546.1.tar.gz
41+ public static readonly Uri JetBrainsOpenJDK11 = new Uri ( $ "https://bintray.com/jetbrains/intellij-jdk/download_file?file_path=jbrsdk-{ JetBrainsOpenJDK11DownloadVersion } -{ JetBrainsOpenJDKOperatingSystem } -b{ JetBrainsOpenJDK11Release } .tar.gz") ;
2742
2843 /// <summary>
2944 /// Base URL for all Android SDK and NDK downloads. Used in <see cref="AndroidToolchain"/>
@@ -39,6 +54,14 @@ public static partial class Defaults
3954 {
4055 public static readonly char [ ] PropertyListSeparator = new [ ] { ':' } ;
4156
57+ public static readonly string JdkFolder = "jdk-1.8" ;
58+
59+ public static readonly Version JetBrainsOpenJDK11Version = new Version ( Configurables . JetBrainsOpenJDK11Version ) ;
60+ public static readonly Version JetBrainsOpenJDK11Release = new Version ( Configurables . JetBrainsOpenJDK11Release ) ;
61+
62+ public static readonly Version JetBrainsOpenJDK8Version = new Version ( Configurables . JetBrainsOpenJDK8Version ) ;
63+ public static readonly Version JetBrainsOpenJDK8Release = new Version ( Configurables . JetBrainsOpenJDK8Release ) ;
64+
4265 // Mono runtimes
4366 public const string DebugFileExtension = ".pdb" ;
4467 public const string MonoHostMingwRuntimeNativeLibraryExtension = WindowsDLLSuffix ;
@@ -104,9 +127,9 @@ public static partial class Defaults
104127 public const int DefaultMaximumParallelTasks = 5 ;
105128
106129 /// <summary>
107- /// The maximum JDK version we support. Note: this will probably go away with Corretto
130+ /// The maximum JDK version we support.
108131 /// </summary>
109- public const int MaxJDKVersion = 8 ;
132+ public static readonly Version MaxJDKVersion = new Version ( 11 , 99 , 0 ) ;
110133
111134 /// <summary>
112135 /// Prefix for all the log files created by the bootstrapper.
@@ -314,10 +337,12 @@ public static partial class Paths
314337 public static string Mingw32CmakePath => GetCachedPath ( ref mingw32CmakePath , ( ) => Path . Combine ( BuildBinDir , "mingw-32.cmake" ) ) ;
315338 public static string Mingw64CmakePath => GetCachedPath ( ref mingw64CmakePath , ( ) => Path . Combine ( BuildBinDir , "mingw-64.cmake" ) ) ;
316339
317- // Corretto OpenJDK
318- public static string CorrettoCacheDir => GetCachedPath ( ref correttoCacheDir , ( ) => ctx . Properties . GetRequiredValue ( KnownProperties . AndroidToolchainCacheDirectory ) ) ;
319- public static string CorrettoInstallDir => GetCachedPath ( ref correttoInstallDir , ( ) => Path . Combine ( ctx . Properties . GetRequiredValue ( KnownProperties . AndroidToolchainDirectory ) , "jdk" ) ) ;
340+ // JetBrains OpenJDK
341+ public static string OpenJDK8InstallDir => GetCachedPath ( ref openJDK8InstallDir , ( ) => Path . Combine ( ctx . Properties . GetRequiredValue ( KnownProperties . AndroidToolchainDirectory ) , "jdk-1.8" ) ) ;
342+ public static string OpenJDK8CacheDir => GetCachedPath ( ref openJDK8CacheDir , ( ) => ctx . Properties . GetRequiredValue ( KnownProperties . AndroidToolchainCacheDirectory ) ) ;
320343
344+ public static string OpenJDK11InstallDir => GetCachedPath ( ref openJDK11InstallDir , ( ) => Path . Combine ( ctx . Properties . GetRequiredValue ( KnownProperties . AndroidToolchainDirectory ) , "jdk-11" ) ) ;
345+ public static string OpenJDK11CacheDir => GetCachedPath ( ref openJDK11CacheDir , ( ) => ctx . Properties . GetRequiredValue ( KnownProperties . AndroidToolchainCacheDirectory ) ) ;
321346 // bundle
322347 public static string BCLTestsArchiveName = "bcl-tests.zip" ;
323348
@@ -403,6 +428,8 @@ static string GetCachedPath (ref string? variable, Func<string> creator)
403428 static string ? monoSdksTpnExternalPath ;
404429 static string ? monoSDKSIncludeDestDir ;
405430 static string ? monoLlvmTpnPath ;
431+ static string ? openJDK8InstallDir , openJDK11InstallDir ;
432+ static string ? openJDK8CacheDir , openJDK11CacheDir ;
406433 }
407434 }
408435}
0 commit comments