summaryrefslogtreecommitdiff
path: root/android/api_domain.go
diff options
context:
space:
mode:
author Spandan Das <spandandas@google.com> 2022-08-19 18:17:28 +0000
committer Spandan Das <spandandas@google.com> 2022-09-21 19:49:46 +0000
commit1278c2cb243080bd9ee7d91474101066b1b74052 (patch)
tree811d26162d083aefe76af883b5296ad056b9f2d6 /android/api_domain.go
parent81593891ee883d04de0d241cd2fb89a6e0a8ad88 (diff)
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
Diffstat (limited to 'android/api_domain.go')
-rw-r--r--android/api_domain.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/android/api_domain.go b/android/api_domain.go
index a808e3260..8ff475287 100644
--- a/android/api_domain.go
+++ b/android/api_domain.go
@@ -28,6 +28,28 @@ func RegisterApiDomainBuildComponents(ctx RegistrationContext) {
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