summaryrefslogtreecommitdiff
path: root/android/apex.go
diff options
context:
space:
mode:
Diffstat (limited to 'android/apex.go')
-rw-r--r--android/apex.go65
1 files changed, 9 insertions, 56 deletions
diff --git a/android/apex.go b/android/apex.go
index e73b3e662..9277ff31b 100644
--- a/android/apex.go
+++ b/android/apex.go
@@ -160,14 +160,6 @@ func (i ApexInfo) Equal(other any) bool {
reflect.DeepEqual(i.InApexModules, otherApexInfo.InApexModules)
}
-// ApexTestForInfo stores the contents of APEXes for which this module is a test - although this
-// module is not part of the APEX - and thus has access to APEX internals.
-type ApexTestForInfo struct {
- ApexContents []*ApexContents
-}
-
-var ApexTestForInfoProvider = blueprint.NewMutatorProvider[ApexTestForInfo]("apex_test_for")
-
// ApexBundleInfo contains information about the dependencies of an apex
type ApexBundleInfo struct {
Contents *ApexContents
@@ -269,12 +261,6 @@ type ApexModule interface {
// check-platform-availability mutator in the apex package.
SetNotAvailableForPlatform()
- // Returns the list of APEXes that this module is a test for. The module has access to the
- // private part of the listed APEXes even when it is not included in the APEXes. This by
- // default returns nil. A module type should override the default implementation. For
- // example, cc_test module type returns the value of test_for here.
- TestFor() []string
-
// Returns nil (success) if this module should support the given sdk version. Returns an
// error if not. No default implementation is provided for this method. A module type
// implementing this interface should provide an implementation. A module supports an sdk
@@ -457,13 +443,6 @@ func (m *ApexModuleBase) IsInstallableToApex() bool {
return false
}
-// Implements ApexModule
-func (m *ApexModuleBase) TestFor() []string {
- // If needed, this will be overridden by concrete types inheriting
- // ApexModuleBase
- return nil
-}
-
// Returns the test apexes that this module is included in.
func (m *ApexModuleBase) TestApexes() []string {
return m.ApexProperties.TestApexes
@@ -891,28 +870,6 @@ func (i ApexMembership) merge(other ApexMembership) ApexMembership {
return notInApex
}
-// Tests whether a module named moduleName is directly included in the apexBundle where this
-// ApexContents is tagged.
-func (ac *ApexContents) DirectlyInApex(moduleName string) bool {
- return ac.contents[moduleName] == directlyInApex
-}
-
-// Tests whether a module named moduleName is included in the apexBundle where this ApexContent is
-// tagged.
-func (ac *ApexContents) InApex(moduleName string) bool {
- return ac.contents[moduleName] != notInApex
-}
-
-// Tests whether a module named moduleName is directly depended on by all APEXes in an ApexInfo.
-func DirectlyInAllApexes(apexInfo ApexInfo, moduleName string) bool {
- for _, contents := range apexInfo.ApexContents {
- if !contents.DirectlyInApex(moduleName) {
- return false
- }
- }
- return true
-}
-
////////////////////////////////////////////////////////////////////////////////////////////////////
//Below are routines for extra safety checks.
//
@@ -939,8 +896,8 @@ type ApexModuleDepInfo struct {
type DepNameToDepInfoMap map[string]ApexModuleDepInfo
type ApexBundleDepsInfo struct {
- flatListPath OutputPath
- fullListPath OutputPath
+ flatListPath Path
+ fullListPath Path
}
type ApexBundleDepsInfoIntf interface {
@@ -977,13 +934,15 @@ func (d *ApexBundleDepsInfo) BuildDepsInfoLists(ctx ModuleContext, minSdkVersion
fmt.Fprintf(&flatContent, "%s\n", toName)
}
- d.fullListPath = PathForModuleOut(ctx, "depsinfo", "fulllist.txt").OutputPath
- WriteFileRule(ctx, d.fullListPath, fullContent.String())
+ fullListPath := PathForModuleOut(ctx, "depsinfo", "fulllist.txt")
+ WriteFileRule(ctx, fullListPath, fullContent.String())
+ d.fullListPath = fullListPath
- d.flatListPath = PathForModuleOut(ctx, "depsinfo", "flatlist.txt").OutputPath
- WriteFileRule(ctx, d.flatListPath, flatContent.String())
+ flatListPath := PathForModuleOut(ctx, "depsinfo", "flatlist.txt")
+ WriteFileRule(ctx, flatListPath, flatContent.String())
+ d.flatListPath = flatListPath
- ctx.Phony(fmt.Sprintf("%s-depsinfo", ctx.ModuleName()), d.fullListPath, d.flatListPath)
+ ctx.Phony(fmt.Sprintf("%s-depsinfo", ctx.ModuleName()), fullListPath, flatListPath)
}
// Function called while walking an APEX's payload dependencies.
@@ -1062,12 +1021,6 @@ func MinSdkVersionFromValue(ctx EarlyModuleContext, value string) ApiLevel {
return apiLevel
}
-// Implemented by apexBundle.
-type ApexTestInterface interface {
- // Return true if the apex bundle is an apex_test
- IsTestApex() bool
-}
-
var ApexExportsInfoProvider = blueprint.NewProvider[ApexExportsInfo]()
// ApexExportsInfo contains information about the artifacts provided by apexes to dexpreopt and hiddenapi