From b8ce081c1a4d523c4a2cea829850298c5a7422ce Mon Sep 17 00:00:00 2001 From: Anton Hansson Date: Tue, 24 Aug 2021 12:08:39 +0100 Subject: Make merged api compat checks output baseline When intentional API breakages are made, the incompatibilities tracking file must be updated. This makes the failing build rule output the baseline/incompatibilities file that would have made the build rule succeed. This file can then be used to update prebuilts/sdk. Whilst here, also make metalava quiet so we don't need to capture stdout. Test: make breaking change, build compat rule, inspect output dir Change-Id: Ia95b65548371329cd467fd3093db92b471e6986d --- api/Android.bp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'api') diff --git a/api/Android.bp b/api/Android.bp index fbfbc7cdef79..8dff60af8bbd 100644 --- a/api/Android.bp +++ b/api/Android.bp @@ -62,7 +62,7 @@ python_test_host { metalava_cmd = "$(location metalava)" // Silence reflection warnings. See b/168689341 metalava_cmd += " -J--add-opens=java.base/java.util=ALL-UNNAMED " -metalava_cmd += " --no-banner --format=v2 " +metalava_cmd += " --quiet --no-banner --format=v2 " genrule { name: "current-api-xml", @@ -118,13 +118,13 @@ genrule { ":android-incompatibilities.api.public.latest", ":frameworks-base-api-current.txt", ], - out: ["stdout.txt"], + out: ["updated-baseline.txt"], tools: ["metalava"], cmd: metalava_cmd + "--check-compatibility:api:released $(location :android.api.public.latest) " + "--baseline:compatibility:released $(location :android-incompatibilities.api.public.latest) " + - "$(location :frameworks-base-api-current.txt) " + - "> $(genDir)/stdout.txt", + "--update-baseline:compatibility:released $(genDir)/updated-baseline.txt " + + "$(location :frameworks-base-api-current.txt)", } genrule { @@ -231,14 +231,14 @@ genrule { ":frameworks-base-api-current.txt", ":frameworks-base-api-system-current.txt", ], - out: ["stdout.txt"], + out: ["updated-baseline.txt"], tools: ["metalava"], cmd: metalava_cmd + "--check-compatibility:api:released $(location :android.api.system.latest) " + "--check-compatibility:base $(location :frameworks-base-api-current.txt) " + "--baseline:compatibility:released $(location :android-incompatibilities.api.system.latest) " + - "$(location :frameworks-base-api-system-current.txt) " + - "> $(genDir)/stdout.txt", + "--update-baseline:compatibility:released $(genDir)/updated-baseline.txt " + + "$(location :frameworks-base-api-system-current.txt)", } genrule { @@ -320,7 +320,7 @@ genrule { ":frameworks-base-api-current.txt", ":frameworks-base-api-module-lib-current.txt", ], - out: ["stdout.txt"], + out: ["updated-baseline.txt"], tools: ["metalava"], cmd: metalava_cmd + "--check-compatibility:api:released $(location :android.api.module-lib.latest) " + @@ -329,8 +329,8 @@ genrule { // MODULE_LIBS -> public. "--check-compatibility:base $(location :frameworks-base-api-current.txt) " + "--baseline:compatibility:released $(location :android-incompatibilities.api.module-lib.latest) " + - "$(location :frameworks-base-api-module-lib-current.txt) " + - "> $(genDir)/stdout.txt", + "--update-baseline:compatibility:released $(genDir)/updated-baseline.txt " + + "$(location :frameworks-base-api-module-lib-current.txt)", } genrule { -- cgit v1.2.3-59-g8ed1b