Deprecate api bp2build of ndk_library and ndk_headers

To support export of NDK APIs in multi-tree, we added functionality to
generate Bazel targets of ndk related Soong module types. Since this use
case does not exist anymore, deprecate this to prevent bitrot

The removed code includes
- `ConvertWithApi2Build` implementation of these libraries, which
  generates the Bazel targets in the synthetic `api_bp2build` workspace
- (api) bp2build unit tests for these module types

Test: go build ./cc
Bug: 284029211
Change-Id: Id3278fa119e0ab87f31f39a3783197a81b655e43
This commit is contained in:
Spandan Das
2023-05-30 23:09:36 +00:00
parent ff007311e3
commit 230c312f83
6 changed files with 0 additions and 311 deletions

View File

@@ -19,10 +19,8 @@ import (
"path/filepath"
"github.com/google/blueprint"
"github.com/google/blueprint/proptools"
"android/soong/android"
"android/soong/bazel"
)
var (
@@ -81,7 +79,6 @@ type headerProperties struct {
type headerModule struct {
android.ModuleBase
android.BazelModuleBase
properties headerProperties
@@ -147,39 +144,6 @@ func (m *headerModule) GenerateAndroidBuildActions(ctx android.ModuleContext) {
}
}
// TODO(b/243196151): Populate `system` and `arch` metadata
type bazelCcApiHeadersAttributes struct {
Hdrs bazel.LabelListAttribute
Include_dir *string
}
func createCcApiHeadersTarget(ctx android.TopDownMutatorContext, includes []string, excludes []string, include_dir *string) {
props := bazel.BazelTargetModuleProperties{
Rule_class: "cc_api_headers",
Bzl_load_location: "//build/bazel/rules/apis:cc_api_contribution.bzl",
}
attrs := &bazelCcApiHeadersAttributes{
Hdrs: bazel.MakeLabelListAttribute(
android.BazelLabelForModuleSrcExcludes(
ctx,
includes,
excludes,
),
),
Include_dir: include_dir,
}
ctx.CreateBazelTargetModule(props, android.CommonAttributes{
Name: android.ApiContributionTargetName(ctx.ModuleName()),
}, attrs)
}
var _ android.ApiProvider = (*headerModule)(nil)
func (h *headerModule) ConvertWithApiBp2build(ctx android.TopDownMutatorContext) {
// Generate `cc_api_headers` target for Multi-tree API export
createCcApiHeadersTarget(ctx, h.properties.Srcs, h.properties.Exclude_srcs, h.properties.From)
}
// ndk_headers installs the sets of ndk headers defined in the srcs property
// to the sysroot base + "usr/include" + to directory + directory component.
// ndk_headers requires the license file to be specified. Example:
@@ -226,7 +190,6 @@ type versionedHeaderProperties struct {
// Note that this is really only built to handle bionic/libc/include.
type versionedHeaderModule struct {
android.ModuleBase
android.BazelModuleBase
properties versionedHeaderProperties
@@ -264,15 +227,6 @@ func (m *versionedHeaderModule) GenerateAndroidBuildActions(ctx android.ModuleCo
processHeadersWithVersioner(ctx, fromSrcPath, toOutputPath, srcFiles, installPaths)
}
var _ android.ApiProvider = (*versionedHeaderModule)(nil)
func (h *versionedHeaderModule) ConvertWithApiBp2build(ctx android.TopDownMutatorContext) {
// Glob all .h files under `From`
includePattern := headerGlobPattern(proptools.String(h.properties.From))
// Generate `cc_api_headers` target for Multi-tree API export
createCcApiHeadersTarget(ctx, []string{includePattern}, []string{}, h.properties.From)
}
func processHeadersWithVersioner(ctx android.ModuleContext, srcDir, outDir android.Path,
srcFiles android.Paths, installPaths []android.WritablePath) android.Path {
// The versioner depends on a dependencies directory to simplify determining include paths