Create a bp2build converter for ndk_headers
And add this module type to alwaysConvertList
Test: go test ./bp2build
Bug: 300504837
Change-Id: Ic09738ab47e7c497287b73de0f952d52aa78dd17
diff --git a/bp2build/cc_library_conversion_test.go b/bp2build/cc_library_conversion_test.go
index ec603c2..c116008 100644
--- a/bp2build/cc_library_conversion_test.go
+++ b/bp2build/cc_library_conversion_test.go
@@ -5184,3 +5184,30 @@
}
runCcLibraryTestCase(t, tc)
}
+
+func TestNdkHeadersConversion(t *testing.T) {
+ tc := Bp2buildTestCase{
+ Description: "ndk_headers conversion",
+ ModuleTypeUnderTest: "ndk_headers",
+ ModuleTypeUnderTestFactory: cc.NdkHeadersFactory,
+ Blueprint: `
+ndk_headers {
+ name: "libfoo_headers",
+ from: "from",
+ to: "to",
+ srcs: ["foo.h", "foo_other.h"]
+}
+`,
+ ExpectedBazelTargets: []string{
+ MakeBazelTargetNoRestrictions("ndk_headers", "libfoo_headers", AttrNameToString{
+ "strip_import_prefix": `"from"`,
+ "import_prefix": `"to"`,
+ "hdrs": `[
+ "foo.h",
+ "foo_other.h",
+ ]`,
+ }),
+ },
+ }
+ runCcLibraryTestCase(t, tc)
+}