Add new property "exclude_files_in_output" for excluding files from the output files of Java related modules.

Bug: 204888276
Test: m service-permission
Change-Id: I9f6113834826358b0e3af22ed1dd63a43c255452
This commit is contained in:
Wei Li
2021-12-06 13:35:11 -08:00
parent 865d5e6c9d
commit 1e73c6573e
2 changed files with 36 additions and 16 deletions

View File

@@ -48,6 +48,7 @@ func TestJavaSdkLibrary(t *testing.T) {
name: "bar",
srcs: ["a.java", "b.java"],
api_packages: ["bar"],
exclude_kotlinc_generated_files: true,
}
java_library {
name: "baz",
@@ -161,6 +162,14 @@ func TestJavaSdkLibrary(t *testing.T) {
android.AssertDeepEquals(t, "qux exports (required)", []string{"fred", "quuz", "foo", "bar"}, requiredSdkLibs)
android.AssertDeepEquals(t, "qux exports (optional)", []string{}, optionalSdkLibs)
}
fooDexJar := result.ModuleForTests("foo", "android_common").Rule("d8")
// tests if kotlinc generated files are NOT excluded from output of foo.
android.AssertStringDoesNotContain(t, "foo dex", fooDexJar.BuildParams.Args["mergeZipsFlags"], "-stripFile META-INF/*.kotlin_module")
barDexJar := result.ModuleForTests("bar", "android_common").Rule("d8")
// tests if kotlinc generated files are excluded from output of bar.
android.AssertStringDoesContain(t, "bar dex", barDexJar.BuildParams.Args["mergeZipsFlags"], "-stripFile META-INF/*.kotlin_module")
}
func TestJavaSdkLibrary_UpdatableLibrary(t *testing.T) {