summaryrefslogtreecommitdiff
path: root/java/java_resources.go
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2018-09-18 17:05:15 -0700
committerColin Cross <ccross@android.com>2018-09-28 14:01:29 -0700
commit1d98ee23a322a997d28ef5dd07412db4b9564d2a (patch)
tree6c7de5a9a7da78ae634fd693768912bb5b2cd8fc /java/java_resources.go
parent05518bc13b3cd31e6cb7158a41aa124b224c3bc4 (diff)
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. Relands I7f20bb169dc01f952d2a7681ec6ee9c05737ed37 with a fix for trailing "\n" in list files, which causes a call to pathtools.Glob("") that returns "./", which could then get incorrectly translated to "../../../" in the zip file. Also adds tests. Test: m checkbuild Test: zip_test.go Change-Id: I54b8eef9231875e6042a32c9f8bcc5c2f779922a
Diffstat (limited to 'java/java_resources.go')
-rw-r--r--java/java_resources.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/java/java_resources.go b/java/java_resources.go
index fdc159063..6c1fd39d0 100644
--- a/java/java_resources.go
+++ b/java/java_resources.go
@@ -19,6 +19,8 @@ import (
"path/filepath"
"strings"
+ "github.com/google/blueprint/pathtools"
+
"android/soong/android"
)
@@ -64,7 +66,7 @@ func ResourceDirsToJarArgs(ctx android.ModuleContext,
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 @@ func resourceFilesToJarArgs(ctx android.ModuleContext,
if i == 0 || dir != lastDir {
args = append(args, "-C", dir)
}
- args = append(args, "-f", path)
+ args = append(args, "-f", pathtools.MatchEscape(path))
lastDir = dir
}