Add JUnit runlisteners to benchmark proguard
Bug: 354264743
Test: ./gradlew compose:foundation:foundation-benchmark:cC -P android.testInstrumentationRunnerArguments.class=androidx.compose.foundation.benchmark.NestedScrollerBenchmark -P android.testInstrumentationRunnerArguments.listener=androidx.benchmark.junit4.SideEffectRunListener # with R8 enabled in the module
Relnote: "Keep subclasses of org.junit.runner.notification.RunListener
in benchmark library proguard"
Previously we covered InstrumentationRunListeners (such as we use for
reporting json files) in the proguard file, but were missing the JUnit ones.
Change-Id: Ic8ed5d229c53d4f7779429e003331c251a5f1b39
diff --git a/benchmark/benchmark-junit4/proguard-rules.pro b/benchmark/benchmark-junit4/proguard-rules.pro
index 544c831..621d897 100644
--- a/benchmark/benchmark-junit4/proguard-rules.pro
+++ b/benchmark/benchmark-junit4/proguard-rules.pro
@@ -18,6 +18,7 @@
## needed for listeners instantiated by reflection (e.g. InstrumentationResultsRunListener)
-keepclasseswithmembers class * extends androidx.test.internal.runner.listener.InstrumentationRunListener { *; }
+-keepclasseswithmembers class * extends org.junit.runner.notification.RunListener { *; }
## Needed due to b/328649293 - shouldn't be needed since they're ref'd by manifest
## May need to leave these in place long term to account for old gradle versions