From 4e77284ab45ff1e49b8ca7993516c32152467d10 Mon Sep 17 00:00:00 2001 From: Paul Duffin Date: Wed, 24 Jun 2020 12:10:42 +0100 Subject: [PATCH] Include resources in sdk snapshot of java library impl Bug: 159607838 Test: m nothing Change-Id: Ie7ddbffc3957f832abfadb27292c436e8e5dcbf3 --- java/java.go | 2 +- sdk/java_sdk_test.go | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/java/java.go b/java/java.go index 7a4255745..7d32c3406 100644 --- a/java/java.go +++ b/java/java.go @@ -44,7 +44,7 @@ func init() { PropertyName: "java_libs", }, func(j *Library) android.Path { - implementationJars := j.ImplementationJars() + implementationJars := j.ImplementationAndResourcesJars() if len(implementationJars) != 1 { panic(fmt.Errorf("there must be only one implementation jar from %q", j.Name())) } diff --git a/sdk/java_sdk_test.go b/sdk/java_sdk_test.go index 77a4e94b3..7496b207d 100644 --- a/sdk/java_sdk_test.go +++ b/sdk/java_sdk_test.go @@ -23,6 +23,7 @@ func testSdkWithJava(t *testing.T, bp string) *testSdkResult { fs := map[string][]byte{ "Test.java": nil, + "resource.test": nil, "aidl/foo/bar/Test.aidl": nil, // For java_sdk_library @@ -348,6 +349,7 @@ func TestSnapshotWithJavaImplLibrary(t *testing.T) { java_library { name: "myjavalib", srcs: ["Test.java"], + java_resources: ["resource.txt"], aidl: { export_include_dirs: ["aidl"], }, @@ -381,7 +383,7 @@ module_exports_snapshot { `), checkAllCopyRules(` -.intermediates/myjavalib/android_common/javac/myjavalib.jar -> java/myjavalib.jar +.intermediates/myjavalib/android_common/withres/myjavalib.jar -> java/myjavalib.jar aidl/foo/bar/Test.aidl -> aidl/aidl/foo/bar/Test.aidl `), )