summaryrefslogtreecommitdiff
path: root/android/module.go
diff options
context:
space:
mode:
Diffstat (limited to 'android/module.go')
-rw-r--r--android/module.go41
1 files changed, 29 insertions, 12 deletions
diff --git a/android/module.go b/android/module.go
index e431adaf4..82321f417 100644
--- a/android/module.go
+++ b/android/module.go
@@ -104,11 +104,15 @@ type EarlyModuleContext interface {
type BaseModuleContext interface {
EarlyModuleContext
+ blueprintBaseModuleContext() blueprint.BaseModuleContext
+
OtherModuleName(m blueprint.Module) string
OtherModuleDir(m blueprint.Module) string
OtherModuleErrorf(m blueprint.Module, fmt string, args ...interface{})
OtherModuleDependencyTag(m blueprint.Module) blueprint.DependencyTag
OtherModuleExists(name string) bool
+ OtherModuleDependencyVariantExists(variations []blueprint.Variation, name string) bool
+ OtherModuleReverseDependencyVariantExists(name string) bool
OtherModuleType(m blueprint.Module) string
GetDirectDepsWithTag(tag blueprint.DependencyTag) []Module
@@ -257,9 +261,6 @@ type Module interface {
// Get information about the properties that can contain visibility rules.
visibilityProperties() []visibilityProperty
- // Get the visibility rules that control the visibility of this module.
- visibility() []string
-
RequiredModuleNames() []string
HostRequiredModuleNames() []string
TargetRequiredModuleNames() []string
@@ -331,6 +332,8 @@ type commonProperties struct {
// ["//visibility:public"]: Anyone can use this module.
// ["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
// this module.
+ // ["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
+ // Can only be used at the beginning of a list of visibility rules.
// ["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
// other/package (defined in some/package/*.bp and other/package/*.bp) have access to
// this module. Note that sub-packages do not have access to the rule; for example,
@@ -807,15 +810,6 @@ func (m *ModuleBase) visibilityProperties() []visibilityProperty {
return m.visibilityPropertyInfo
}
-func (m *ModuleBase) visibility() []string {
- // The soong_namespace module does not initialize the primaryVisibilityProperty.
- if m.primaryVisibilityProperty != nil {
- return m.primaryVisibilityProperty.getStrings()
- } else {
- return nil
- }
-}
-
func (m *ModuleBase) Target() Target {
return m.commonProperties.CompileTarget
}
@@ -908,6 +902,13 @@ func (m *ModuleBase) SystemExtSpecific() bool {
return Bool(m.commonProperties.System_ext_specific)
}
+// RequiresStableAPIs returns true if the module will be installed to a partition that may
+// be updated separately from the system image.
+func (m *ModuleBase) RequiresStableAPIs(ctx BaseModuleContext) bool {
+ return m.SocSpecific() || m.DeviceSpecific() ||
+ (m.ProductSpecific() && ctx.Config().EnforceProductPartitionInterface())
+}
+
func (m *ModuleBase) PartitionTag(config DeviceConfig) string {
partition := "system"
if m.SocSpecific() {
@@ -1434,6 +1435,12 @@ func (b *baseModuleContext) OtherModuleDependencyTag(m blueprint.Module) bluepri
return b.bp.OtherModuleDependencyTag(m)
}
func (b *baseModuleContext) OtherModuleExists(name string) bool { return b.bp.OtherModuleExists(name) }
+func (b *baseModuleContext) OtherModuleDependencyVariantExists(variations []blueprint.Variation, name string) bool {
+ return b.bp.OtherModuleDependencyVariantExists(variations, name)
+}
+func (b *baseModuleContext) OtherModuleReverseDependencyVariantExists(name string) bool {
+ return b.bp.OtherModuleReverseDependencyVariantExists(name)
+}
func (b *baseModuleContext) OtherModuleType(m blueprint.Module) string {
return b.bp.OtherModuleType(m)
}
@@ -1442,6 +1449,10 @@ func (b *baseModuleContext) GetDirectDepWithTag(name string, tag blueprint.Depen
return b.bp.GetDirectDepWithTag(name, tag)
}
+func (b *baseModuleContext) blueprintBaseModuleContext() blueprint.BaseModuleContext {
+ return b.bp
+}
+
type moduleContext struct {
bp blueprint.ModuleContext
baseModuleContext
@@ -2363,4 +2374,10 @@ type IdeInfo struct {
Classes []string `json:"class,omitempty"`
Installed_paths []string `json:"installed,omitempty"`
SrcJars []string `json:"srcjars,omitempty"`
+ Paths []string `json:"path,omitempty"`
+}
+
+func CheckBlueprintSyntax(ctx BaseModuleContext, filename string, contents string) []error {
+ bpctx := ctx.blueprintBaseModuleContext()
+ return blueprint.CheckBlueprintSyntax(bpctx.ModuleFactories(), filename, contents)
}