summaryrefslogtreecommitdiff
path: root/android/apex_contributions.go
diff options
context:
space:
mode:
author Spandan Das <spandandas@google.com> 2024-02-26 09:39:37 +0000
committer Spandan Das <spandandas@google.com> 2024-02-26 10:07:45 +0000
commitbffd7fbabae6155350766303fe27b78aa94f3de4 (patch)
tree92124f950150701840ca41d365a1c5ab1e9caadc /android/apex_contributions.go
parent50bfc3489416c92b59c305ff639f4855b346b3a2 (diff)
Ignore prebuilt apex_contributions in coverage builds
This CL unsets the prebuilt contents of a selected apex_contribution in coverage builds. The effect of this will be that mainline modules will be built from source with the following in coverage builds 1. Instrumentation turned on 2. RELEASE_ACONFIG_VALUE_SETS for that release config Test: Added a unit test Test: lunch cf_x86_64_phone-next-userdebug && EMMA_INSTRUMENT=true m nothing (with ag/26298763) Bug: 325666427 Change-Id: Ic4e1f0612072377261602842dfd303c064095035
Diffstat (limited to 'android/apex_contributions.go')
-rw-r--r--android/apex_contributions.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/android/apex_contributions.go b/android/apex_contributions.go
index 89e27b97b..c388afff9 100644
--- a/android/apex_contributions.go
+++ b/android/apex_contributions.go
@@ -15,6 +15,8 @@
package android
import (
+ "strings"
+
"github.com/google/blueprint"
"github.com/google/blueprint/proptools"
)
@@ -102,6 +104,15 @@ func (a *allApexContributions) SetPrebuiltSelectionInfoProvider(ctx BaseModuleCo
if InList(content, ctx.Config().BuildIgnoreApexContributionContents()) {
continue
}
+ // Coverage builds for TARGET_RELEASE=foo should always build from source,
+ // even if TARGET_RELEASE=foo uses prebuilt mainline modules.
+ // This is necessary because the checked-in prebuilts were generated with
+ // instrumentation turned off.
+ //
+ // Skip any prebuilt contents in coverage builds
+ if strings.HasPrefix(content, "prebuilt_") && (ctx.Config().JavaCoverageEnabled() || ctx.DeviceConfig().NativeCoverageEnabled()) {
+ continue
+ }
if !ctx.OtherModuleExists(content) && !ctx.Config().AllowMissingDependencies() {
ctx.ModuleErrorf("%s listed in apex_contributions %s does not exist\n", content, m.Name())
}