Merge "Revert "Reland "Target Java 17""" am: 4d3f11ccb3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2435953 Change-Id: I1818b3b7c16414f24f5e094ba3402b16a5c220d7 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
212860594e
3 changed files with 18 additions and 4 deletions
|
@ -727,6 +727,10 @@ func (c *config) IsEnvFalse(key string) bool {
|
||||||
return value == "0" || value == "n" || value == "no" || value == "off" || value == "false"
|
return value == "0" || value == "n" || value == "no" || value == "off" || value == "false"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *config) TargetsJava17() bool {
|
||||||
|
return c.IsEnvTrue("EXPERIMENTAL_TARGET_JAVA_VERSION_17")
|
||||||
|
}
|
||||||
|
|
||||||
// EnvDeps returns the environment variables this build depends on. The first
|
// EnvDeps returns the environment variables this build depends on. The first
|
||||||
// call to this function blocks future reads from the environment.
|
// call to this function blocks future reads from the environment.
|
||||||
func (c *config) EnvDeps() map[string]string {
|
func (c *config) EnvDeps() map[string]string {
|
||||||
|
|
|
@ -517,8 +517,14 @@ func getJavaVersion(ctx android.ModuleContext, javaVersion string, sdkContext an
|
||||||
return normalizeJavaVersion(ctx, javaVersion)
|
return normalizeJavaVersion(ctx, javaVersion)
|
||||||
} else if ctx.Device() {
|
} else if ctx.Device() {
|
||||||
return defaultJavaLanguageVersion(ctx, sdkContext.SdkVersion(ctx))
|
return defaultJavaLanguageVersion(ctx, sdkContext.SdkVersion(ctx))
|
||||||
} else {
|
} 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
|
return JAVA_VERSION_17
|
||||||
|
} else {
|
||||||
|
return JAVA_VERSION_11
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
10
java/sdk.go
10
java/sdk.go
|
@ -57,10 +57,14 @@ func defaultJavaLanguageVersion(ctx android.EarlyModuleContext, s android.SdkSpe
|
||||||
return JAVA_VERSION_8
|
return JAVA_VERSION_8
|
||||||
} else if sdk.FinalOrFutureInt() <= 31 {
|
} else if sdk.FinalOrFutureInt() <= 31 {
|
||||||
return JAVA_VERSION_9
|
return JAVA_VERSION_9
|
||||||
} else if sdk.FinalOrFutureInt() <= 32 {
|
} else if ctx.Config().TargetsJava17() {
|
||||||
return JAVA_VERSION_11
|
// Temporary experimental flag to be able to try and build with
|
||||||
} else {
|
// 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
|
return JAVA_VERSION_17
|
||||||
|
} else {
|
||||||
|
return JAVA_VERSION_11
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue