Skip to content

Install androidx.lint-gradle plugin to flag common Gradle problems - #1196

Open
scana wants to merge 7 commits into
Triple-T:masterfrom
scana:scana/gradle-lint
Open

Install androidx.lint-gradle plugin to flag common Gradle problems#1196
scana wants to merge 7 commits into
Triple-T:masterfrom
scana:scana/gradle-lint

Conversation

@scana

@scana scana commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Hi!

Unfortunately, still seeing some issues with Gradle Project Isolation when using Gradle 9.7 and Gradle Play Publisher 4.1.1.

I would like to attempt fixing them but noticed that the project could benefit from set of lint checks provided by Google that flag deprecations or project isolation violations.

This PR:

Example problems flagged by lint checks:

.../gradle-play-publisher/play/plugin/src/main/kotlin/com/github/triplet/gradle/play/tasks/InstallInternalSharingArtifact.kt:192:
Error: Use Project.providers.environmentVariable instead of getenv [GradleConfigurationCacheBroadInputs from androidx.lint:lint-gradle]
                          System.getenv("ANDROID_SERIAL")
                                 ~~~~~~
.../gradle-play-publisher/play/plugin/src/main/kotlin/com/github/triplet/gradle/play/internal/Plugins.kt:56: 
Error: Use isolated.rootProject instead of getRootProject [GradleProjectIsolation from androidx.lint:lint-gradle]
    val project = if (extension.isolatedSingleProject.get()) this else rootProject
                                                                       ~~~~~~~~~~~

Those issues will also be highlighted in the IDE.

@scana
scana requested a review from SUPERCILEX as a code owner August 18, 2026 12:13
@SUPERCILEX

Copy link
Copy Markdown
Collaborator

Looks like you need to do this:

Fix the issues identified by lint, or create a baseline to see only new errors.
To create a baseline, run `gradlew updateLintBaseline` after adding the following to the module's build.gradle file:

lint {
baseline = file("lint-baseline.xml")
}

For more details, see https://developer.android.com/studio/write/lint#snapshot

@scana

scana commented Aug 18, 2026

Copy link
Copy Markdown
Contributor Author

@SUPERCILEX ah right - I can just update the baseline 🤦

Shall we keep tests + lint under a single GHA job? (check task will run lint under the hood)

@SUPERCILEX

Copy link
Copy Markdown
Collaborator

Shall we keep tests + lint under a single GHA job? (check task will run lint under the hood)

Yeah, that seems nicer.

@scana

scana commented Aug 19, 2026

Copy link
Copy Markdown
Contributor Author

@SUPERCILEX done! Although it seems like PromoteReleaseIntegrationTest might be flaky? Tests are passing fine for me locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants