Disable ResourceProcessorBusyBox in kythe builds

ResourceProcessorBusyBox generates the R.jar binary from R.txt without
creating an intermediate R.srcjar file. Disable this behavior in kythe
builds (ctx.Config().EmitXrefRules()) to support xrefs to R imports

Test: XREF_CORPUS=$internal_corpus m nothing
Test: aninja -t query out/soong/.intermediates/frameworks/libs/systemui/animationlib/animationlib_tests/android_common/animationlib_tests.kzip
Test: verified that an R.srcjar is present in its deps

Bug: 354854007
Change-Id: I2d63c3393c5bc58103c267c4593172ce77fbc79c
This commit is contained in:
Spandan Das
2024-08-06 00:13:31 +00:00
parent 5089a18035
commit a62d9563b4

View File

@@ -166,7 +166,11 @@ func propagateRROEnforcementMutator(ctx android.TopDownMutatorContext) {
func (a *aapt) useResourceProcessorBusyBox(ctx android.BaseModuleContext) bool {
return BoolDefault(a.aaptProperties.Use_resource_processor, ctx.Config().UseResourceProcessorByDefault()) &&
// TODO(b/331641946): remove this when ResourceProcessorBusyBox supports generating shared libraries.
!slices.Contains(a.aaptProperties.Aaptflags, "--shared-lib")
!slices.Contains(a.aaptProperties.Aaptflags, "--shared-lib") &&
// Use the legacy resource processor in kythe builds.
// The legacy resource processor creates an R.srcjar, which kythe can use for generating crossrefs.
// TODO(b/354854007): Re-enable BusyBox in kythe builds
!ctx.Config().EmitXrefRules()
}
func (a *aapt) filterProduct() string {