Make apex_set support ":<apex>" syntax to access the apex file
The apex and prebuilt_apex module types make the output APEX available
using ":<apex>" 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
diff --git a/apex/prebuilt.go b/apex/prebuilt.go
index 6fdd50a..14020fc 100644
--- a/apex/prebuilt.go
+++ b/apex/prebuilt.go
@@ -915,6 +915,15 @@
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{}