diff options
Diffstat (limited to 'android/deapexer.go')
-rw-r--r-- | android/deapexer.go | 44 |
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") |