summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
author Jihoon Kang <jihoonkang@google.com> 2024-10-17 05:26:56 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2024-10-17 05:26:56 +0000
commite7e6ecc45de29cd011fe1857a8618f2633a165b3 (patch)
tree0810a9c76539151d2e5ac299f164649988b907bd /scripts
parent771d5726b153553de1c58485f1a6bc9851c8c79a (diff)
parent468024621289f2194f8e460442466f6fb4b3d8ef (diff)
Merge "Modify disabled flags to be exposed in keep-flagged-apis" into main am: 54bfc97ea3 am: 4680246212
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3312615 Change-Id: I4c43f8ee55cbf0f6e006456fa2ae4c5b172d6346 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/keep-flagged-apis.sh15
1 files changed, 3 insertions, 12 deletions
diff --git a/scripts/keep-flagged-apis.sh b/scripts/keep-flagged-apis.sh
index 9c48fdbad..48efb7a29 100755
--- a/scripts/keep-flagged-apis.sh
+++ b/scripts/keep-flagged-apis.sh
@@ -25,21 +25,12 @@ FLAGGED="android.annotation.FlaggedApi"
# Convert the list of feature flags in the input file to Metalava options
# of the form `--revert-annotation !android.annotation.FlaggedApi("<flag>")`
# to prevent the annotated APIs from being hidden, i.e. include the annotated
-# APIs in the SDK snapshots. This also preserves the line comments, they will
-# be ignored by Metalava but might be useful when debugging.
+# APIs in the SDK snapshots.
while read -r line; do
- key=$(echo "$line" | cut -d= -f1)
- value=$(echo "$line" | cut -d= -f2)
-
- # Skip if value is not true and line does not start with '#'
- if [[ ( $value != "true" ) && ( $line =~ ^[^#] )]]; then
- continue
- fi
-
# Escape and quote the key for sed
- escaped_key=$(echo "$key" | sed "s/'/\\\'/g; s/ /\\ /g")
+ escaped_line=$(echo "$line" | sed "s/'/\\\'/g; s/ /\\ /g")
- echo $line | sed "s|^[^#].*$|--revert-annotation '!$FLAGGED(\"$escaped_key\")'|"
+ echo "--revert-annotation '!$FLAGGED(\"$escaped_line\")'"
done < "$FLAGS"
# Revert all flagged APIs, unless listed above.