Track transitive usage of aconfig flags and add LOCAL_ACONFIG_FILES to Android-<product>.mk

Bug: 283910439
Test: m nothing (runs soong tests)
Change-Id: I59f9bef7b7c502565d531a5685c002a177e0a77c
This commit is contained in:
Joe Onorato
2023-07-16 13:20:33 -07:00
parent cfcd0a4960
commit 6fe59eb7f0
10 changed files with 234 additions and 6 deletions

View File

@@ -274,7 +274,14 @@ type JavaInfo struct {
// instrumented by jacoco.
JacocoReportClassesFile android.Path
// TODO: Add device config declarations here?
// set of aconfig flags for all transitive libs deps
// TODO(joeo): It would be nice if this were over in the aconfig package instead of here.
// In order to do that, generated_java_library would need a way doing
// collectTransitiveAconfigFiles with one of the callbacks, and having that automatically
// propagated. If we were to clean up more of the stuff on JavaInfo that's not part of
// core java rules (e.g. AidlIncludeDirs), then maybe adding more framework to do that would be
// worth it.
TransitiveAconfigFiles *android.DepSet[android.Path]
}
var JavaInfoProvider = blueprint.NewProvider(JavaInfo{})
@@ -730,6 +737,7 @@ func (j *Library) GenerateAndroidBuildActions(ctx android.ModuleContext) {
}
})
j.exportedProguardFlagFiles = android.FirstUniquePaths(j.exportedProguardFlagFiles)
}
func (j *Library) DepsMutator(ctx android.BottomUpMutatorContext) {
@@ -1916,6 +1924,7 @@ func (al *ApiLibrary) GenerateAndroidBuildActions(ctx android.ModuleContext) {
ImplementationAndResourcesJars: android.PathsIfNonNil(al.stubsJar),
ImplementationJars: android.PathsIfNonNil(al.stubsJar),
AidlIncludeDirs: android.Paths{},
// No aconfig libraries on api libraries
})
}
@@ -2237,6 +2246,7 @@ func (j *Import) GenerateAndroidBuildActions(ctx android.ModuleContext) {
ImplementationAndResourcesJars: android.PathsIfNonNil(j.combinedClasspathFile),
ImplementationJars: android.PathsIfNonNil(j.combinedClasspathFile),
AidlIncludeDirs: j.exportAidlIncludeDirs,
// TODO(b/289117800): LOCAL_ACONFIG_FILES for prebuilts
})
}
@@ -3305,7 +3315,8 @@ func (i *Import) ProcessBazelQueryResponse(ctx android.ModuleContext) {
HeaderJars: android.PathsIfNonNil(i.combinedClasspathFile),
ImplementationAndResourcesJars: android.PathsIfNonNil(i.combinedClasspathFile),
ImplementationJars: android.PathsIfNonNil(i.combinedClasspathFile),
//TODO(b/240308299) include AIDL information from Bazel
// TODO(b/240308299) include AIDL information from Bazel
// TODO: aconfig files?
})
i.maybeInstall(ctx, jarName, outputFile)