summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jihoon Kang <jihoonkang@google.com> 2024-10-17 04:50:17 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2024-10-17 04:50:17 +0000
commit54bfc97ea32568bd20467f7a8ff86813192379b1 (patch)
tree3dd0de797b241dda62f9867fdb26befc3666cb4e
parent91dd27206a001798eaa2a7d9dd2a503434c128b3 (diff)
parent01977217a6fa56a5e587468165555ccbd31f2b8b (diff)
Merge "Modify disabled flags to be exposed in keep-flagged-apis" into main
-rw-r--r--java/builder.go2
-rwxr-xr-xscripts/keep-flagged-apis.sh15
2 files changed, 4 insertions, 13 deletions
diff --git a/java/builder.go b/java/builder.go
index e5d510923..895ddb6f9 100644
--- a/java/builder.go
+++ b/java/builder.go
@@ -301,7 +301,7 @@ var (
gatherReleasedFlaggedApisRule = pctx.AndroidStaticRule("gatherReleasedFlaggedApisRule",
blueprint.RuleParams{
- Command: `${aconfig} dump-cache --dedup --format='{fully_qualified_name}={state:bool}' ` +
+ Command: `${aconfig} dump-cache --dedup --format='{fully_qualified_name}' ` +
`--out ${out} ` +
`${flags_path} ` +
`${filter_args} `,
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.