Merge "Target Java 17"

This commit is contained in:
Sorin Basca
2023-02-02 11:38:32 +00:00
committed by Gerrit Code Review
3 changed files with 4 additions and 18 deletions

View File

@@ -517,14 +517,8 @@ func getJavaVersion(ctx android.ModuleContext, javaVersion string, sdkContext an
return normalizeJavaVersion(ctx, javaVersion)
} else if ctx.Device() {
return defaultJavaLanguageVersion(ctx, sdkContext.SdkVersion(ctx))
} else if ctx.Config().TargetsJava17() {
// Temporary experimental flag to be able to try and build with
// java version 17 options. The flag, if used, just sets Java
// 17 as the default version, leaving any components that
// target an older version intact.
return JAVA_VERSION_17
} else {
return JAVA_VERSION_11
return JAVA_VERSION_17
}
}

View File

@@ -57,14 +57,10 @@ func defaultJavaLanguageVersion(ctx android.EarlyModuleContext, s android.SdkSpe
return JAVA_VERSION_8
} else if sdk.FinalOrFutureInt() <= 31 {
return JAVA_VERSION_9
} else if ctx.Config().TargetsJava17() {
// Temporary experimental flag to be able to try and build with
// java version 17 options. The flag, if used, just sets Java
// 17 as the default version, leaving any components that
// target an older version intact.
return JAVA_VERSION_17
} else {
} else if sdk.FinalOrFutureInt() <= 32 {
return JAVA_VERSION_11
} else {
return JAVA_VERSION_17
}
}