Merge "Ensure boot jar modules have been initialized properly for hidden API" am: 08abf7274a
am: 45027631f3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1674030 Change-Id: Ib5d41670b0fdb8dd1af0299a54fc6eadcb8ed0f5
This commit is contained in:
@@ -111,6 +111,13 @@ type hiddenAPIIntf interface {
|
|||||||
|
|
||||||
var _ hiddenAPIIntf = (*hiddenAPI)(nil)
|
var _ hiddenAPIIntf = (*hiddenAPI)(nil)
|
||||||
|
|
||||||
|
// hiddenAPISupportingModule is the interface that is implemented by any module that supports
|
||||||
|
// contributing to the hidden API processing.
|
||||||
|
type hiddenAPISupportingModule interface {
|
||||||
|
android.Module
|
||||||
|
hiddenAPIIntf
|
||||||
|
}
|
||||||
|
|
||||||
// Initialize the hiddenapi structure
|
// Initialize the hiddenapi structure
|
||||||
func (h *hiddenAPI) initHiddenAPI(ctx android.BaseModuleContext, configurationName string) {
|
func (h *hiddenAPI) initHiddenAPI(ctx android.BaseModuleContext, configurationName string) {
|
||||||
// If hiddenapi processing is disabled treat this as inactive.
|
// If hiddenapi processing is disabled treat this as inactive.
|
||||||
|
@@ -303,17 +303,37 @@ func (b *platformBootclasspathModule) generateHiddenAPIBuildActions(ctx android.
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
moduleSpecificFlagsPaths := android.Paths{}
|
hiddenAPISupportingModules := []hiddenAPISupportingModule{}
|
||||||
for _, module := range modules {
|
for _, module := range modules {
|
||||||
if h, ok := module.(hiddenAPIIntf); ok {
|
if h, ok := module.(hiddenAPISupportingModule); ok {
|
||||||
if csv := h.flagsCSV(); csv != nil {
|
if h.bootDexJar() == nil {
|
||||||
moduleSpecificFlagsPaths = append(moduleSpecificFlagsPaths, csv)
|
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 {
|
} 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)
|
augmentationInfo := b.properties.Hidden_api.hiddenAPIAugmentationInfo(ctx)
|
||||||
|
|
||||||
outputPath := hiddenAPISingletonPaths(ctx).flags
|
outputPath := hiddenAPISingletonPaths(ctx).flags
|
||||||
|
Reference in New Issue
Block a user