Merge "Remove fallback to classes jars from bootclasspath_fragment" am: 880a3971a6

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

Change-Id: Ia42ff419111096a1467735a697a2454be5049762
This commit is contained in:
Paul Duffin
2021-07-21 11:20:19 +00:00
committed by Automerger Merge Worker

View File

@@ -58,30 +58,20 @@ func newMonolithicHiddenAPIInfo(ctx android.ModuleContext, flagFilesByCategory F
// Merge all the information from the classpathElements. The fragments form a DAG so it is possible that
// this will introduce duplicates so they will be resolved after processing all the classpathElements.
for _, element := range classpathElements {
var classesJars android.Paths
switch e := element.(type) {
case *ClasspathLibraryElement:
classesJars = retrieveClassesJarsFromModule(e.Module())
classesJars := retrieveClassesJarsFromModule(e.Module())
monolithicInfo.ClassesJars = append(monolithicInfo.ClassesJars, classesJars...)
case *ClasspathFragmentElement:
fragment := e.Module()
if ctx.OtherModuleHasProvider(fragment, HiddenAPIInfoProvider) {
info := ctx.OtherModuleProvider(fragment, HiddenAPIInfoProvider).(HiddenAPIInfo)
monolithicInfo.append(&info)
// If the bootclasspath fragment actually perform hidden API processing itself then use the
// CSV files it provides and do not bother processing the classesJars files. This ensures
// consistent behavior between source and prebuilt as prebuilt modules do not provide
// classesJars.
if info.AllFlagsPath != nil {
continue
} else {
ctx.ModuleErrorf("%s does not provide hidden API information", fragment)
}
}
classesJars = extractClassesJarsFromModules(e.Contents)
}
monolithicInfo.ClassesJars = append(monolithicInfo.ClassesJars, classesJars...)
}
// Dedup paths.