summaryrefslogtreecommitdiff
path: root/android/prebuilt.go
diff options
context:
space:
mode:
Diffstat (limited to 'android/prebuilt.go')
-rw-r--r--android/prebuilt.go19
1 files changed, 17 insertions, 2 deletions
diff --git a/android/prebuilt.go b/android/prebuilt.go
index bf2717865..6b076b7b4 100644
--- a/android/prebuilt.go
+++ b/android/prebuilt.go
@@ -28,6 +28,7 @@ import (
func RegisterPrebuiltMutators(ctx RegistrationContext) {
ctx.PreArchMutators(RegisterPrebuiltsPreArchMutators)
+ ctx.PreDepsMutators(RegisterPrebuiltsPreDepsMutators)
ctx.PostDepsMutators(RegisterPrebuiltsPostDepsMutators)
}
@@ -195,6 +196,10 @@ func (p *Prebuilt) UsePrebuilt() bool {
return p.properties.UsePrebuilt
}
+func (p *Prebuilt) SetUsePrebuilt(use bool) {
+ p.properties.UsePrebuilt = use
+}
+
// Called to provide the srcs value for the prebuilt module.
//
// This can be called with a context for any module not just the prebuilt one itself. It can also be
@@ -422,9 +427,12 @@ func RegisterPrebuiltsPreArchMutators(ctx RegisterMutatorsContext) {
ctx.BottomUp("prebuilt_rename", PrebuiltRenameMutator).UsesRename()
}
-func RegisterPrebuiltsPostDepsMutators(ctx RegisterMutatorsContext) {
+func RegisterPrebuiltsPreDepsMutators(ctx RegisterMutatorsContext) {
ctx.BottomUp("prebuilt_source", PrebuiltSourceDepsMutator).UsesReverseDependencies()
ctx.BottomUp("prebuilt_select", PrebuiltSelectModuleMutator)
+}
+
+func RegisterPrebuiltsPostDepsMutators(ctx RegisterMutatorsContext) {
ctx.BottomUp("prebuilt_postdeps", PrebuiltPostDepsMutator).UsesReplaceDependencies()
}
@@ -468,7 +476,7 @@ func PrebuiltSourceDepsMutator(ctx BottomUpMutatorContext) {
bmn, _ := m.(baseModuleName)
name := bmn.BaseModuleName()
if ctx.OtherModuleReverseDependencyVariantExists(name) {
- ctx.AddReverseDependency(ctx.Module(), PrebuiltDepTag, name)
+ ctx.AddReverseVariationDependency(nil, PrebuiltDepTag, name)
p.properties.SourceExists = true
}
}
@@ -604,6 +612,13 @@ func hideUnflaggedModules(ctx BottomUpMutatorContext, psi PrebuiltSelectionInfoM
}
}
+func IsDontReplaceSourceWithPrebuiltTag(tag blueprint.DependencyTag) bool {
+ if t, ok := tag.(ReplaceSourceWithPrebuilt); ok {
+ return !t.ReplaceSourceWithPrebuilt()
+ }
+ return false
+}
+
// PrebuiltPostDepsMutator replaces dependencies on the source module with dependencies on the
// prebuilt when both modules exist and the prebuilt should be used. When the prebuilt should not
// be used, disable installing it.