Create api_domain module type and its bp2build converter

This module does not have any build actions in Soong yet. It will be
converted to a Bazel target using bp2build, and API export will be run
on the generated Bazel target

Test: go test ./bp2build
Test: TH
Change-Id: I76df32bd9f23b60e746b2700af07668a2ed74844
This commit is contained in:
Spandan Das
2022-09-06 17:31:48 +00:00
parent 62b75f4e4a
commit 81593891ee
4 changed files with 170 additions and 11 deletions

View File

@@ -147,16 +147,6 @@ func (m *headerModule) GenerateAndroidBuildActions(ctx android.ModuleContext) {
}
}
const (
apiContributionSuffix = ".contribution"
)
// apiContributionTargetName returns the name of the cc_api(headers|contribution) bp2build target of ndk modules
// A suffix is necessary to prevent a name collision with the base ndk_(library|header) target in the same bp2build bazel package
func apiContributionTargetName(moduleName string) string {
return moduleName + apiContributionSuffix
}
// TODO(b/243196151): Populate `system` and `arch` metadata
type bazelCcApiHeadersAttributes struct {
Hdrs bazel.LabelListAttribute
@@ -179,7 +169,7 @@ func createCcApiHeadersTarget(ctx android.TopDownMutatorContext, includes []stri
Include_dir: include_dir,
}
ctx.CreateBazelTargetModule(props, android.CommonAttributes{
Name: apiContributionTargetName(ctx.ModuleName()),
Name: android.ApiContributionTargetName(ctx.ModuleName()),
}, attrs)
}