diff options
author | Paul Duffin <paulduffin@google.com> | 2023-08-11 22:47:31 +0100 |
---|---|---|
committer | Cherrypicker Worker <android-build-cherrypicker-worker@google.com> | 2023-09-13 12:03:02 +0000 |
commit | 8fa1eb0e161e1e145735b90ad23c53f63c042d39 (patch) | |
tree | 342d3eade6421090c0e3f998203417c2a7099ae0 | |
parent | a4158239a54dbbec2c958a14b53e53a13d9c01f3 (diff) | |
download | soong-8fa1eb0e161e1e145735b90ad23c53f63c042d39.tar.gz |
Pass the current API file to the metalava --use-same-format-as option
That will allow the format of a file to be changed by simply modifying
the signature format in the current API file (e.g. from `2.0` to `3.0`)
and then running `m update-api` and it will just update the current API
file (and the corresponding removed API file).
Bug: 295577788
Test: m checkapi && m update-api
# Also did as described above and modified the
# `libcore/api/current.txt` file from `2.0` to `3.0` and ran
# `m update-api` and checked that only that file and the
# corresponding `removed.text` file was changed.
(cherry picked from https://android-review.googlesource.com/q/commit:10a23c29e279ebfef4869cea72a65207e8de0cab)
Merged-In: I20c9bc151677502cf09b0c06fb442fd385caccdd
Change-Id: I20c9bc151677502cf09b0c06fb442fd385caccdd
-rw-r--r-- | java/droidstubs.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/java/droidstubs.go b/java/droidstubs.go index 9379b88aa..6e43b3233 100644 --- a/java/droidstubs.go +++ b/java/droidstubs.go @@ -695,6 +695,13 @@ func (d *Droidstubs) GenerateAndroidBuildActions(ctx android.ModuleContext) { cmd.FlagWithArg("--error-message:compatibility:released ", msg) } + if apiCheckEnabled(ctx, d.properties.Check_api.Current, "current") { + // Pass the current API file into metalava so it can use it as the basis for determining how to + // generate the output signature files (both api and removed). + currentApiFile := android.PathForModuleSrc(ctx, String(d.properties.Check_api.Current.Api_file)) + cmd.FlagWithInput("--use-same-format-as ", currentApiFile) + } + if generateStubs { rule.Command(). BuiltTool("soong_zip"). |