Merge "Switch to JDK 21" into main am: 092c3a56fb
am: f30930f404
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2920125 Change-Id: I5e89bce53c531700ad958fb583b2594e4d9168f4 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
b08153e781
2 changed files with 7 additions and 13 deletions
|
@ -132,12 +132,7 @@ func init() {
|
|||
if override := ctx.Config().Getenv("OVERRIDE_JLINK_VERSION_NUMBER"); override != "" {
|
||||
return override
|
||||
}
|
||||
switch ctx.Config().Getenv("EXPERIMENTAL_USE_OPENJDK21_TOOLCHAIN") {
|
||||
case "true":
|
||||
return "21"
|
||||
default:
|
||||
return "17"
|
||||
}
|
||||
return "21"
|
||||
})
|
||||
|
||||
pctx.SourcePathVariable("JavaToolchain", "${JavaHome}/bin")
|
||||
|
|
|
@ -386,22 +386,21 @@ func NewConfig(ctx Context, args ...string) Config {
|
|||
|
||||
// Configure Java-related variables, including adding it to $PATH
|
||||
java8Home := filepath.Join("prebuilts/jdk/jdk8", ret.HostPrebuiltTag())
|
||||
java17Home := filepath.Join("prebuilts/jdk/jdk17", ret.HostPrebuiltTag())
|
||||
java21Home := filepath.Join("prebuilts/jdk/jdk21", ret.HostPrebuiltTag())
|
||||
javaHome := func() string {
|
||||
if override, ok := ret.environ.Get("OVERRIDE_ANDROID_JAVA_HOME"); ok {
|
||||
return override
|
||||
}
|
||||
if ret.environ.IsEnvTrue("EXPERIMENTAL_USE_OPENJDK21_TOOLCHAIN") {
|
||||
return java21Home
|
||||
}
|
||||
if toolchain11, ok := ret.environ.Get("EXPERIMENTAL_USE_OPENJDK11_TOOLCHAIN"); ok && toolchain11 != "true" {
|
||||
ctx.Fatalln("The environment variable EXPERIMENTAL_USE_OPENJDK11_TOOLCHAIN is no longer supported. An OpenJDK 11 toolchain is now the global default.")
|
||||
ctx.Fatalln("The environment variable EXPERIMENTAL_USE_OPENJDK11_TOOLCHAIN is no longer supported. An OpenJDK 21 toolchain is now the global default.")
|
||||
}
|
||||
if toolchain17, ok := ret.environ.Get("EXPERIMENTAL_USE_OPENJDK17_TOOLCHAIN"); ok && toolchain17 != "true" {
|
||||
ctx.Fatalln("The environment variable EXPERIMENTAL_USE_OPENJDK17_TOOLCHAIN is no longer supported. An OpenJDK 17 toolchain is now the global default.")
|
||||
ctx.Fatalln("The environment variable EXPERIMENTAL_USE_OPENJDK17_TOOLCHAIN is no longer supported. An OpenJDK 21 toolchain is now the global default.")
|
||||
}
|
||||
return java17Home
|
||||
if toolchain21, ok := ret.environ.Get("EXPERIMENTAL_USE_OPENJDK21_TOOLCHAIN"); ok && toolchain21 != "true" {
|
||||
ctx.Fatalln("The environment variable EXPERIMENTAL_USE_OPENJDK21_TOOLCHAIN is no longer supported. An OpenJDK 21 toolchain is now the global default.")
|
||||
}
|
||||
return java21Home
|
||||
}()
|
||||
absJavaHome := absPath(ctx, javaHome)
|
||||
|
||||
|
|
Loading…
Reference in a new issue