bp2build for ndk_headers
Create bp2build converters for the following module types
- ndk_headers
- versioned_ndk_headers
Details
- Partial bp2build conversion. Only `cc_api_headers` targets will be
generted within the scope of this CL
- Glob expansion. Aligned with other bp2build converters, this impl will
expand globs in Android.bp so that all .h files are explicitly listed
in the generated BUILD files. As an extreme example, the size of
out/soong/workspace/bionic/libc/BUILD will increase from ~170KB to
~230KB (33% increase). This makes the BUILD files less readable, and
`cc_api_headers` section of the BUILD file should probably not be
checked into the tree in this format
Test: b cquery //bionic/libc:libc_uapi --output=starlark
--starlark:expr="providers(target).get('//build/bazel/rules/apis:cc_api_contribution.bzl%CcApiHeaderInfo')"
Test: go test ./bp2build
Test: go test ./cc
Change-Id: I810d5380f72dc90f4cdf4aa508570f3a80d8d932
diff --git a/cc/ndk_sysroot.go b/cc/ndk_sysroot.go
index 6c200f5..622558e 100644
--- a/cc/ndk_sysroot.go
+++ b/cc/ndk_sysroot.go
@@ -57,15 +57,18 @@
)
func init() {
- android.RegisterModuleType("ndk_headers", ndkHeadersFactory)
- android.RegisterModuleType("ndk_library", NdkLibraryFactory)
- android.RegisterModuleType("versioned_ndk_headers", versionedNdkHeadersFactory)
- android.RegisterModuleType("preprocessed_ndk_headers", preprocessedNdkHeadersFactory)
- android.RegisterSingletonType("ndk", NdkSingleton)
-
+ RegisterNdkModuleTypes(android.InitRegistrationContext)
pctx.Import("android/soong/android")
}
+func RegisterNdkModuleTypes(ctx android.RegistrationContext) {
+ ctx.RegisterModuleType("ndk_headers", ndkHeadersFactory)
+ ctx.RegisterModuleType("ndk_library", NdkLibraryFactory)
+ ctx.RegisterModuleType("versioned_ndk_headers", versionedNdkHeadersFactory)
+ ctx.RegisterModuleType("preprocessed_ndk_headers", preprocessedNdkHeadersFactory)
+ ctx.RegisterSingletonType("ndk", NdkSingleton)
+}
+
func getNdkInstallBase(ctx android.PathContext) android.InstallPath {
return android.PathForNdkInstall(ctx)
}