diff options
author | 2019-05-29 14:40:35 -0700 | |
---|---|---|
committer | 2019-06-04 10:22:51 -0700 | |
commit | 41955e8895fe33022a6759b9739a2368b206c392 (patch) | |
tree | f1a20db995473d7475a502113eb583b317c39a0a /bpf/bpf.go | |
parent | 4c2c46f0a72e21ffe6be407028b857ba461144d7 (diff) |
Support tagged module references
There are cases where a module needs to refer to an intermediate
output of another module instead of its final output. For example,
a module may want to use the .jar containing .class files from
another module whose final output is a .jar containing classes.dex
files. Support a new ":module{.tag}" format in any property that
is annotated with `android:"path"`, which will query the target
module for its ".tag" output(s).
Test: path_properties_test.go, paths_test.go
Test: no unexpected changes in build.ninja
Change-Id: Icd3c9b0d83ff125771767c04046fcffb9fc3f65a
Diffstat (limited to 'bpf/bpf.go')
-rw-r--r-- | bpf/bpf.go | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/bpf/bpf.go b/bpf/bpf.go index dcbf9adac..90ec963d1 100644 --- a/bpf/bpf.go +++ b/bpf/bpf.go @@ -122,13 +122,18 @@ func (bpf *bpf) AndroidMk() android.AndroidMkData { } } -// Implements SourceFileProducer interface so that the obj output can be used in the data property +// Implements OutputFileFileProducer interface so that the obj output can be used in the data property // of other modules. -func (bpf *bpf) Srcs() android.Paths { - return bpf.objs +func (bpf *bpf) OutputFiles(tag string) (android.Paths, error) { + switch tag { + case "": + return bpf.objs, nil + default: + return nil, fmt.Errorf("unsupported module reference tag %q", tag) + } } -var _ android.SourceFileProducer = (*bpf)(nil) +var _ android.OutputFileProducer = (*bpf)(nil) func bpfFactory() android.Module { module := &bpf{} |