summaryrefslogtreecommitdiff
path: root/java/hiddenapi_modular.go
diff options
context:
space:
mode:
author Paul Duffin <paulduffin@google.com> 2021-06-07 21:36:01 +0100
committer Paul Duffin <paulduffin@google.com> 2021-06-20 19:09:09 +0100
commitd061d40eb6ffbc9d7cece2945b7276fe2f6759d1 (patch)
tree5aeab548e6f425bff908782a1088ba03af10dc3a /java/hiddenapi_modular.go
parent51d7da2c4e62eccc5f0fe11cfa8cdf1cf67aa7c7 (diff)
Fix monolithic hidden API processing with prebuilts
Prebuilt modules do not provide classesJars containing annotations. Previously, the monolithic hidden API processing just used classesJars from all the modules that provided them so when building against prebuilts would have fewer classesJars than when building against sources and so would produce different hidden API flags. This change will generate the monolithic files from both classesJars and files previously generated from hidden API processing. A fragment that has performed hidden API processing will contribute its generated files whereas standalone libraries and fragments which have not performed hidden API processing will contribute classesJars. Bug: 177892522 Test: m out/soong/hiddenapi/hiddenapi-flags.csv m SOONG_CONFIG_art_module_source_build=false out/soong/hiddenapi/hiddenapi-flags.csv - verify that the files are identical whether built from source or prebuilts. Change-Id: I06f3c7df49626bec21a452bc9abf1bb9e7545e5c
Diffstat (limited to 'java/hiddenapi_modular.go')
-rw-r--r--java/hiddenapi_modular.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/java/hiddenapi_modular.go b/java/hiddenapi_modular.go
index de72b39aa..6e2261480 100644
--- a/java/hiddenapi_modular.go
+++ b/java/hiddenapi_modular.go
@@ -524,7 +524,7 @@ func (i *HiddenAPIFlagInput) gatherStubLibInfo(ctx android.ModuleContext, conten
}
}
- ctx.VisitDirectDepsIf(isActiveModule, func(module android.Module) {
+ ctx.VisitDirectDeps(func(module android.Module) {
tag := ctx.OtherModuleDependencyTag(module)
if hiddenAPIStubsTag, ok := tag.(hiddenAPIStubsDependencyTag); ok {
kind := hiddenAPIStubsTag.sdkKind
@@ -634,7 +634,7 @@ func pathForValidation(ctx android.PathContext, path android.WritablePath) andro
// hiddenAPIInfo is a struct containing paths to files that augment the information provided by
// the annotationFlags.
func buildRuleToGenerateHiddenApiFlags(ctx android.BuilderContext, name, desc string,
- outputPath android.WritablePath, baseFlagsPath android.Path, annotationFlags android.Path,
+ outputPath android.WritablePath, baseFlagsPath android.Path, annotationFlagPaths android.Paths,
flagFilesByCategory FlagFilesByCategory, allFlagsPaths android.Paths, generatedRemovedDexSignatures android.OptionalPath) {
// The file which is used to record that the flags file is valid.
@@ -665,7 +665,7 @@ func buildRuleToGenerateHiddenApiFlags(ctx android.BuilderContext, name, desc st
command := rule.Command().
BuiltTool("generate_hiddenapi_lists").
FlagWithInput("--csv ", baseFlagsPath).
- Input(annotationFlags).
+ Inputs(annotationFlagPaths).
FlagWithOutput("--output ", tempPath)
// Add the options for the different categories of flag files.
@@ -747,7 +747,7 @@ func hiddenAPIRulesForBootclasspathFragment(ctx android.ModuleContext, contents
// Generate the all-flags.csv which are the flags that will, in future, be encoded into the dex
// files.
allFlagsCSV := android.PathForModuleOut(ctx, hiddenApiSubDir, "all-flags.csv")
- buildRuleToGenerateHiddenApiFlags(ctx, "modularHiddenApiAllFlags", "modular hiddenapi all flags", allFlagsCSV, stubFlagsCSV, annotationFlagsCSV, input.FlagFilesByCategory, nil, removedDexSignatures)
+ buildRuleToGenerateHiddenApiFlags(ctx, "modularHiddenApiAllFlags", "modular hiddenapi all flags", allFlagsCSV, stubFlagsCSV, android.Paths{annotationFlagsCSV}, input.FlagFilesByCategory, nil, removedDexSignatures)
// Encode the flags into the boot dex files.
encodedBootDexJarsByModule := map[string]android.Path{}