summaryrefslogtreecommitdiff
path: root/java/platform_bootclasspath.go
diff options
context:
space:
mode:
author Paul Duffin <paulduffin@google.com> 2021-04-12 23:26:14 +0100
committer Paul Duffin <paulduffin@google.com> 2021-04-14 09:08:02 +0100
commit1ba246732dbbe0b88955d57a13216782546c0928 (patch)
tree7b506960e11c7a79049edce8c5c1fc5aec94a048 /java/platform_bootclasspath.go
parent35584eeb932f198010b158f0d3922783a480416e (diff)
Ensure boot jar modules have been initialized properly for hidden API
Checks to make sure that every module that is part of the platform bootclasspath has been initialized property for hidden API processing. Bug: 177892522 Test: verified that the out/soong/hiddenapi/... files are unchanged by this change Change-Id: Ic4368963f2011784b537b8aebf5ef97ea22b2db5
Diffstat (limited to 'java/platform_bootclasspath.go')
-rw-r--r--java/platform_bootclasspath.go30
1 files changed, 25 insertions, 5 deletions
diff --git a/java/platform_bootclasspath.go b/java/platform_bootclasspath.go
index d70098080..621119ef3 100644
--- a/java/platform_bootclasspath.go
+++ b/java/platform_bootclasspath.go
@@ -303,17 +303,37 @@ func (b *platformBootclasspathModule) generateHiddenAPIBuildActions(ctx android.
return
}
- moduleSpecificFlagsPaths := android.Paths{}
+ hiddenAPISupportingModules := []hiddenAPISupportingModule{}
for _, module := range modules {
- if h, ok := module.(hiddenAPIIntf); ok {
- if csv := h.flagsCSV(); csv != nil {
- moduleSpecificFlagsPaths = append(moduleSpecificFlagsPaths, csv)
+ if h, ok := module.(hiddenAPISupportingModule); ok {
+ if h.bootDexJar() == nil {
+ ctx.ModuleErrorf("module %s does not provide a bootDexJar file", module)
+ }
+ if h.flagsCSV() == nil {
+ ctx.ModuleErrorf("module %s does not provide a flagsCSV file", module)
+ }
+ if h.indexCSV() == nil {
+ ctx.ModuleErrorf("module %s does not provide an indexCSV file", module)
+ }
+ if h.metadataCSV() == nil {
+ ctx.ModuleErrorf("module %s does not provide a metadataCSV file", module)
+ }
+
+ if ctx.Failed() {
+ continue
}
+
+ hiddenAPISupportingModules = append(hiddenAPISupportingModules, h)
} else {
- ctx.ModuleErrorf("module %s of type %s does not implement hiddenAPIIntf", module, ctx.OtherModuleType(module))
+ ctx.ModuleErrorf("module %s of type %s does not support hidden API processing", module, ctx.OtherModuleType(module))
}
}
+ moduleSpecificFlagsPaths := android.Paths{}
+ for _, module := range hiddenAPISupportingModules {
+ moduleSpecificFlagsPaths = append(moduleSpecificFlagsPaths, module.flagsCSV())
+ }
+
augmentationInfo := b.properties.Hidden_api.hiddenAPIAugmentationInfo(ctx)
outputPath := hiddenAPISingletonPaths(ctx).flags