summaryrefslogtreecommitdiff
path: root/java/java_test.go
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2017-10-03 14:50:08 -0700
committerColin Cross <ccross@android.com>2017-10-04 17:19:43 -0700
commitaf9c55b780c713676670b83f20f6dda7101817a6 (patch)
tree43eb96756f6e26ddc03d3b39f0fcb80abc54ed32 /java/java_test.go
parent2372923fe0d14b3adf4e6f217e0cf7bdb2c211e1 (diff)
Correctly add dependencies to java_resource_dirs files
java_resource_dirs was using a file list file that was generated at ninja time to get the list of files to include, which meant there were no dependencies on the files to cause res.jar to get rebuilt. Switch to using a glob at soong time instead. This is substantially similar to a glob in java_resources, except that java_resource_dirs strips the listed directories off the paths that end up in the jar. Test: TestResources in java_test.go Change-Id: I4b9b38f7b6b38a013cbb4e211187e7282a6795c0
Diffstat (limited to 'java/java_test.go')
-rw-r--r--java/java_test.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/java/java_test.go b/java/java_test.go
index a4a3f52bf..c2c7ee265 100644
--- a/java/java_test.go
+++ b/java/java_test.go
@@ -408,16 +408,16 @@ func TestResources(t *testing.T) {
args string
}{
{
- // Test that a module with java_resource_dirs includes a file list file
+ // Test that a module with java_resource_dirs includes the files
name: "resource dirs",
prop: `java_resource_dirs: ["res"]`,
- args: "-C res -l ",
+ args: "-C res -f res/a -f res/b",
},
{
// Test that a module with java_resources includes the files
name: "resource files",
prop: `java_resources: ["res/a", "res/b"]`,
- args: "-C . -f res/a -C . -f res/b",
+ args: "-C . -f res/a -f res/b",
},
{
// Test that a module with a filegroup in java_resources includes the files with the
@@ -430,13 +430,13 @@ func TestResources(t *testing.T) {
path: "res",
srcs: ["res/a", "res/b"],
}`,
- args: "-C res -f res/a -C res -f res/b",
+ args: "-C res -f res/a -f res/b",
},
{
// Test that a module with "include_srcs: true" includes its source files in the resources jar
name: "include sources",
prop: `include_srcs: true`,
- args: "-C . -f a.java -C . -f b.java -C . -f c.java",
+ args: "-C . -f a.java -f b.java -f c.java",
},
}
@@ -462,8 +462,8 @@ func TestResources(t *testing.T) {
foo.Inputs.Strings(), fooRes.Output.String())
}
- if !strings.Contains(fooRes.Args["jarArgs"], test.args) {
- t.Errorf("foo resource jar args %q does not contain %q",
+ if fooRes.Args["jarArgs"] != test.args {
+ t.Errorf("foo resource jar args %q is not %q",
fooRes.Args["jarArgs"], test.args)
}
})
@@ -489,7 +489,7 @@ func TestExcludeResources(t *testing.T) {
fooRes := ctx.ModuleForTests("foo", "android_common").Output("res.jar")
- expected := "-C res -l " + fooRes.Implicits[0].String()
+ expected := "-C res -f res/a -f res/b"
if fooRes.Args["jarArgs"] != expected {
t.Errorf("foo resource jar args %q is not %q",
fooRes.Args["jarArgs"], expected)