summaryrefslogtreecommitdiff
path: root/android/neverallow.go
diff options
context:
space:
mode:
Diffstat (limited to 'android/neverallow.go')
-rw-r--r--android/neverallow.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/android/neverallow.go b/android/neverallow.go
index 5b5e61328..f2e8c8534 100644
--- a/android/neverallow.go
+++ b/android/neverallow.go
@@ -59,6 +59,7 @@ func init() {
AddNeverAllowRules(createProhibitFrameworkAccessRules()...)
AddNeverAllowRules(createBp2BuildRule())
AddNeverAllowRules(createCcStubsRule())
+ AddNeverAllowRules(createJavaExcludeStaticLibsRule())
}
// Add a NeverAllow rule to the set of rules to apply.
@@ -253,6 +254,14 @@ func createProhibitFrameworkAccessRules() []Rule {
}
}
+func createJavaExcludeStaticLibsRule() Rule {
+ return NeverAllow().
+ NotIn("build/soong").
+ ModuleType("java_library").
+ WithMatcher("exclude_static_libs", isSetMatcherInstance).
+ Because("exclude_static_libs property is only allowed for java modules defined in build/soong")
+}
+
func neverallowMutator(ctx BottomUpMutatorContext) {
m, ok := ctx.Module().(Module)
if !ok {