Generate system modules for any value of EXPERIMENTAL_USE_OPENJDK9.

The flag EXPERIMENTAL_USE_OPENJDK9 controls the *default* value
of java_version / LOCAL_JAVA_LANGUAGE_VERSION, but that default
value can be overridden by individual build targets.

One requirement for individual build targets to opt-in to
java_version 1.9 is for system modules to be generated even if
the default language version is still < 1.9. We plan to allow
this soon for libcore targets; therefore, this CL changes the
system module targets to always be defined, regardless of the
value of EXPERIMENTAL_USE_OPENJDK9.

Test: In a workspace that has http://r.android.com/646840
      "make" no longer runs into the build failure from bug 76219552.
Bug: 76219552

Change-Id: I5193347452c7967f7695929619509aea0fd46844
This commit is contained in:
Tobias Thierer 2018-03-26 22:33:59 +01:00
parent 17ef5635fa
commit b1c697d03e
1 changed files with 10 additions and 14 deletions

View File

@ -119,9 +119,7 @@ func (system *SystemModules) GenerateAndroidBuildActions(ctx android.ModuleConte
jars = append(jars, android.PathsForModuleSrc(ctx, system.properties.Jars)...)
if ctx.Config().TargetOpenJDK9() {
system.outputFile = TransformJarsToSystemModules(ctx, "java.base", jars)
}
system.outputFile = TransformJarsToSystemModules(ctx, "java.base", jars)
}
func (system *SystemModules) DepsMutator(ctx android.BottomUpMutatorContext) {
@ -131,17 +129,15 @@ func (system *SystemModules) DepsMutator(ctx android.BottomUpMutatorContext) {
func (system *SystemModules) AndroidMk() android.AndroidMkData {
return android.AndroidMkData{
Custom: func(w io.Writer, name, prefix, moduleDir string, data android.AndroidMkData) {
if system.outputFile != nil {
makevar := "SOONG_SYSTEM_MODULES_" + name
fmt.Fprintln(w)
fmt.Fprintln(w, makevar, ":=", system.outputFile.String())
fmt.Fprintln(w, ".KATI_READONLY", ":=", makevar)
fmt.Fprintln(w, name+":", "$("+makevar+")")
fmt.Fprintln(w)
makevar = "SOONG_SYSTEM_MODULES_LIBS_" + name
fmt.Fprintln(w, makevar, ":=", strings.Join(system.properties.Libs, " "))
fmt.Fprintln(w, ".KATI_READONLY :=", makevar)
}
makevar := "SOONG_SYSTEM_MODULES_" + name
fmt.Fprintln(w)
fmt.Fprintln(w, makevar, ":=", system.outputFile.String())
fmt.Fprintln(w, ".KATI_READONLY", ":=", makevar)
fmt.Fprintln(w, name+":", "$("+makevar+")")
fmt.Fprintln(w)
makevar = "SOONG_SYSTEM_MODULES_LIBS_" + name
fmt.Fprintln(w, makevar, ":=", strings.Join(system.properties.Libs, " "))
fmt.Fprintln(w, ".KATI_READONLY :=", makevar)
},
}
}