soong_zip: support globs in -f and -D arguments
-f and -D arguments can now take globs in the Soong format.
Also update the use of soong_zip that jars resources to escape the
globs in the arguments, and then shell-escape them when writing to
the rsp file so the glob escape are not intepreted by ReadRespFile.
Also remove an unused argument to the buildAAR rule that could
have contained values that needed escaping.
Test: m checkbuild
Change-Id: I7f20bb169dc01f952d2a7681ec6ee9c05737ed37
diff --git a/java/java_resources.go b/java/java_resources.go
index fdc1590..4d8a757 100644
--- a/java/java_resources.go
+++ b/java/java_resources.go
@@ -20,6 +20,8 @@
"strings"
"android/soong/android"
+
+ "github.com/google/blueprint/pathtools"
)
var resourceExcludes = []string{
@@ -64,7 +66,7 @@
if !strings.HasPrefix(path, dir.String()) {
panic(fmt.Errorf("path %q does not start with %q", path, dir))
}
- args = append(args, "-f", path)
+ args = append(args, "-f", pathtools.MatchEscape(path))
}
}
}
@@ -107,7 +109,7 @@
if i == 0 || dir != lastDir {
args = append(args, "-C", dir)
}
- args = append(args, "-f", path)
+ args = append(args, "-f", pathtools.MatchEscape(path))
lastDir = dir
}