Commit 562af69
authored
Add apiguardian-api runtime dependency to satisfy ART's internal runtime annotation loader (#306)
Essentially, `@API` is added to most of the JUnit 5 annotations. This is an annotation
from a library called "API Guardian", which declares a `RUNTIME` visibility.
For Android specifically, this visibility makes it eligible for native annotation scanning
when calling `Class.isAnnotationPresent()` on any of the JUnit 5 annotations with that meta-annotation.
The problem is that JUnit Jupier declares its transitive dependency as "compile-only",
causing `@API` to be absent at runtime. This creates a log statement every time an annotation
is queried, causing very noisy logs.
The fix is to submit API Guardian as a runtime-only dependency to the instrumentation core.
Refs:
https://github.com/junit-team/junit5/blob/70e33483530259edef1ab3c1ba12971ac3fc7db7/junit-platform-commons/src/main/java/org/junit/platform/commons/util/AnnotationUtils.java#L136C38-L136C57
https://cs.android.com/android/platform/superproject/main/+/main:art/runtime/dex/dex_file_annotations.cc;l=780-781
Resolves #291.1 parent 4c200a0 commit 562af69
File tree
3 files changed
+20
-0
lines changed- build-logic/src/main/kotlin
- instrumentation
- core
- runner/src/main/kotlin/de/mannodermaus/junit5/internal/runners
3 files changed
+20
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
79 | 84 | | |
80 | 85 | | |
81 | 86 | | |
| |||
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| |||
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
22 | 36 | | |
23 | 37 | | |
24 | 38 | | |
| |||
0 commit comments