From cf42e98eeff2ae6c6a62870d4848f50fee651e7e Mon Sep 17 00:00:00 2001 From: Anton Hansson Date: Thu, 13 Aug 2020 19:40:13 +0100 Subject: [PATCH] Make framework-res dep in stubs explicit The android.jar stubs includes the resource from framework-res. This dependency was previously added implicitly inside the build system, but using a java_genrule we can add it directly, which makes it easier to make changes to this rule. This change has the side-effect of adding the resources to some stubs that did not previously include the resources (e.g. module-libs), which I think is desired. Bug: 161214753 Test: build sdk, diff out/dist before and after (shows resources added to some stubs) Change-Id: I1829789af207cc45c49c0c68369fc7c0c085bcb0 Merged-In: I1829789af207cc45c49c0c68369fc7c0c085bcb0 --- StubLibraries.bp | 1 + core/res/Android.bp | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/StubLibraries.bp b/StubLibraries.bp index b999a10d0a3f2..146b848ef2d13 100644 --- a/StubLibraries.bp +++ b/StubLibraries.bp @@ -287,6 +287,7 @@ java_defaults { // License notices from art module "art-notices-for-framework-stubs-jar", + "framework-res-package-jar", // Export package of framework-res ], errorprone: { javacflags: [ diff --git a/core/res/Android.bp b/core/res/Android.bp index 3402033b04f10..99342b9d472aa 100644 --- a/core/res/Android.bp +++ b/core/res/Android.bp @@ -40,6 +40,13 @@ android_app { export_package_resources: true, } +java_genrule { + name: "framework-res-package-jar", + srcs: [":framework-res{.export-package.apk}"], + out: ["framework-res-package.jar"], + cmd: "cp $(in) $(out)", +} + // This logic can be removed once robolectric's transition to binary resources is complete filegroup { name: "robolectric_framework_raw_res_files",