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
diff --git a/apex/apex.go b/apex/apex.go
index 3678636..5451a04 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -1986,9 +1986,9 @@
// 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