AIDL source generation accounts for Bazel paths
The AIDL source generation rule sets include flags based on the relative
path of .aidl sources. For .aidl sources provided by Bazel targets, e.g.
in a filegroup, the same directory could be added to the include path
twice. Instead we need to ensure that if a Bazel source provides the
include path, that we don't add it again from a Soong source.
Bug: 229251008
Test: USE_BAZEL_ANALYSIS=1 m api-stubs-docs-non-updatable
Change-Id: I4997039003242b43e0e52ccf41729acb4ad11324
diff --git a/android/paths.go b/android/paths.go
index 74d9f13..1f69125 100644
--- a/android/paths.go
+++ b/android/paths.go
@@ -1978,6 +1978,18 @@
return testPath{basePath{path: p, rel: p}}
}
+func PathForTestingWithRel(path, rel string) Path {
+ p, err := validateSafePath(path, rel)
+ if err != nil {
+ panic(err)
+ }
+ r, err := validatePath(rel)
+ if err != nil {
+ panic(err)
+ }
+ return testPath{basePath{path: p, rel: r}}
+}
+
// PathsForTesting returns a Path constructed from each element in strs. It should only be used from within tests.
func PathsForTesting(strs ...string) Paths {
p := make(Paths, len(strs))