android / android/nowinandroid
[Bug]: Configuration Cache is breaking because of Google's OSS Licenses plugin
- Dominant language
- Kotlin
- Stars
- 21.8k
- Forks
- 4.6k
- Avg merge
- 19h 20m
- Merged PRs (30d)
- 2
Description
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Is there a StackOverflow question about this issue?
- [x] I have searched StackOverflow
### What happened?
Google's OSS Licenses plugin flags its task as `notCompatibleWithConfigurationCache()` (not sure why but it has almost always been that way):
https://github.com/google/play-services-plugins/blob/221054395faf95cae5c77a6f1f3446f8b6cbfb2d/oss-licenses-plugin/src/main/groovy/com/google/android/gms/oss/licenses/plugin/OssLicensesPlugin.groovy#L56
Unfortunately, this means the entire configuration cache is discarded on each build that triggers it (e.g. local builds of the `:app` module).
You can see here an example of it: https://youtu.be/JFmGwHrIt84?t=1011 (👋 @ljacomet) and the task being listed at 19min 32s in the video.
I'll open a PR to only apply this plugin on CI builds where configuration cache is not relevant _yet_.
---
Also, fwiw this plugin is currently quite broken as it does not respect edge-to-edge, and does not seem to be taken very seriously :/ long standing issues not being acknowledged or actively worked on:
- https://github.com/google/play-services-plugins/issues/246
- https://github.com/google/play-services-plugins/issues/296
@dturner would you be open to a lib migration to something more actively maintained?
I'm looking at [cashapp/licensee](https://github.com/cashapp/licensee), which has been already mentionned here:
- https://github.com/android/nowinandroid/issues/1022
This would require a bit of code for the display part, but it would allow this project to be:
- configuration-cache compatible
- Proper light/dark theme support based on the app state
- Compose UI (and extensible, it would not be hard to make something cleaner than what the plugin does at this time)
- Validation task on third party licenses (similar in spirit to what we do with the badging process for the manifest and dependency-guard for the dependencies)
Here is what it could look like ([PR](https://github.com/SimonMarquis/Android-Playground/pull/160) in one of my project where I did the migration a while ago)
| 🌑 | ☀️ |
|--------|--------|
|  |  |
### Relevant logcat output
```shell
```
### Code of Conduct
- [x] I agree to follow this project's Code of Conduct
Contributor guide
Research direction
Locate where Google's OSS Licenses plugin is applied to the :app module and how CI builds are configured. Reproduce a local build that triggers the plugin, then verify that applying it only on CI preserves the configuration cache for local builds.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100