Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4432408c authored by Sorin Basca's avatar Sorin Basca Committed by Gerrit Code Review
Browse files

Merge "Target Java 21 by default" into main

parents b3147242 37cc2714
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -867,7 +867,7 @@ func (c *config) IsEnvFalse(key string) bool {
}

func (c *config) TargetsJava21() bool {
	return c.IsEnvTrue("EXPERIMENTAL_TARGET_JAVA_VERSION_21")
	return c.productVariables.GetBuildFlagBool("RELEASE_TARGET_JAVA_21")
}

// EnvDeps returns the environment variables this build depends on. The first
+2 −4
Original line number Diff line number Diff line
@@ -606,10 +606,8 @@ func getJavaVersion(ctx android.ModuleContext, javaVersion string, sdkContext an
	} else if ctx.Device() {
		return defaultJavaLanguageVersion(ctx, sdkContext.SdkVersion(ctx))
	} else if ctx.Config().TargetsJava21() {
		// Temporary experimental flag to be able to try and build with
		// java version 21 options.  The flag, if used, just sets Java
		// 21 as the default version, leaving any components that
		// target an older version intact.
		// Build flag that controls whether Java 21 is used as the default
		// target version, or Java 17.
		return JAVA_VERSION_21
	} else {
		return JAVA_VERSION_17
+4 −4
Original line number Diff line number Diff line
@@ -65,11 +65,11 @@ func defaultJavaLanguageVersion(ctx android.EarlyModuleContext, s android.SdkSpe
		return JAVA_VERSION_9
	} else if sdk.FinalOrFutureInt() <= 33 {
		return JAVA_VERSION_11
	} else if sdk.FinalOrFutureInt() <= 35 {
		return JAVA_VERSION_17
	} else if ctx.Config().TargetsJava21() {
		// Temporary experimental flag to be able to try and build with
		// java version 21 options.  The flag, if used, just sets Java
		// 21 as the default version, leaving any components that
		// target an older version intact.
		// Build flag that controls whether Java 21 is used as the
		// default target version, or Java 17.
		return JAVA_VERSION_21
	} else {
		return JAVA_VERSION_17