From c6ba182f3c6dc8ba58675dc05262d2c8273c47a4 Mon Sep 17 00:00:00 2001 From: Paul Duffin Date: Fri, 6 May 2022 09:38:02 +0000 Subject: For each sdk built generate a JSON file describing its contents Some build scripts need to know information about the contents of an sdk, such as what APIs it provides (via java_sdk_library). Rather than duplicate that information in the scripts or attempt to access that information (where available) by looking at the contents of the snapshot this change generates a JSON file that sits alongside the snapshot itself. The info file can be generated without generating the snapshot zip file but whenever a snapshot zip file is generated the info is generated too. The info file sits alongside the zip file in out/mainline-sdks. Bug: 204763318 Test: m art-module-sdk m dist Change-Id: I289530bb21693dc6443826c24c17c9b5d85d2d8b --- sdk/java_sdk_test.go | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'sdk/java_sdk_test.go') diff --git a/sdk/java_sdk_test.go b/sdk/java_sdk_test.go index a99fa1ff0..9d0c3deb9 100644 --- a/sdk/java_sdk_test.go +++ b/sdk/java_sdk_test.go @@ -795,6 +795,44 @@ sdk_snapshot { .intermediates/myjavalib.stubs/android_common/javac/myjavalib.stubs.jar -> sdk_library/public/myjavalib-stubs.jar .intermediates/myjavalib.stubs.source/android_common/metalava/myjavalib.stubs.source_api.txt -> sdk_library/public/myjavalib.txt .intermediates/myjavalib.stubs.source/android_common/metalava/myjavalib.stubs.source_removed.txt -> sdk_library/public/myjavalib-removed.txt +`), + checkInfoContents(` +[ + { + "@type": "sdk", + "@name": "mysdk", + "java_header_libs": [ + "exported-system-module", + "system-module" + ], + "java_sdk_libs": [ + "myjavalib" + ], + "java_system_modules": [ + "my-system-modules" + ] + }, + { + "@type": "java_library", + "@name": "exported-system-module" + }, + { + "@type": "java_system_modules", + "@name": "my-system-modules", + "@deps": [ + "exported-system-module", + "system-module" + ] + }, + { + "@type": "java_sdk_library", + "@name": "myjavalib" + }, + { + "@type": "java_library", + "@name": "system-module" + } +] `), ) } -- cgit v1.2.3-59-g8ed1b