kelloggm / checkerframework-gradle-plugin

Gradle plugin to use the Checker Framework for Java
Apache License 2.0
64 stars 15 forks source link

Add support for EISOP fork #275

Open koppor opened 1 week ago

koppor commented 1 week ago

At https://github.com/kelloggm/checkerframework-gradle-plugin/blob/92ecb95e6e6977bc7c05e3f9e3215b0697cbb510/src/main/groovy/org/checkerframework/gradle/plugin/CheckerFrameworkPlugin.groovy#L315, it seems that org.checkerframework is hardcoded.

What if I would like to use The EISOP Checker Framework.

My reason: It seems that that fork supports jspecify well enough (source: https://github.com/jspecify/jspecify-reference-checker?tab=readme-ov-file#relationship-to-checker-framework-and-eisop).


It would also be nice, if there was a short howto to use the jspecify plugin

https://github.com/jspecify/jspecify-reference-checker?tab=readme-ov-file#the-jspecify-reference-checker

kelloggm commented 1 week ago

it seems that org.checkerframework is hardcoded.

It is, but the line you indicated in the issue is not the relevant one. Instead, the important one is here: https://github.com/kelloggm/checkerframework-gradle-plugin/blob/92ecb95e6e6977bc7c05e3f9e3215b0697cbb510/src/main/groovy/org/checkerframework/gradle/plugin/CheckerFrameworkPlugin.groovy#L42

It would be possible to make the default Checker Framework dependency configurable by adding an option to the plugin's extension, which would allow you to set it to use the EISOP version. However, that seems non-idiomatic to me: it would require a user like you who wants to use the EISOP version of the CF to set a custom flag rather than just replacing a dependency. Unfortunately, I think this non-idiomaticness is unavoidable, because one of the primary functions of this plugin is to automatically add a dependency on the Checker Framework to the project to which it is applied.

Given the complexity of the use case that you have, it might be easier for you to write custom build logic yourself rather than going through this plugin: if you're not using the main org.checkerframework version of the CF, this plugin doesn't offer much.

wmdietl commented 1 week ago

The gradle plugin works nicely with the EISOP version. We will improve the instructions for how to do this https://github.com/eisop/checker-framework/issues/785 I currently don't see any special treatment we would need in the gradle plugin.

alexvas commented 5 days ago

@kelloggm actually these instructions are not quite correct. When specifying

 ext {
    versions = [
        eisopVersion: '3.42.0-eisop1',
    ]
}

dependencies {
    compileOnly "io.github.eisop:checker-qual:${versions.eisopVersion}"
    testCompileOnly "io.github.eisop:checker-qual:${versions.eisopVersion}"
    checkerFramework "io.github.eisop:checker:${versions.eisopVersion}"
}

(as in instructions) one gets at STDOUT:

No explicit dependency on the Checker Framework found, using default version 3.44.0

Checker plugin version is 0.6.40