Revert "Revert "Prevent runtime module paths being used in include_dirs""
This reverts commit ff3d72f0bf62ff4e8b7a947d38b386d93403bafa.
Repplies original change now that issue causing build breakage has been
resolved.
Adds a new StartsWith(string) ValueMatcher along with
With[Out]Matcher(...) methods to support new restrictions that prevent
any paths into runtime module repositories from being added to the
include_dirs.
Test: m nothing
Bug: 35624006
Change-Id: I4c802ef25ef56f0f9b0b5e9d75531ea6f7475714
diff --git a/android/neverallow_test.go b/android/neverallow_test.go
index 17e40f0..31f8187 100644
--- a/android/neverallow_test.go
+++ b/android/neverallow_test.go
@@ -23,6 +23,29 @@
fs map[string][]byte
expectedError string
}{
+ // include_dir rule tests
+ {
+ name: "include_dir not allowed to reference art",
+ fs: map[string][]byte{
+ "other/Blueprints": []byte(`
+ cc_library {
+ name: "libother",
+ include_dirs: ["art/libdexfile/include"],
+ }`),
+ },
+ expectedError: "all usages of 'art' have been migrated",
+ },
+ {
+ name: "include_dir can reference another location",
+ fs: map[string][]byte{
+ "other/Blueprints": []byte(`
+ cc_library {
+ name: "libother",
+ include_dirs: ["another/include"],
+ }`),
+ },
+ },
+ // Treble rule tests
{
name: "no vndk.enabled under vendor directory",
fs: map[string][]byte{
@@ -213,6 +236,7 @@
}
type mockCcLibraryProperties struct {
+ Include_dirs []string
Vendor_available *bool
Vndk struct {