Skip to content
This repository was archived by the owner on Mar 2, 2026. It is now read-only.
This repository was archived by the owner on Mar 2, 2026. It is now read-only.

Cannot implement checkerframework by using task avoidance #263

@Chrispie

Description

@Chrispie

I want to implement the checker framework and not create unnecessary tasks until it is needed. Hence for any changes made to our gradle build we run a gradle build scan to try and avoid task creation. See Gradle's avoidance page.

To keep things as simple as possible I created an empty Gradle project and modified the build.gradle.kts file to look as follows:

plugins {
    id("java")
    id("org.checkerframework") version "0.6.35"
}

apply(plugin = "org.checkerframework")

checkerFramework {
    checkers = listOf("org.checkerframework.checker.nullness.NullnessChecker")
    excludeTests = true
}

dependencies {
    compileOnly("org.checkerframework:checker-qual:3.41.0")
    testCompileOnly("org.checkerframework:checker-qual:3.41.0")
    checkerFramework("org.checkerframework:checker:3.41.0")
}

Running a build scan via the command line .\gradlew.bat help --scan I can see that the task "createCheckerFrameworkManifest" gets created everytime. If it is a multi level project this gets created per subproject.

Had a look and it seems to be in the CheckerFrameworkPlugin.groovy class where the findByName method will go and create the task every time:

// To keep the plugin idempotent, check if the task already exists.
def createManifestTask = project.tasks.findByName(checkerFrameworkManifestCreationTaskName)
if (createManifestTask == null) {
  createManifestTask = project.task(checkerFrameworkManifestCreationTaskName, type: CreateManifestTask)
  createManifestTask.checkers = userConfig.checkers
  createManifestTask.incrementalize = userConfig.incrementalize
}

Is there any future plans to make the plugin task avoidance compliant?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions