slackhq / compose-lints

Lint checks to aid with a healthy adoption of Compose
https://slackhq.github.io/compose-lints
Apache License 2.0
388 stars 22 forks source link

Versions 1.4.1 and 1.4.0 require update to Android Gradle Plugin 8.7 #421

Closed dannybduval closed 4 days ago

dannybduval commented 4 days ago

When trying to test out the new version 1.4.0 and 1.4.1, it appears that the change to Lint 8.7 requires updating the Android Gradle Plugin to 8.7.

I do have a sample project that shows this - https://github.com/dannybduval/SlackLint. It is just the sample empty activity project that Android Studio Koala produces (mainly because the preview in it violates the Slack Compose Lint rule of @Preview not being marked as private).

The project has 4 different branches that can show the outcomes of the following scenarios:

AGP Version Gradle Version Slack Compose Lint Version Lint outcome
8.3.2 8.4 1.3.1 Failed (expected)
8.3.2 8.4 1.4.1 Passed (should fail)
8.6.1 8.7 1.4.1 Passed (should fail)
8.7.0 8.9 1.4.1 Failed (expected)
ZacSweers commented 4 days ago

This is intended behavior and documented in the release notes.

It also doesn't require AGP 8.7 specifically, just lint API 8.7. You can update lint independently from AGP if you don't want to update to AGP 8.7 yet.

dannybduval commented 3 days ago

Gotcha, wasn't sure if that was intended since it still worked as expected with 8.6.1 and that it's not clear that minApi was intended to mean lint. Thanks for the clarification.