aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2015-04-24 15:14:48 -0700
committerColin Cross <ccross@android.com>2015-04-29 14:59:23 -0700
commit6a114caa171970abd8a4c245a4a1831baa3306b0 (patch)
tree93caaf3c405572e3662e269c95f9e56404aeeed3 /common
parent6f23ef6bf3519298960a8bc35bd4ef20b4244d54 (diff)
downloadbuild_soong-6a114caa171970abd8a4c245a4a1831baa3306b0.tar.gz
build_soong-6a114caa171970abd8a4c245a4a1831baa3306b0.tar.bz2
build_soong-6a114caa171970abd8a4c245a4a1831baa3306b0.zip
Fix globbing bugs
Fix two bugs in globbing: check for excludes before globs so that excludes that contain globs are not treated as includes, and remove the Generator attribute from globRule so that the rule reruns if the command line changes, for example if the glob or excludes list changes. Change-Id: I216c0c925eeb00a3814300548c005bcdf64a1f30
Diffstat (limited to 'common')
-rw-r--r--common/glob.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/common/glob.go b/common/glob.go
index f4e083a4..669d1857 100644
--- a/common/glob.go
+++ b/common/glob.go
@@ -49,10 +49,9 @@ var (
Command: fmt.Sprintf(`%s -o $out $excludes "$glob"`, globCmd),
Description: "glob $glob",
- Restat: true,
- Generator: true,
- Deps: blueprint.DepsGCC,
- Depfile: "$out.d",
+ Restat: true,
+ Deps: blueprint.DepsGCC,
+ Depfile: "$out.d",
},
"glob", "excludes")
)
@@ -81,9 +80,11 @@ func expandGlobs(ctx AndroidModuleContext, in []string) []string {
out := make([]string, 0, len(in))
for _, s := range in {
- if glob.IsGlob(s) {
+ if s[0] == '-' {
+ continue
+ } else if glob.IsGlob(s) {
out = append(out, Glob(ctx, s, excludes)...)
- } else if s[0] != '-' {
+ } else {
out = append(out, s)
}
}