From a3be792b100723d310ad1f40a10a1a9d4560a00a Mon Sep 17 00:00:00 2001 From: Sasha Smundak Date: Mon, 14 Jun 2021 10:56:24 -0700 Subject: [PATCH] Wrapper script to use Starlark-based configuration Test: manual Bug: 181797530 Change-Id: I51edea16982386a1022c77ddd282e95b2c5d77a2 --- scripts/rbc-run | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 scripts/rbc-run diff --git a/scripts/rbc-run b/scripts/rbc-run new file mode 100755 index 000000000..e2fa6d1be --- /dev/null +++ b/scripts/rbc-run @@ -0,0 +1,16 @@ +#! /bin/bash +# Convert and run one configuration +# Args: - +[[ $# -eq 1 && "$1" =~ ^(.*)-(.*)$ ]] || { echo Usage: ${0##*/} PRODUCT-VARIANT >&2; exit 1; } +declare -r product="${BASH_REMATCH[1]:-aosp_arm}" +declare -r variant="${BASH_REMATCH[2]:-eng}" +set -eu +declare -r output_root=${OUT_DIR:-out} +declare -r runner="$output_root/soong/.bootstrap/bin/rbcrun" +declare -r converter="$output_root/soong/.bootstrap/bin/mk2rbc" +declare -r launcher=$output_root/launchers/run.rbc +$converter -mode=write -r --outdir $output_root --launcher=$launcher $product +printf "#TARGET_PRODUCT=$product TARGET_BUILD_VARIANT=$variant\n" +env TARGET_PRODUCT=$product TARGET_BUILD_VARIANT=$variant \ + $runner RBC_OUT="make,global" RBC_DEBUG="${RBC_DEBUG:-}" $launcher +