Search for files named Blueprints only under build/blueprint

to enable other subprojects to use their own instance of
Blueprint in other directories.

Files named Android.bp are still autodetected throughout the
tree like previously.

Bug: 64363847
Test: mkdir -p subdir \
      && echo "syntax error" > Blueprints \
      && m -j nothing

Test: build/soong/scripts/diff_build_graphs.sh \
      --products=aosp_arm \
      'build/soong:work^' 'build/soong:work'

Change-Id: I8199f12b68dc1699bf44682b86169def37b53a5e
This commit is contained in:
Jeff Gaston
2017-12-07 12:38:53 -08:00
parent 4b9bb14dd2
commit 29e959dd7f

View File

@@ -80,17 +80,8 @@ func FindSources(ctx Context, config Config, f *finder.Finder) {
ctx.Fatalf("Could not find modules: %v", err)
}
isBlueprintFile := func(dir finder.DirEntries) (dirs []string, files []string) {
files = []string{}
for _, file := range dir.FileNames {
if file == "Android.bp" || file == "Blueprints" {
files = append(files, file)
}
}
return dir.DirNames, files
}
androidBps := f.FindMatching(".", isBlueprintFile)
androidBps := f.FindNamedAt(".", "Android.bp")
androidBps = append(androidBps, f.FindNamedAt("build/blueprint", "Blueprints")...)
err = dumpListToFile(androidBps, filepath.Join(dumpDir, "Android.bp.list"))
if err != nil {
ctx.Fatalf("Could not find modules: %v", err)