Merge "Add Java 21 as a known version" into main

This commit is contained in:
Sorin Basca 2024-04-22 07:08:02 +00:00 committed by Gerrit Code Review
commit db70a80cc7

View file

@ -587,6 +587,7 @@ const (
JAVA_VERSION_9 = 9
JAVA_VERSION_11 = 11
JAVA_VERSION_17 = 17
JAVA_VERSION_21 = 21
)
func (v javaVersion) String() string {
@ -605,6 +606,8 @@ func (v javaVersion) String() string {
return "11"
case JAVA_VERSION_17:
return "17"
case JAVA_VERSION_21:
return "21"
default:
return "unsupported"
}
@ -647,6 +650,8 @@ func normalizeJavaVersion(ctx android.BaseModuleContext, javaVersion string) jav
return JAVA_VERSION_11
case "17":
return JAVA_VERSION_17
case "21":
return JAVA_VERSION_21
case "10", "12", "13", "14", "15", "16":
ctx.PropertyErrorf("java_version", "Java language level %s is not supported", javaVersion)
return JAVA_VERSION_UNSUPPORTED