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

Commit b008abf0 authored by Paul Duffin's avatar Paul Duffin Committed by Automerger Merge Worker
Browse files

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

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

Change-Id: Ia42ff419111096a1467735a697a2454be5049762
parents 28bca125 880a3971
Loading
Loading
Loading
Loading
+4 −14
Original line number Diff line number Diff line
@@ -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.