Merge changes from topic "libbinder_ndk-remove-cpp-headers" into main am: 56aed2b0e8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3251042 Change-Id: Ib543856a377c18f68a8bb5cad585bc787b04e5c0 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -60,6 +60,7 @@ func init() {
|
||||
AddNeverAllowRules(createCcStubsRule())
|
||||
AddNeverAllowRules(createJavaExcludeStaticLibsRule())
|
||||
AddNeverAllowRules(createProhibitHeaderOnlyRule())
|
||||
AddNeverAllowRules(createLimitNdkExportRule()...)
|
||||
}
|
||||
|
||||
// Add a NeverAllow rule to the set of rules to apply.
|
||||
@@ -267,6 +268,22 @@ func createProhibitHeaderOnlyRule() Rule {
|
||||
Because("headers_only can only be used for generating framework-minus-apex headers for non-updatable modules")
|
||||
}
|
||||
|
||||
func createLimitNdkExportRule() []Rule {
|
||||
reason := "If the headers you're trying to export are meant to be a part of the NDK, they should be exposed by an ndk_headers module. If the headers shouldn't be a part of the NDK, the headers should instead be exposed from a separate `cc_library_headers` which consumers depend on."
|
||||
// DO NOT ADD HERE - please consult danalbert@
|
||||
// b/357711733
|
||||
return []Rule{
|
||||
NeverAllow().
|
||||
NotIn("frameworks/native/libs/binder/ndk").
|
||||
ModuleType("ndk_library").
|
||||
WithMatcher("export_header_libs", isSetMatcherInstance).Because(reason),
|
||||
NeverAllow().ModuleType("ndk_library").WithMatcher("export_generated_headers", isSetMatcherInstance).Because(reason),
|
||||
NeverAllow().ModuleType("ndk_library").WithMatcher("export_include_dirs", isSetMatcherInstance).Because(reason),
|
||||
NeverAllow().ModuleType("ndk_library").WithMatcher("export_shared_lib_headers", isSetMatcherInstance).Because(reason),
|
||||
NeverAllow().ModuleType("ndk_library").WithMatcher("export_static_lib_headers", isSetMatcherInstance).Because(reason),
|
||||
}
|
||||
}
|
||||
|
||||
func neverallowMutator(ctx BottomUpMutatorContext) {
|
||||
m, ok := ctx.Module().(Module)
|
||||
if !ok {
|
||||
|
Reference in New Issue
Block a user