Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sample Gradle config for jooq-checker #13963

Open
GavinRay97 opened this issue Sep 6, 2022 · 1 comment
Open

Sample Gradle config for jooq-checker #13963

GavinRay97 opened this issue Sep 6, 2022 · 1 comment

Comments

@GavinRay97
Copy link

The documentation URL

https://www.jooq.org/doc/latest/manual/tools/checker-framework/

Feedback

The following is a sample config I managed to work out for using jooq-checker in Gradle
The one hangup is that it requires to be run under Java 8 🙁

Execution failed for task ':compileJava'.
> org.checkerframework.javacutil.UserError: The Checker Framework must be run under JDK 1.8.  You are using version 17.000000.

Error Prone

plugins {
    `java-library`
    id("net.ltgt.errorprone") version "2.0.2"
}

repositories {
    mavenLocal()
    mavenCentral()
}

object Versions {
    val errorProne = "2.15.0"
}

dependencies {
    api("org.jooq:jooq:3.17.4")
    errorprone("org.jooq:jooq-checker:3.17.4")
    errorprone("com.google.errorprone:error_prone_core:${Versions.errorProne}")
}

tasks.withType<JavaCompile>() {
    options.encoding = "UTF-8"
    options.compilerArgs.addAll(listOf("-processor", "org.jooq.checker.SQLDialectChecker"))
}

Checker Framework

plugins {
    `java-library`
    id("org.checkerframework") version ("0.6.16")
}

repositories {
    mavenLocal()
    mavenCentral()
}

object Versions {
    val checkerFramework = "2.5.6"
}

dependencies {
    api("org.jooq:jooq:3.17.4")
    annotationProcessor("org.jooq:jooq-checker:3.17.4")

    compileOnly("org.checkerframework:checker-qual:${Versions.checkerFramework}")
    testCompileOnly("org.checkerframework:checker-qual:${Versions.checkerFramework}")
    checkerFramework("org.checkerframework:checker:${Versions.checkerFramework}")
}

tasks.withType<JavaCompile>() {
    options.compilerArgs.addAll(listOf("-processor", "org.jooq.checker.SQLDialectChecker"))
}

checkerFramework {
    checkers = listOf("org.jooq.checker.SQLDialectChecker")
}
@lukaseder
Copy link
Member

It's definitely something that could be improved, documentation wise. There's also: #8326

Although, I'm not even quite sure of the checker will work correctly on certain JDK versions. The problem is that the third parties this checker relies upon are very poorly documented themselves, and mostly satisfy the needs of their respective maintainers (e.g. Google), which haven't been upgraded to JDK 17 yet, I think? As such, the maintenance of these checkers on the jOOQ side has been quite cumbersome in the past. I'm not sure if upgrading them to work on various JDKs can be a priority, let alone documenting how to use them on different JDKs / build tools.

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

No branches or pull requests

2 participants