Adding experimental option to target Java 11

Bug: 195387073
Test: m
Test: EXPERIMENTAL_TARGET_JAVA_VERSION_11=true m
Change-Id: Ifd7ce6218a2761a8eaf79af7d91210da2fa581aa
This commit is contained in:
Sorin Basca
2021-11-26 17:27:24 +00:00
parent c01a5cd705
commit 8ef3e6fd02
2 changed files with 12 additions and 0 deletions

View File

@@ -55,6 +55,12 @@ func defaultJavaLanguageVersion(ctx android.EarlyModuleContext, s android.SdkSpe
return JAVA_VERSION_7
} else if sdk.FinalOrFutureInt() <= 29 {
return JAVA_VERSION_8
} else if ctx.Config().IsEnvTrue("EXPERIMENTAL_TARGET_JAVA_VERSION_11") {
// Temporary experimental flag to be able to try and build with
// java version 11 options. The flag, if used, just sets Java
// 11 as the default version, leaving any components that
// target an older version intact.
return JAVA_VERSION_11
} else {
return JAVA_VERSION_9
}