'android - simplify src path without hardcode

I would like to remove the hardcode file path from Android.mk.

ifeq ($(TARGET_BUILD_VARIANT),user)
  LOCAL_SRC_FILES     := ./app/build/outputs/apk/release/app-release.apk
else
  LOCAL_SRC_FILES     := ./app/build/outputs/apk/debug/app-debug.apk
endif

Maybe I can run a find command but not sure how can I get the user version with from release folder and userdebug version from debug folder.

Maybe something like below:

LOCAL_SRC_FILES :=$(some command)



Solution 1:[1]

Something like below:

LOCAL_SRC_FILES  := $(shell find -name '*.apk'|grep '$(FOLDER)/.*$(ARCH)')

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 beetlej