Merge "Adding configuration support for Java 11" am: 5e4637dc1b

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1904230

Change-Id: I4a447b98b46c0b2965d3278c458d2cc14a17b9f3
This commit is contained in:
Treehugger Robot 2021-12-01 22:38:58 +00:00 committed by Automerger Merge Worker
commit c752b88ca8

View file

@ -447,6 +447,7 @@ const (
JAVA_VERSION_7 = 7
JAVA_VERSION_8 = 8
JAVA_VERSION_9 = 9
JAVA_VERSION_11 = 11
)
func (v javaVersion) String() string {
@ -459,6 +460,8 @@ func (v javaVersion) String() string {
return "1.8"
case JAVA_VERSION_9:
return "1.9"
case JAVA_VERSION_11:
return "11"
default:
return "unsupported"
}
@ -479,8 +482,10 @@ func normalizeJavaVersion(ctx android.BaseModuleContext, javaVersion string) jav
return JAVA_VERSION_8
case "1.9", "9":
return JAVA_VERSION_9
case "10", "11":
ctx.PropertyErrorf("java_version", "Java language levels above 9 are not supported")
case "11":
return JAVA_VERSION_11
case "10":
ctx.PropertyErrorf("java_version", "Java language levels 10 is not supported")
return JAVA_VERSION_UNSUPPORTED
default:
ctx.PropertyErrorf("java_version", "Unrecognized Java language level")