From bc98d2ffe80fab193e0051a14a4e4a6ab3d3fa60 Mon Sep 17 00:00:00 2001 From: Joseph Murphy Date: Mon, 17 Aug 2020 17:00:00 -0700 Subject: [PATCH] Adds a workaround to fix version inconsistency frameworks/base still has the tree on R while the build system considers current development to be S which causes issues when Robolectric goes looking for an R jar but instead finds an S jar. Therefore, for the moment, we are hardcoding this to be tagged as R. In the future, hopefully these two sources of truth can be aligned better. Bug: b/157635117 Test: N/A or manual Change-Id: I7495735b1c6c4369408bdf8805f59fad6aac5128 --- java/robolectric.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/java/robolectric.go b/java/robolectric.go index 3fe6626bb..572a95b28 100644 --- a/java/robolectric.go +++ b/java/robolectric.go @@ -383,8 +383,10 @@ func (r *robolectricRuntimes) GenerateAndroidBuildActions(ctx android.ModuleCont } runtimeFromSourceJar := android.OutputFileForModule(ctx, runtimeFromSourceModule, "") + // TODO(murj) Update this to ctx.Config().PlatformSdkCodename() once the platform + // classes like android.os.Build are updated to S. runtimeName := fmt.Sprintf("android-all-%s-robolectric-r0.jar", - ctx.Config().PlatformSdkCodename()) + "R") installedRuntime := ctx.InstallFile(androidAllDir, runtimeName, runtimeFromSourceJar) r.runtimes = append(r.runtimes, installedRuntime) }