diff options
Diffstat (limited to 'java/hiddenapi_monolithic.go')
-rw-r--r-- | java/hiddenapi_monolithic.go | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/java/hiddenapi_monolithic.go b/java/hiddenapi_monolithic.go index edf42351f..8a83d1006 100644 --- a/java/hiddenapi_monolithic.go +++ b/java/hiddenapi_monolithic.go @@ -43,22 +43,37 @@ type MonolithicHiddenAPIInfo struct { // The paths to the generated all-flags.csv files. AllFlagsPaths android.Paths + + // The classes jars from the libraries on the platform bootclasspath. + ClassesJars android.Paths } // newMonolithicHiddenAPIInfo creates a new MonolithicHiddenAPIInfo from the flagFilesByCategory // plus information provided by each of the fragments. -func newMonolithicHiddenAPIInfo(ctx android.ModuleContext, flagFilesByCategory FlagFilesByCategory, fragments []android.Module) MonolithicHiddenAPIInfo { +func newMonolithicHiddenAPIInfo(ctx android.ModuleContext, flagFilesByCategory FlagFilesByCategory, classpathElements ClasspathElements) MonolithicHiddenAPIInfo { monolithicInfo := MonolithicHiddenAPIInfo{} monolithicInfo.FlagsFilesByCategory = flagFilesByCategory - // Merge all the information from the fragments. The fragments form a DAG so it is possible that - // this will introduce duplicates so they will be resolved after processing all the fragments. - for _, fragment := range fragments { - if ctx.OtherModuleHasProvider(fragment, HiddenAPIInfoProvider) { - info := ctx.OtherModuleProvider(fragment, HiddenAPIInfoProvider).(HiddenAPIInfo) - monolithicInfo.append(&info) + // 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()) + + case *ClasspathFragmentElement: + fragment := e.Module() + if ctx.OtherModuleHasProvider(fragment, HiddenAPIInfoProvider) { + info := ctx.OtherModuleProvider(fragment, HiddenAPIInfoProvider).(HiddenAPIInfo) + monolithicInfo.append(&info) + } + + classesJars = extractClassesJarsFromModules(e.Contents) } + + monolithicInfo.ClassesJars = append(monolithicInfo.ClassesJars, classesJars...) } // Dedup paths. |