Search for default_team in Android.bp when other .bp files are included.
Test: m all_teams && gqui from "flatten(out/soong/ownership/all_teams.pb, teams)" proto build/soong/android/team_proto/team.proto:AllTeams 'select teams.path, count(*) where teams.trendy_team_id == "4768044190400512" and teams.path like "%libcore%" group by teams.path '
Now we get the libcore entries for JavaLibrary.bp and NativeCode.bp as
well. Before we didn't
...
| external/icu/android_icu4j/libcore_bridge/src/native/Android.bp | 1 |
| libcore/Android.bp | 3 |
| libcore/Extras.bp | 1 |
| libcore/JavaLibrary.bp | 82 |
| libcore/NativeCode.bp | 10 |
| libcore/benchmarks/Android.bp | 3 |
...
Note: blueprint does not let include a file from a subdirectory.
Bug: b/355270459
Change-Id: I19b22e341276c724786ea96e237733eac4f19dbf
diff --git a/android/all_teams.go b/android/all_teams.go
index e3c2e70..01be396 100644
--- a/android/all_teams.go
+++ b/android/all_teams.go
@@ -1,6 +1,7 @@
package android
import (
+ "path"
"path/filepath"
"android/soong/android/team_proto"
@@ -153,6 +154,11 @@
} else {
teamProperties, found = t.lookupDefaultTeam(m.bpFile)
}
+ // Deal with one blueprint file including another by looking up the default
+ // in the main Android.bp rather than one listed with "build = [My.bp]"
+ if !found {
+ teamProperties, found = t.lookupDefaultTeam(path.Join(path.Dir(m.bpFile), "Android.bp"))
+ }
trendy_team_id := ""
if found {