Modify extractStubsSourceInfoFromDep to respect RELEASE_HIDDEN_API_EXPORTABLE_STUBS flag
Currently, extractStubsSourceInfoFromDep always return the "everything" stub artifacts. This change modifies such behavior so that the "exportable" artifacts are set when `RELEASE_HIDDEN_API_EXPORTABLE_STUBS` build flag is set to true. Test: m nothing --no-skip-soong-tests Bug: 348370901 Change-Id: I1cf0ff7a63c8a580c3553a817ca303d6e8734a2a
This commit is contained in:
@@ -819,22 +819,23 @@ func (paths *scopePaths) extractStubsSourceInfoFromApiStubsProviders(provider Ap
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (paths *scopePaths) extractStubsSourceInfoFromDep(ctx android.ModuleContext, dep android.Module) error {
|
func (paths *scopePaths) extractStubsSourceInfoFromDep(ctx android.ModuleContext, dep android.Module) error {
|
||||||
|
stubsType := Everything
|
||||||
|
if ctx.Config().ReleaseHiddenApiExportableStubs() {
|
||||||
|
stubsType = Exportable
|
||||||
|
}
|
||||||
return paths.treatDepAsApiStubsSrcProvider(dep, func(provider ApiStubsSrcProvider) error {
|
return paths.treatDepAsApiStubsSrcProvider(dep, func(provider ApiStubsSrcProvider) error {
|
||||||
return paths.extractStubsSourceInfoFromApiStubsProviders(provider, Everything)
|
return paths.extractStubsSourceInfoFromApiStubsProviders(provider, stubsType)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (paths *scopePaths) extractStubsSourceAndApiInfoFromApiStubsProvider(ctx android.ModuleContext, dep android.Module) error {
|
func (paths *scopePaths) extractStubsSourceAndApiInfoFromApiStubsProvider(ctx android.ModuleContext, dep android.Module) error {
|
||||||
|
stubsType := Everything
|
||||||
if ctx.Config().ReleaseHiddenApiExportableStubs() {
|
if ctx.Config().ReleaseHiddenApiExportableStubs() {
|
||||||
return paths.treatDepAsApiStubsProvider(dep, func(provider ApiStubsProvider) error {
|
stubsType = Exportable
|
||||||
extractApiInfoErr := paths.extractApiInfoFromApiStubsProvider(provider, Exportable)
|
|
||||||
extractStubsSourceInfoErr := paths.extractStubsSourceInfoFromApiStubsProviders(provider, Exportable)
|
|
||||||
return errors.Join(extractApiInfoErr, extractStubsSourceInfoErr)
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
return paths.treatDepAsApiStubsProvider(dep, func(provider ApiStubsProvider) error {
|
return paths.treatDepAsApiStubsProvider(dep, func(provider ApiStubsProvider) error {
|
||||||
extractApiInfoErr := paths.extractApiInfoFromApiStubsProvider(provider, Everything)
|
extractApiInfoErr := paths.extractApiInfoFromApiStubsProvider(provider, stubsType)
|
||||||
extractStubsSourceInfoErr := paths.extractStubsSourceInfoFromApiStubsProviders(provider, Everything)
|
extractStubsSourceInfoErr := paths.extractStubsSourceInfoFromApiStubsProviders(provider, stubsType)
|
||||||
return errors.Join(extractApiInfoErr, extractStubsSourceInfoErr)
|
return errors.Join(extractApiInfoErr, extractStubsSourceInfoErr)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user