0

While build my APK in the AOSP environment, I want to create a temporary resource file which can be generated like this:

echo "<?xml version=\"1.0\" encoding=\"utf-8\"?><resources><string name=\"my_tmp_string\" translatable=\"false\">$SOME_ENV_VAR</string></resources>" > res/values/tmp.xml

However, put this in the Android.mk does not work. Does anyone know how to do this?

Robin
  • 10,052
  • 6
  • 31
  • 52

1 Answers1

0

Try storing the command in a separate shell file like "generate_res.sh" for example, and afterward add a call to your Android.mk file like this:

$(info $(shell ($(LOCAL_PATH)/PATH_TO_FILE/generate_res.sh)))

ItWillDo
  • 468
  • 4
  • 9
  • Then how can I use $(LOCAL_PATH) in the shell script? – Robin May 18 '17 at 02:05
  • I haven't tried this myself yet, but you can always try passing it as an argument: `$(info $(shell ($(LOCAL_PATH)/PATH_TO_FILE/generate_res.sh) $(LOCAL_PATH)))` And in the script, get the argument using **$1** – ItWillDo May 19 '17 at 07:35