diff options
author | Paul Duffin <paulduffin@google.com> | 2020-01-10 17:16:44 +0000 |
---|---|---|
committer | Paul Duffin <paulduffin@google.com> | 2020-01-15 11:17:57 +0000 |
commit | 90169baf0ec21c57cb89132c91a4119e12de51df (patch) | |
tree | 55cb740a189b9f17b80e12f72c917e2b4e4cf20e /java/java_test.go | |
parent | cded5ecfc3e51052cd8353c8867f2bdcd0535756 (diff) |
Added java_system_modules_import
A prebuilt version of java_system_modules. It does not import the
generated system module, it generates the system module from imported
java libraries in the same way that java_system_modules does. It just
acts as a prebuilt, i.e. can have the same base name as another module
type and the one to use is selected at runtime.
Bug: 142940300
Test: m nothing
Change-Id: I126db49d18294fcd6e2b7ad0237f83e9c2fdef7a
Diffstat (limited to 'java/java_test.go')
-rw-r--r-- | java/java_test.go | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/java/java_test.go b/java/java_test.go index 5791619c1..a2788cb8e 100644 --- a/java/java_test.go +++ b/java/java_test.go @@ -1261,3 +1261,33 @@ func TestJavaSystemModules(t *testing.T) { } } } + +func TestJavaSystemModulesImport(t *testing.T) { + ctx, _ := testJava(t, ` + java_system_modules_import { + name: "system-modules", + libs: ["system-module1", "system-module2"], + } + java_import { + name: "system-module1", + jars: ["a.jar"], + } + java_import { + name: "system-module2", + jars: ["b.jar"], + } + `) + + // check the existence of the module + systemModules := ctx.ModuleForTests("system-modules", "android_common") + + cmd := systemModules.Rule("jarsTosystemModules") + + // make sure the command compiles against the supplied modules. + for _, module := range []string{"system-module1.jar", "system-module2.jar"} { + if !strings.Contains(cmd.Args["classpath"], module) { + t.Errorf("system modules classpath %v does not contain %q", cmd.Args["classpath"], + module) + } + } +} |