diff options
author | 2020-10-22 21:05:24 +0000 | |
---|---|---|
committer | 2020-10-22 21:07:35 +0000 | |
commit | 9a631319ab44d5c5e9fc12a389d54b0b4e010873 (patch) | |
tree | 3949068dbdc4bbc32fac0e6f610beb6b116b5fdb /java/app_test.go | |
parent | 5ac5247c261cbb9db7bdadf47c4d064b1e6d1256 (diff) |
Export proguard_flags_files from android_librarys
If an android_library has a proguard flag file, that
file should also be used when compiling apps with the
library.
Fixes: 171425221
Test: New unit test in app_test.go, and manually
Diffstat (limited to 'java/app_test.go')
-rw-r--r-- | java/app_test.go | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/java/app_test.go b/java/app_test.go index 49ed3aab6..cec8a62f9 100644 --- a/java/app_test.go +++ b/java/app_test.go @@ -3491,3 +3491,34 @@ func TestEnforceRRO_propagatesToDependencies(t *testing.T) { }) } } + +func TestExportedProguardFlagFiles(t *testing.T) { + ctx, _ := testJava(t, ` + android_app { + name: "foo", + sdk_version: "current", + static_libs: ["lib1"], + } + + android_library { + name: "lib1", + sdk_version: "current", + optimize: { + proguard_flags_files: ["lib1proguard.cfg"], + } + } + `) + + m := ctx.ModuleForTests("foo", "android_common") + hasLib1Proguard := false + for _, s := range m.Rule("java.r8").Implicits.Strings() { + if s == "lib1proguard.cfg" { + hasLib1Proguard = true + break + } + } + + if !hasLib1Proguard { + t.Errorf("App does not use library proguard config") + } +} |