From 4f2282c2d8339c38dbec31eadeee54d9e4e30d8f Mon Sep 17 00:00:00 2001 From: Paul Duffin Date: Mon, 12 Dec 2022 17:44:33 +0000 Subject: [PATCH] Make apex_set support ":" syntax to access the apex file The apex and prebuilt_apex module types make the output APEX available using ":" syntax, e.g. for use as a data file in a test. This change adds compatible behavior to apex_set to ensure consistent behavior when building against prebuilts. Bug: 259958590 Test: m MODULE_BUILD_FROM_SOURCE=false nothing Change-Id: Ic6f105976cfdd6af4920cc1e11ab0b4ff72e6a6f --- apex/prebuilt.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apex/prebuilt.go b/apex/prebuilt.go index 6fdd50a5e..14020fc31 100644 --- a/apex/prebuilt.go +++ b/apex/prebuilt.go @@ -915,6 +915,15 @@ func (a *ApexSet) hasSanitizedSource(sanitizer string) bool { return false } +func (a *ApexSet) OutputFiles(tag string) (android.Paths, error) { + switch tag { + case "": + return android.Paths{a.outputApex}, nil + default: + return nil, fmt.Errorf("unsupported module reference tag %q", tag) + } +} + // prebuilt_apex imports an `.apex` file into the build graph as if it was built with apex. func apexSetFactory() android.Module { module := &ApexSet{}