Remove support for EXPERIMENTAL_JAVA_LANGUAGE_LEVEL_9.
Prior to this change, setting that to "false" turned the default Java language level back to 8. This change removes that option. Bug: 115604102 Test: m java droid docs tests cts Change-Id: I97bfd0dc8d941008b4071c6efe1c0c24950c4f1f
This commit is contained in:
@@ -113,8 +113,6 @@ type config struct {
|
|||||||
captureBuild bool // true for tests, saves build parameters for each module
|
captureBuild bool // true for tests, saves build parameters for each module
|
||||||
ignoreEnvironment bool // true for tests, returns empty from all Getenv calls
|
ignoreEnvironment bool // true for tests, returns empty from all Getenv calls
|
||||||
|
|
||||||
targetOpenJDK9 bool // Target 1.9
|
|
||||||
|
|
||||||
stopBefore bootstrap.StopBefore
|
stopBefore bootstrap.StopBefore
|
||||||
|
|
||||||
OncePer
|
OncePer
|
||||||
@@ -392,13 +390,9 @@ func NewConfig(srcDir, buildDir string) (Config, error) {
|
|||||||
func (c *config) fromEnv() error {
|
func (c *config) fromEnv() error {
|
||||||
switch c.Getenv("EXPERIMENTAL_JAVA_LANGUAGE_LEVEL_9") {
|
switch c.Getenv("EXPERIMENTAL_JAVA_LANGUAGE_LEVEL_9") {
|
||||||
case "", "true":
|
case "", "true":
|
||||||
// Use -source 9 -target 9. This is the default.
|
// Do nothing
|
||||||
c.targetOpenJDK9 = true
|
|
||||||
case "false":
|
|
||||||
// Use -source 8 -target 8. This is the legacy behaviour.
|
|
||||||
c.targetOpenJDK9 = false
|
|
||||||
default:
|
default:
|
||||||
return fmt.Errorf(`Invalid value for EXPERIMENTAL_JAVA_LANGUAGE_LEVEL_9, should be "", "true", or "false"`)
|
return fmt.Errorf("The environment variable EXPERIMENTAL_JAVA_LANGUAGE_LEVEL_9 is no longer supported. Java language level 9 is now the global default.")
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
@@ -779,11 +773,6 @@ func (c *config) EmitXrefRules() bool {
|
|||||||
return c.XrefCorpusName() != ""
|
return c.XrefCorpusName() != ""
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns true if -source 1.9 -target 1.9 is being passed to javac
|
|
||||||
func (c *config) TargetOpenJDK9() bool {
|
|
||||||
return c.targetOpenJDK9
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *config) ClangTidy() bool {
|
func (c *config) ClangTidy() bool {
|
||||||
return Bool(c.productVariables.ClangTidy)
|
return Bool(c.productVariables.ClangTidy)
|
||||||
}
|
}
|
||||||
|
@@ -29,12 +29,6 @@ func makeVarsProvider(ctx android.MakeVarsContext) {
|
|||||||
ctx.Strict("TARGET_DEFAULT_BOOTCLASSPATH_LIBRARIES", strings.Join(DefaultBootclasspathLibraries, " "))
|
ctx.Strict("TARGET_DEFAULT_BOOTCLASSPATH_LIBRARIES", strings.Join(DefaultBootclasspathLibraries, " "))
|
||||||
ctx.Strict("DEFAULT_SYSTEM_MODULES", DefaultSystemModules)
|
ctx.Strict("DEFAULT_SYSTEM_MODULES", DefaultSystemModules)
|
||||||
|
|
||||||
if ctx.Config().TargetOpenJDK9() {
|
|
||||||
ctx.Strict("DEFAULT_JAVA_LANGUAGE_VERSION", "1.9")
|
|
||||||
} else {
|
|
||||||
ctx.Strict("DEFAULT_JAVA_LANGUAGE_VERSION", "1.8")
|
|
||||||
}
|
|
||||||
|
|
||||||
ctx.Strict("ANDROID_JAVA_HOME", "${JavaHome}")
|
ctx.Strict("ANDROID_JAVA_HOME", "${JavaHome}")
|
||||||
ctx.Strict("ANDROID_JAVA8_HOME", "prebuilts/jdk/jdk8/${hostPrebuiltTag}")
|
ctx.Strict("ANDROID_JAVA8_HOME", "prebuilts/jdk/jdk8/${hostPrebuiltTag}")
|
||||||
ctx.Strict("ANDROID_JAVA9_HOME", "prebuilts/jdk/jdk9/${hostPrebuiltTag}")
|
ctx.Strict("ANDROID_JAVA9_HOME", "prebuilts/jdk/jdk9/${hostPrebuiltTag}")
|
||||||
|
@@ -425,16 +425,12 @@ func (j *Javadoc) addDeps(ctx android.BottomUpMutatorContext) {
|
|||||||
if sdkDep.hasStandardLibs() {
|
if sdkDep.hasStandardLibs() {
|
||||||
if sdkDep.useDefaultLibs {
|
if sdkDep.useDefaultLibs {
|
||||||
ctx.AddVariationDependencies(nil, bootClasspathTag, config.DefaultBootclasspathLibraries...)
|
ctx.AddVariationDependencies(nil, bootClasspathTag, config.DefaultBootclasspathLibraries...)
|
||||||
if ctx.Config().TargetOpenJDK9() {
|
ctx.AddVariationDependencies(nil, systemModulesTag, config.DefaultSystemModules)
|
||||||
ctx.AddVariationDependencies(nil, systemModulesTag, config.DefaultSystemModules)
|
|
||||||
}
|
|
||||||
if sdkDep.hasFrameworkLibs() {
|
if sdkDep.hasFrameworkLibs() {
|
||||||
ctx.AddVariationDependencies(nil, libTag, config.DefaultLibraries...)
|
ctx.AddVariationDependencies(nil, libTag, config.DefaultLibraries...)
|
||||||
}
|
}
|
||||||
} else if sdkDep.useModule {
|
} else if sdkDep.useModule {
|
||||||
if ctx.Config().TargetOpenJDK9() {
|
ctx.AddVariationDependencies(nil, systemModulesTag, sdkDep.systemModules)
|
||||||
ctx.AddVariationDependencies(nil, systemModulesTag, sdkDep.systemModules)
|
|
||||||
}
|
|
||||||
ctx.AddVariationDependencies(nil, bootClasspathTag, sdkDep.modules...)
|
ctx.AddVariationDependencies(nil, bootClasspathTag, sdkDep.modules...)
|
||||||
}
|
}
|
||||||
} else if sdkDep.systemModules != "" {
|
} else if sdkDep.systemModules != "" {
|
||||||
|
@@ -884,7 +884,7 @@ func getJavaVersion(ctx android.ModuleContext, javaVersion string, sdkContext sd
|
|||||||
ret = normalizeJavaVersion(ctx, javaVersion)
|
ret = normalizeJavaVersion(ctx, javaVersion)
|
||||||
} else if ctx.Device() && sdk <= 23 {
|
} else if ctx.Device() && sdk <= 23 {
|
||||||
ret = "1.7"
|
ret = "1.7"
|
||||||
} else if ctx.Device() && sdk <= 29 || !ctx.Config().TargetOpenJDK9() {
|
} else if ctx.Device() && sdk <= 29 {
|
||||||
ret = "1.8"
|
ret = "1.8"
|
||||||
} else if ctx.Device() &&
|
} else if ctx.Device() &&
|
||||||
sdkContext.sdkVersion() != "" &&
|
sdkContext.sdkVersion() != "" &&
|
||||||
|
Reference in New Issue
Block a user