#!/usr/bin/env bash
set -euo pipefail

out_adevtool_deps/host/linux-x86/bin/bpmodify -w -m aidl_test_nonvintf_parcelable -parameter frozen -set-bool false system/tools/aidl/tests/stability_test/Android.bp
mkdir -p system/tools/aidl/tests/stability_test/aidl_api/aidl_test_nonvintf_parcelable/current
rsync --recursive --update --delete-before out_adevtool_deps/soong/.intermediates/system/tools/aidl/tests/stability_test/aidl_test_nonvintf_parcelable_interface/dump/* system/tools/aidl/tests/stability_test/aidl_api/aidl_test_nonvintf_parcelable/current
out_adevtool_deps/host/linux-x86/bin/bpmodify -w -m aidl_test_nonvintf_parcelable -parameter versions -remove-property system/tools/aidl/tests/stability_test/Android.bp
out_adevtool_deps/host/linux-x86/bin/bpmodify -w -m aidl_test_nonvintf_parcelable -parameter versions_with_info -add-literal '{version: "1", imports: []}'  system/tools/aidl/tests/stability_test/Android.bp && out_adevtool_deps/host/linux-x86/bin/bpmodify -w -m aidl_test_nonvintf_parcelable -parameter frozen -set-bool true system/tools/aidl/tests/stability_test/Android.bp
