Look for the AndroidProduct.mk files in the vendor/ hierarchy, too
Bug: 182418325 Test: N/A Change-Id: I17048b5fda3ac83ca7c2b359abe94ab5ced91511
This commit is contained in:
@@ -202,8 +202,7 @@ func quit(s interface{}) {
|
|||||||
func buildProductConfigMap() map[string]string {
|
func buildProductConfigMap() map[string]string {
|
||||||
const androidProductsMk = "AndroidProducts.mk"
|
const androidProductsMk = "AndroidProducts.mk"
|
||||||
// Build the list of AndroidProducts.mk files: it's
|
// Build the list of AndroidProducts.mk files: it's
|
||||||
// build/make/target/product/AndroidProducts.mk plus
|
// build/make/target/product/AndroidProducts.mk + device/**/AndroidProducts.mk plus + vendor/**/AndroidProducts.mk
|
||||||
// device/**/AndroidProducts.mk
|
|
||||||
targetAndroidProductsFile := filepath.Join(*rootDir, "build", "make", "target", "product", androidProductsMk)
|
targetAndroidProductsFile := filepath.Join(*rootDir, "build", "make", "target", "product", androidProductsMk)
|
||||||
if _, err := os.Stat(targetAndroidProductsFile); err != nil {
|
if _, err := os.Stat(targetAndroidProductsFile); err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "%s: %s\n(hint: %s is not a source tree root)\n",
|
fmt.Fprintf(os.Stderr, "%s: %s\n(hint: %s is not a source tree root)\n",
|
||||||
@@ -213,17 +212,19 @@ func buildProductConfigMap() map[string]string {
|
|||||||
if err := mk2rbc.UpdateProductConfigMap(productConfigMap, targetAndroidProductsFile); err != nil {
|
if err := mk2rbc.UpdateProductConfigMap(productConfigMap, targetAndroidProductsFile); err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "%s: %s\n", targetAndroidProductsFile, err)
|
fmt.Fprintf(os.Stderr, "%s: %s\n", targetAndroidProductsFile, err)
|
||||||
}
|
}
|
||||||
_ = filepath.Walk(filepath.Join(*rootDir, "device"),
|
for _, t := range []string{"device", "vendor"} {
|
||||||
func(path string, info os.FileInfo, err error) error {
|
_ = filepath.WalkDir(filepath.Join(*rootDir, t),
|
||||||
if info.IsDir() || filepath.Base(path) != androidProductsMk {
|
func(path string, d os.DirEntry, err error) error {
|
||||||
|
if err != nil || d.IsDir() || filepath.Base(path) != androidProductsMk {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
if err2 := mk2rbc.UpdateProductConfigMap(productConfigMap, path); err2 != nil {
|
||||||
|
fmt.Fprintf(os.Stderr, "%s: %s\n", path, err)
|
||||||
|
// Keep going, we want to find all such errors in a single run
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
})
|
||||||
if err2 := mk2rbc.UpdateProductConfigMap(productConfigMap, path); err2 != nil {
|
}
|
||||||
fmt.Fprintf(os.Stderr, "%s: %s\n", path, err)
|
|
||||||
// Keep going, we want to find all such errors in a single run
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
})
|
|
||||||
return productConfigMap
|
return productConfigMap
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user