Merge "Move API providing modules from bp2build to api_bp2build workspace"
This commit is contained in:
@@ -629,13 +629,10 @@ var (
|
||||
|
||||
Bp2buildModuleTypeAlwaysConvertList = []string{
|
||||
"aidl_interface_headers",
|
||||
"api_domain",
|
||||
"license",
|
||||
"linker_config",
|
||||
"java_import",
|
||||
"java_import_host",
|
||||
"ndk_headers",
|
||||
"ndk_library",
|
||||
"sysprop_library",
|
||||
"bpf",
|
||||
}
|
||||
|
@@ -67,7 +67,6 @@ func ApiDomainFactory() Module {
|
||||
m := &apiDomain{}
|
||||
m.AddProperties(&m.properties)
|
||||
InitAndroidArchModule(m, DeviceSupported, MultilibBoth)
|
||||
InitBazelModule(m)
|
||||
return m
|
||||
}
|
||||
|
||||
@@ -108,7 +107,9 @@ type bazelApiDomainAttributes struct {
|
||||
Cc_api_contributions bazel.LabelListAttribute
|
||||
}
|
||||
|
||||
func (a *apiDomain) ConvertWithBp2build(ctx TopDownMutatorContext) {
|
||||
var _ ApiProvider = (*apiDomain)(nil)
|
||||
|
||||
func (a *apiDomain) ConvertWithApiBp2build(ctx TopDownMutatorContext) {
|
||||
props := bazel.BazelTargetModuleProperties{
|
||||
Rule_class: "api_domain",
|
||||
Bzl_load_location: "//build/bazel/rules/apis:api_domain.bzl",
|
||||
|
@@ -60,7 +60,7 @@ func TestApiDomainContributionsTest(t *testing.T) {
|
||||
"target_compatible_with": `["//build/bazel/platforms/os:android"]`,
|
||||
},
|
||||
)
|
||||
RunBp2BuildTestCase(t, registerApiDomainModuleTypes, Bp2buildTestCase{
|
||||
RunApiBp2BuildTestCase(t, registerApiDomainModuleTypes, Bp2buildTestCase{
|
||||
Blueprint: bp,
|
||||
ExpectedBazelTargets: []string{expectedBazelTarget},
|
||||
Filesystem: fs,
|
||||
|
@@ -79,7 +79,7 @@ func TestNdkHeaderFilepaths(t *testing.T) {
|
||||
"hdrs": testCase.expectedHdrs,
|
||||
},
|
||||
)
|
||||
RunBp2BuildTestCase(t, cc.RegisterNdkModuleTypes, Bp2buildTestCase{
|
||||
RunApiBp2BuildTestCase(t, cc.RegisterNdkModuleTypes, Bp2buildTestCase{
|
||||
Description: testCase.desc,
|
||||
Blueprint: fmt.Sprintf(bpTemplate, testCase.srcs, testCase.excludeSrcs),
|
||||
ExpectedBazelTargets: []string{expectedBazelTarget},
|
||||
@@ -121,7 +121,7 @@ func TestNdkHeaderIncludeDir(t *testing.T) {
|
||||
"include_dir": testCase.expectedIncludeDir,
|
||||
},
|
||||
)
|
||||
RunBp2BuildTestCase(t, cc.RegisterNdkModuleTypes, Bp2buildTestCase{
|
||||
RunApiBp2BuildTestCase(t, cc.RegisterNdkModuleTypes, Bp2buildTestCase{
|
||||
Description: testCase.desc,
|
||||
Blueprint: fmt.Sprintf(bpTemplate, testCase.from),
|
||||
ExpectedBazelTargets: []string{expectedBazelTarget},
|
||||
@@ -156,7 +156,7 @@ func TestVersionedNdkHeaderFilepaths(t *testing.T) {
|
||||
]`,
|
||||
},
|
||||
)
|
||||
RunBp2BuildTestCase(t, cc.RegisterNdkModuleTypes, Bp2buildTestCase{
|
||||
RunApiBp2BuildTestCase(t, cc.RegisterNdkModuleTypes, Bp2buildTestCase{
|
||||
Blueprint: bp,
|
||||
Filesystem: fs,
|
||||
ExpectedBazelTargets: []string{expectedBazelTarget},
|
||||
|
@@ -37,7 +37,7 @@ func TestNdkLibraryContributionSymbolFile(t *testing.T) {
|
||||
"target_compatible_with": `["//build/bazel/platforms/os:android"]`,
|
||||
},
|
||||
)
|
||||
RunBp2BuildTestCase(t, cc.RegisterNdkModuleTypes, Bp2buildTestCase{
|
||||
RunApiBp2BuildTestCase(t, cc.RegisterNdkModuleTypes, Bp2buildTestCase{
|
||||
Blueprint: bp,
|
||||
ExpectedBazelTargets: []string{expectedBazelTarget},
|
||||
})
|
||||
@@ -69,7 +69,7 @@ func TestNdkLibraryContributionHeaders(t *testing.T) {
|
||||
"target_compatible_with": `["//build/bazel/platforms/os:android"]`,
|
||||
},
|
||||
)
|
||||
RunBp2BuildTestCase(t, cc.RegisterNdkModuleTypes, Bp2buildTestCase{
|
||||
RunApiBp2BuildTestCase(t, cc.RegisterNdkModuleTypes, Bp2buildTestCase{
|
||||
Blueprint: bp,
|
||||
Filesystem: fs,
|
||||
ExpectedBazelTargets: []string{expectedBazelTarget},
|
||||
|
7
cc/cc.go
7
cc/cc.go
@@ -3729,6 +3729,13 @@ func (c *Module) ConvertWithBp2build(ctx android.TopDownMutatorContext) {
|
||||
} else {
|
||||
sharedOrStaticLibraryBp2Build(ctx, c, false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var _ android.ApiProvider = (*Module)(nil)
|
||||
|
||||
func (c *Module) ConvertWithApiBp2build(ctx android.TopDownMutatorContext) {
|
||||
switch c.typ() {
|
||||
case ndkLibrary:
|
||||
ndkLibraryBp2build(ctx, c)
|
||||
}
|
||||
|
@@ -173,7 +173,9 @@ func createCcApiHeadersTarget(ctx android.TopDownMutatorContext, includes []stri
|
||||
}, attrs)
|
||||
}
|
||||
|
||||
func (h *headerModule) ConvertWithBp2build(ctx android.TopDownMutatorContext) {
|
||||
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)
|
||||
}
|
||||
@@ -192,7 +194,6 @@ func ndkHeadersFactory() android.Module {
|
||||
module := &headerModule{}
|
||||
module.AddProperties(&module.properties)
|
||||
android.InitAndroidModule(module)
|
||||
android.InitBazelModule(module)
|
||||
return module
|
||||
}
|
||||
|
||||
@@ -263,7 +264,9 @@ func (m *versionedHeaderModule) GenerateAndroidBuildActions(ctx android.ModuleCo
|
||||
processHeadersWithVersioner(ctx, fromSrcPath, toOutputPath, srcFiles, installPaths)
|
||||
}
|
||||
|
||||
func (h *versionedHeaderModule) ConvertWithBp2build(ctx android.TopDownMutatorContext) {
|
||||
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
|
||||
@@ -319,7 +322,6 @@ func versionedNdkHeadersFactory() android.Module {
|
||||
module.AddProperties(&module.properties)
|
||||
|
||||
android.InitAndroidModule(module)
|
||||
android.InitBazelModule(module)
|
||||
|
||||
return module
|
||||
}
|
||||
|
Reference in New Issue
Block a user