From d5934c8bb7c17e324a9db7b28dcac14a8b727474 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Mon, 2 Oct 2017 13:55:26 -0700 Subject: Fix arch specific properties for java modules Arch specific properties were not being applied to modules with OS set to Common. Test: java_test.go Change-Id: I8f1b49ca51b0cf96f78006dfcd121672e581d9c5 --- java/java_test.go | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'java/java_test.go') diff --git a/java/java_test.go b/java/java_test.go index ffa3e2b17..2b92f49e7 100644 --- a/java/java_test.go +++ b/java/java_test.go @@ -139,7 +139,7 @@ func TestSimple(t *testing.T) { name: "baz", srcs: ["c.java"], } - `) + `) javac := ctx.ModuleForTests("foo", "android_common").Rule("javac") combineJar := ctx.ModuleForTests("foo", "android_common").Rule("combineJar") @@ -164,6 +164,25 @@ func TestSimple(t *testing.T) { } } +func TestArchSpecific(t *testing.T) { + ctx := testJava(t, ` + java_library { + name: "foo", + srcs: ["a.java"], + target: { + android: { + srcs: ["b.java"], + }, + }, + } + `) + + javac := ctx.ModuleForTests("foo", "android_common").Rule("javac") + if len(javac.Inputs) != 2 || javac.Inputs[0].String() != "a.java" || javac.Inputs[1].String() != "b.java" { + t.Errorf(`foo inputs %v != ["a.java", "b.java"]`, javac.Inputs) + } +} + var classpathTestcases = []struct { name string host android.OsClass -- cgit v1.2.3-59-g8ed1b