From b0bfa07919f7c0961c74b3953a004b3f9c30b247 Mon Sep 17 00:00:00 2001 From: Cole Faust Date: Mon, 3 Apr 2023 14:28:36 -0700 Subject: [PATCH] Make outputApexFile relative to module dir in mixed builds Otherwise when other modules use the apex as data (for example, in tests) they get the full path from the root of the workspace to the apex. Fixes: 276416485 Test: atest timezone_data_e2e_tests:com.android.tests.apex.TimezoneDataHostTest#testStageActivateUninstallApexPackage -- --abi x86_64 then tree out/host/linux-x86/testcases/timezone_data_e2e_tests Change-Id: Id740856794770df2edc55dfff5f6f938fc31d0c5 --- apex/apex.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apex/apex.go b/apex/apex.go index 367863660..5451a0400 100644 --- a/apex/apex.go +++ b/apex/apex.go @@ -1986,9 +1986,9 @@ func (a *apexBundle) ProcessBazelQueryResponse(ctx android.ModuleContext) { // Set the output file to .apex or .capex depending on the compression configuration. a.setCompression(ctx) if a.isCompressed { - a.outputApexFile = android.PathForBazelOut(ctx, outputs.SignedCompressedOutput) + a.outputApexFile = android.PathForBazelOutRelative(ctx, ctx.ModuleDir(), outputs.SignedCompressedOutput) } else { - a.outputApexFile = android.PathForBazelOut(ctx, outputs.SignedOutput) + a.outputApexFile = android.PathForBazelOutRelative(ctx, ctx.ModuleDir(), outputs.SignedOutput) } a.outputFile = a.outputApexFile