Multi-tree API bp2build converter for ndk_library
This is a partial bp2build conversion that only emits the
cc_api_contribution target of ndk_library. We also need to convert this
to cc_stub_suite eventually to enable building vendor/product API
domains with Bazel
Also create an enum for the three known Multi-tree API surfaces (will
likely be expanded in the future)
Test: go test ./bp2build
Test: b cquery //bionic/libc:libc.ndk.contribution --output=starlark
--starlark:expr="providers(target)"
Change-Id: Idb24871ba20aae132b61eb31ef35c917cacae9e1
diff --git a/android/api_domain.go b/android/api_domain.go
index a808e32..8ff4752 100644
--- a/android/api_domain.go
+++ b/android/api_domain.go
@@ -28,6 +28,28 @@
ctx.RegisterModuleType("api_domain", ApiDomainFactory)
}
+type ApiSurface int
+
+// TODO(b/246656800): Reconcile with android.SdkKind
+const (
+ PublicApi ApiSurface = iota
+ SystemApi
+ VendorApi
+)
+
+func (a ApiSurface) String() string {
+ switch a {
+ case PublicApi:
+ return "publicapi"
+ case SystemApi:
+ return "systemapi"
+ case VendorApi:
+ return "vendorapi"
+ default:
+ return "invalid"
+ }
+}
+
type apiDomain struct {
ModuleBase
BazelModuleBase