diff options
Diffstat (limited to 'android/neverallow.go')
-rw-r--r-- | android/neverallow.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/android/neverallow.go b/android/neverallow.go index 526d39949..73829f137 100644 --- a/android/neverallow.go +++ b/android/neverallow.go @@ -56,6 +56,7 @@ func init() { AddNeverAllowRules(createJavaDeviceForHostRules()...) AddNeverAllowRules(createCcSdkVariantRules()...) AddNeverAllowRules(createUncompressDexRules()...) + AddNeverAllowRules(createMakefileGoalRules()...) } // Add a NeverAllow rule to the set of rules to apply. @@ -231,6 +232,15 @@ func createUncompressDexRules() []Rule { } } +func createMakefileGoalRules() []Rule { + return []Rule{ + NeverAllow(). + ModuleType("makefile_goal"). + WithoutMatcher("product_out_path", Regexp("^boot[0-9a-zA-Z.-]*[.]img$")). + Because("Only boot images may be imported as a makefile goal."), + } +} + func neverallowMutator(ctx BottomUpMutatorContext) { m, ok := ctx.Module().(Module) if !ok { |