You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore: remove BCV plugin (incompatible with AGP 9) (#214)
## Summary
- Remove Binary Compatibility Validator (BCV) plugin from all modules — it silently stopped working after the AGP 9 upgrade
- AGP 9 rejects `kotlin-android` plugin, which BCV hooks into for task registration
- Neither BCV nor KGP's `abiValidation` currently support AGP 9's built-in Kotlin
- Keep existing `.api` files as historical reference
### Upstream issue
[Kotlin/binary-compatibility-validator#312](Kotlin/binary-compatibility-validator#312) — BCV tasks not registered with AGP 9 (open, no fix)
This project uses [Binary Compatibility Validator](https://github.com/Kotlin/binary-compatibility-validator) (BCV) to track public API changes and prevent accidental breaking changes.
3
+
## Current Status: Temporarily Disabled
4
+
5
+
API compatibility validation is **temporarily disabled** due to an incompatibility between AGP 9's built-in Kotlin support and the [Binary Compatibility Validator](https://github.com/Kotlin/binary-compatibility-validator) (BCV) plugin.
6
+
7
+
### What happened
8
+
9
+
AGP 9 introduced built-in Kotlin compilation support and actively rejects the `org.jetbrains.kotlin.android` plugin. BCV hooks into that plugin to register its `apiCheck`/`apiDump` tasks. Without it, BCV applies silently but registers no tasks — API validation was broken since the AGP 9 upgrade with no visible error.
10
+
11
+
The intended replacement — Kotlin Gradle Plugin's built-in `abiValidation` — has the same limitation: it requires `KotlinAndroidProjectExtension` which AGP 9's built-in Kotlin does not provide.
12
+
13
+
### Upstream issues
14
+
15
+
-[Kotlin/binary-compatibility-validator#312](https://github.com/Kotlin/binary-compatibility-validator/issues/312) — BCV tasks not registered with AGP 9 (open, no maintainer response)
16
+
-[KT-81117](https://youtrack.jetbrains.com/issue/KT-81117) — KGP conflicts with AGP 9 built-in Kotlin
17
+
- BCV is in [maintenance mode](https://github.com/Kotlin/binary-compatibility-validator#readme), superseded by KGP's `abiValidation` (experimental since Kotlin 2.1.20)
18
+
19
+
### Workarounds considered
20
+
21
+
| Approach | Status |
22
+
|----------|--------|
23
+
|`android.builtInKotlin=false`| Works but temporary — removed in AGP 10 |
These files are checked into version control and serve as the "golden" reference for the public API.
25
-
26
-
## Gradle Tasks
27
-
28
-
| Task | Purpose |
29
-
|------|---------|
30
-
|`./gradlew apiCheck`| Compares current API against `.api` files. Fails if there are differences. Runs automatically as part of `check`. |
31
-
|`./gradlew apiDump`| Regenerates `.api` files from current code. Use after making intentional API changes. |
32
-
33
-
### Module-specific tasks
34
-
35
-
```bash
36
-
# Check a specific module
37
-
./gradlew :debugoverlay-core:apiCheck
38
-
39
-
# Update a specific module's API dump
40
-
./gradlew :debugoverlay-core:apiDump
41
-
```
42
-
43
-
## Workflow
44
-
45
-
### Making API Changes
46
-
47
-
1.**Make your changes** to the public API (add/modify/remove public classes, methods, etc.)
48
-
49
-
2.**Run `apiCheck`** to see what changed:
50
-
```bash
51
-
./gradlew apiCheck
52
-
```
53
-
This will fail and show the differences.
54
-
55
-
3.**Review the diff** to ensure changes are intentional:
56
-
- Adding new public API is generally safe
57
-
- Removing or modifying existing API is a breaking change
58
-
59
-
4.**Update the API dump** if changes are intentional:
60
-
```bash
61
-
./gradlew apiDump
62
-
```
63
-
64
-
5.**Commit both** your code changes and the updated `.api` files together.
65
-
66
-
### CI Failures
67
-
68
-
If CI fails on `apiCheck`:
69
-
70
-
1.**Accidental change?** - Revert unintended public API exposure (e.g., missing `internal` modifier)
71
-
72
-
2.**Intentional change?** - Run `apiDump` locally and commit the updated `.api` files
73
-
74
-
3.**Merge conflict in `.api` files?** - Regenerate with `apiDump` after resolving code conflicts
55
+
These files are checked into version control. While validation is disabled, they serve as a reference but are not automatically checked against the current code.
75
56
76
57
## Handling Breaking Changes
77
58
@@ -84,16 +65,6 @@ existing implementers (they must implement the new member). However, since Debug
84
65
provides concrete implementations (e.g., `DebugOverlayTimberTree` for `LogSource`),
85
66
consumers typically don't implement these interfaces directly.
86
67
87
-
```kotlin
88
-
// Adding a new class (safe)
89
-
publicclassNewFeature { ... }
90
-
91
-
// Adding a new method to an object (safe)
92
-
publicobject DebugOverlay {
93
-
publicfunnewMethod() { ... } // New - existing code unaffected
0 commit comments