layoutlib: Use wildcard to find device overlays
The layoutlib_data.mk file uses `$(shell find ...)` to locate
device-specific framework overlays for a hardcoded list of products.
When a user's source tree does not contain all of these device
directories, the `find` command outputs a "No such file or directory"
error for each missing path, spamming the build log.
Replace the `shell find` call with the idiomatic GNU Make `wildcard`
function. `wildcard` correctly finds all existing files that match
the patterns without generating errors for non-existent paths.
This cleans up the build output and is slightly more efficient as it
avoids forking a shell process.
Change-Id: I2f4d6c593b073bd3955c0fd88d2cc699526e261c
Signed-off-by: Dmitrii <bankersenator@gmail.com>
diff --git a/core/layoutlib_data.mk b/core/layoutlib_data.mk
index 5dde50f..b4206b5 100644
--- a/core/layoutlib_data.mk
+++ b/core/layoutlib_data.mk
@@ -78,8 +78,8 @@
LAYOUTLIB_RES_FILES := $(shell find frameworks/base/core/res/res -type f -not -path 'frameworks/base/core/res/res/values-m[nc]c*' | sort)
EMULATED_OVERLAYS_FILES := $(shell find frameworks/base/packages/overlays/*/res/ | sort)
LAYOUTLIB_SUPPORTED_DEVICES := raviole/oriole raviole/raven bluejay/bluejay pantah/panther pantah/cheetah lynx/lynx felix/felix shusky/shiba shusky/husky akita/akita caimito/tokay caimito/caiman caimito/komodo comet/comet tangorpro/tangorpro
-LAYOUTLIB_DEVICE_OVERLAYS_FILES := $(addsuffix /overlay/frameworks/base/core/res/res/values/*, $(addprefix device/google/, $(LAYOUTLIB_SUPPORTED_DEVICES)))
-LAYOUTLIB_DEVICE_OVERLAYS_FILES := $(shell find $(LAYOUTLIB_DEVICE_OVERLAYS_FILES) | sort)
+layoutlib_device_overlay_patterns := $(addsuffix /overlay/frameworks/base/core/res/res/values/*, $(addprefix device/google/, $(LAYOUTLIB_SUPPORTED_DEVICES)))
+LAYOUTLIB_DEVICE_OVERLAYS_FILES := $(sort $(wildcard $(_layoutlib_device_overlay_patterns)))
$(LAYOUTLIB_RES)/layoutlib-res.zip: $(SOONG_ZIP) $(HOST_OUT_EXECUTABLES)/aapt2 $(LAYOUTLIB_RES_FILES) $(EMULATED_OVERLAYS_FILES) $(LAYOUTLIB_DEVICE_OVERLAYS_FILES) frameworks/layoutlib/overlay_codenames.txt
rm -rf $@
echo $(LAYOUTLIB_RES_FILES) > $(LAYOUTLIB_RES)/filelist_res.txt