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
diff --git a/java/robolectric.go b/java/robolectric.go
index 3fe6626..572a95b 100644
--- a/java/robolectric.go
+++ b/java/robolectric.go
@@ -383,8 +383,10 @@
}
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)
}