summaryrefslogtreecommitdiff
path: root/android/deapexer.go
diff options
context:
space:
mode:
author Spandan Das <spandandas@google.com> 2024-09-20 01:09:48 +0000
committer Spandan Das <spandandas@google.com> 2024-09-20 23:47:36 +0000
commit52c01a1897f68e93bacfb2d7500ecc31f3bd3c61 (patch)
tree19caf92fb9d205faaf2cfaf0684c400058a45919 /android/deapexer.go
parenta326b320ab2b8b5cbad003571f3fccf1573b20a6 (diff)
Remove internal deapexer module
The build ations will be created by the top-level apex. Details 1. In GenerateAndroidBuildActions, do a graph walk to determine if the apex has exported deps. 2. If there are exported deps, call the newly introduced `deapex` function. This registers the build rules and returns a DeapexerInfo object. This was previously provided by the internal deapexer dependency. 3. Update `dexpreoptSystemServerJars and `provideApexExportsInfo` to use the DeapexerInfo object from (2). A lot of unit tests that relied on the legacy mechanism of deapexing have been updated. Test: go test ./apex Test: lunch cf_x86_64_phone-next-userdebug (uses mainline prebuilts) Test: verified no diff in file_list.txt Bug: 368337090 Change-Id: I0edb681beccac4d2a9ceb73f9a506c081a8a96e0
Diffstat (limited to 'android/deapexer.go')
-rw-r--r--android/deapexer.go44
1 files changed, 0 insertions, 44 deletions
diff --git a/android/deapexer.go b/android/deapexer.go
index dcae3e46d..4049d2b2a 100644
--- a/android/deapexer.go
+++ b/android/deapexer.go
@@ -15,7 +15,6 @@
package android
import (
- "fmt"
"strings"
"github.com/google/blueprint"
@@ -109,10 +108,6 @@ func (i DeapexerInfo) GetExportedModuleNames() []string {
return i.exportedModuleNames
}
-// Provider that can be used from within the `GenerateAndroidBuildActions` of a module that depends
-// on a `deapexer` module to retrieve its `DeapexerInfo`.
-var DeapexerProvider = blueprint.NewProvider[DeapexerInfo]()
-
// NewDeapexerInfo creates and initializes a DeapexerInfo that is suitable
// for use with a prebuilt_apex module.
//
@@ -169,45 +164,6 @@ type RequiresFilesFromPrebuiltApexTag interface {
RequiresFilesFromPrebuiltApex()
}
-// FindDeapexerProviderForModule searches through the direct dependencies of the current context
-// module for a DeapexerTag dependency and returns its DeapexerInfo. If a single nonambiguous
-// deapexer module isn't found then it returns it an error
-// clients should check the value of error and call ctx.ModuleErrof if a non nil error is received
-func FindDeapexerProviderForModule(ctx ModuleContext) (*DeapexerInfo, error) {
- var di *DeapexerInfo
- var err error
- ctx.VisitDirectDepsWithTag(DeapexerTag, func(m Module) {
- if err != nil {
- // An err has been found. Do not visit further.
- return
- }
- c, ok := OtherModuleProvider(ctx, m, DeapexerProvider)
- if !ok {
- ctx.ModuleErrorf("Expected all deps with DeapexerTag to have a DeapexerProvider, but module %q did not", m.Name())
- return
- }
- p := &c
- if di != nil {
- // If two DeapexerInfo providers have been found then check if they are
- // equivalent. If they are then use the selected one, otherwise fail.
- if selected := equivalentDeapexerInfoProviders(di, p); selected != nil {
- di = selected
- return
- }
- err = fmt.Errorf("Multiple installable prebuilt APEXes provide ambiguous deapexers: %s and %s", di.ApexModuleName(), p.ApexModuleName())
- }
- di = p
- })
- if err != nil {
- return nil, err
- }
- if di != nil {
- return di, nil
- }
- ai, _ := ModuleProvider(ctx, ApexInfoProvider)
- return nil, fmt.Errorf("No prebuilt APEX provides a deapexer module for APEX variant %s", ai.ApexVariationName)
-}
-
// removeCompressedApexSuffix removes the _compressed suffix from the name if present.
func removeCompressedApexSuffix(name string) string {
return strings.TrimSuffix(name, "_compressed")