blob: 621d897e5a2a6f158e394cfed6bed687f8a50bdf [file] [log] [blame]
Chris Craikcecc57f2024-03-05 16:46:59 -08001## These rules enable microbenchmarking from a minified test, as an experimental feature
2
Chris Craik23c069d42024-05-13 15:35:58 -07003# Custom JNI registration, so entire class must be kept
4-keepclasseswithmembers class androidx.benchmark.BlackHole { *; }
5
Chris Craikcecc57f2024-03-05 16:46:59 -08006# basic protection against junit/androidx.test reflection, shouldn't affect library/test code
7-keepclasseswithmembers class androidx.test.** { *; }
8-keepclasseswithmembers class org.junit.** { *; }
9-keepclasseswithmembers class junit.** { *; }
10-dontwarn com.google.errorprone.annotations.MustBeClosed
Chris Craik94a0e982024-05-06 15:12:42 -070011-dontwarn com.google.errorprone.annotations.CanIgnoreReturnValue
Chris Craikcecc57f2024-03-05 16:46:59 -080012
13## keep test classes
14-keepclasseswithmembers @org.junit.runner.RunWith class * { *; }
15
16## needed for org.junit.Test annotation to be discoverable by reflection
17-keepattributes *Annotation*
18
Chris Craik94a0e982024-05-06 15:12:42 -070019## needed for listeners instantiated by reflection (e.g. InstrumentationResultsRunListener)
20-keepclasseswithmembers class * extends androidx.test.internal.runner.listener.InstrumentationRunListener { *; }
Chris Craikef02fd52024-08-26 16:06:43 -070021-keepclasseswithmembers class * extends org.junit.runner.notification.RunListener { *; }
Chris Craik94a0e982024-05-06 15:12:42 -070022
Chris Craikcecc57f2024-03-05 16:46:59 -080023## Needed due to b/328649293 - shouldn't be needed since they're ref'd by manifest
24## May need to leave these in place long term to account for old gradle versions
25-keepclasseswithmembers class androidx.benchmark.junit4.AndroidBenchmarkRunner { *; }
26-keepclasseswithmembers class androidx.benchmark.IsolationActivity { *; }
Chris Craik94a0e982024-05-06 15:12:42 -070027
28## Needed due to b/339085669 - shouldn't be needed as they're referenced by code
29-keepclasseswithmembers class androidx.benchmark.json.BenchmarkData$TestResult$ProfilerOutput$Type { *; }