Implement `OutputFileProducer` for `xsdConfig`.
This allows `xsd_config` modules to be referenced using ":module"
syntax.
Bug: 204783392
Test: m nothing
Test: manual - reference an `xsd_config` module in a bp file and verify
that it works.
Change-Id: I7a4f65cb6b10a4b70b7adcbf53801c0246e4da3f
diff --git a/build/xsdc.go b/build/xsdc.go
index 48bd9c9..698008c 100644
--- a/build/xsdc.go
+++ b/build/xsdc.go
@@ -17,6 +17,7 @@
import (
"android/soong/android"
"android/soong/java"
+ "fmt"
"path/filepath"
"strings"
@@ -305,3 +306,24 @@
return module
}
+
+func (module *xsdConfig) OutputFiles(tag string) (android.Paths, error) {
+ switch tag {
+ case "":
+ var outputs android.WritablePaths
+ outputs = append(outputs, module.genOutputs_j)
+ outputs = append(outputs, module.genOutputs_c...)
+ outputs = append(outputs, module.genOutputs_h...)
+ return outputs.Paths(), nil
+ case "java":
+ return android.Paths{module.genOutputs_j}, nil
+ case "cpp":
+ return module.genOutputs_c.Paths(), nil
+ case "h":
+ return module.genOutputs_h.Paths(), nil
+ default:
+ return nil, fmt.Errorf("unsupported module reference tag %q", tag)
+ }
+}
+
+var _ android.OutputFileProducer = (*xsdConfig)(nil);