diff options
| -rw-r--r-- | common/paths.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/common/paths.go b/common/paths.go index 3ea9ef807..8d9f6fd44 100644 --- a/common/paths.go +++ b/common/paths.go @@ -173,6 +173,21 @@ type Paths []Path // PathsForSource returns Paths rooted from SrcDir func PathsForSource(ctx PathContext, paths []string) Paths { + if pathConfig(ctx).AllowMissingDependencies() { + if modCtx, ok := ctx.(AndroidModuleContext); ok { + ret := make(Paths, 0, len(paths)) + intermediates := PathForModuleOut(modCtx, "missing").String() + for _, path := range paths { + p := OptionalPathForSource(ctx, intermediates, path) + if p.Valid() { + ret = append(ret, p.Path()) + } else { + modCtx.AddMissingDependencies([]string{path}) + } + } + return ret + } + } ret := make(Paths, len(paths)) for i, path := range paths { ret[i] = PathForSource(ctx, path) |