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
This commit is contained in:
Joseph Murphy 2020-08-17 17:00:00 -07:00
parent 2d815963ba
commit bc98d2ffe8

View file

@ -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)
}