summaryrefslogtreecommitdiff
path: root/api/api.go
diff options
context:
space:
mode:
author Anton Hansson <hansson@google.com> 2022-01-14 12:10:01 +0000
committer Anton Hansson <hansson@google.com> 2022-01-17 19:07:11 +0000
commit4468d7c6bf2d83612909fb78ab5b90b13bb08443 (patch)
treea185b4b62c9c2810542e4afe3bb0a514f2576c73 /api/api.go
parentfd31645f856fe55872ea6379ce59dc62557d4a96 (diff)
Create a filegroup for public stub sources
For use by framework-doc-stubs, to avoid duplicating the list of modules there. Bug: 169103987 Test: m framework-doc-stubs ; diff intermediates before & after Merged-In: Ib1a1d1bb9fcf866278c6ddd057712a9c92716dbf Change-Id: Ib1a1d1bb9fcf866278c6ddd057712a9c92716dbf
Diffstat (limited to 'api/api.go')
-rw-r--r--api/api.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/api/api.go b/api/api.go
index e4c1b969226f..4b6ebc1947e9 100644
--- a/api/api.go
+++ b/api/api.go
@@ -81,6 +81,12 @@ type libraryProps struct {
Visibility []string
}
+type fgProps struct {
+ Name *string
+ Srcs []string
+ Visibility []string
+}
+
// Struct to pass parameters for the various merged [current|removed].txt file modules we create.
type MergedTxtDefinition struct {
// "current.txt" or "removed.txt"
@@ -188,6 +194,14 @@ func createMergedModuleLibStubs(ctx android.LoadHookContext, modules []string) {
ctx.CreateModule(java.LibraryFactory, &props)
}
+func createPublicStubsSourceFilegroup(ctx android.LoadHookContext, modules []string) {
+ props := fgProps{}
+ props.Name = proptools.StringPtr("all-modules-public-stubs-source")
+ props.Srcs = createSrcs(modules, "{.public.stubs.source}")
+ props.Visibility = []string{"//frameworks/base"}
+ ctx.CreateModule(android.FileGroupFactory, &props)
+}
+
func createMergedTxts(ctx android.LoadHookContext, bootclasspath, system_server_classpath []string) {
var textFiles []MergedTxtDefinition
// Two module libraries currently do not support @SystemApi so only have the public scope.
@@ -244,6 +258,8 @@ func (a *CombinedApis) createInternalModules(ctx android.LoadHookContext) {
createMergedAnnotations(ctx, bootclasspath)
createFilteredApiVersions(ctx, bootclasspath)
+
+ createPublicStubsSourceFilegroup(ctx, bootclasspath)
}
func combinedApisModuleFactory() android.Module {