tbroyer / gradle-errorprone-plugin

Gradle plugin to use the error-prone compiler for Java

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compilation error are not printed

gogainda opened this issue · comments

Hi,
I am trying to integration error prone check into my home project.

Build file looks like this:

plugins {
    id 'java'
}

group 'com.example'
version '1.0-SNAPSHOT'

repositories {
    mavenCentral()
}

configurations {

    errorProneJavac
    checkerFrameworkCheckerJar {
        description = 'the Checker Framework, including the Type Annotations compiler'
    }
}

dependencies {
    errorProneJavac group: 'com.google.errorprone', name: 'javac', version: '9+181-r4173-1'

    checkerFrameworkCheckerJar(
            'com.google.errorprone:error_prone_core:2.10.0',
            'org.checkerframework:dataflow-errorprone:3.27.0'
    )

    ...
}


compileJava {
    options.fork = true
    options.annotationProcessorPath += configurations.checkerFrameworkCheckerJar
    options.compilerArgs = [
            "-Xbootclasspath/p:${configurations.errorProneJavac.asPath}".toString()
    ]
    options.forkOptions.with {
        jvmArgs = ["-Xbootclasspath/p:${configurations.errorProneJava

c.asPath} -XDcompilePolicy=simple -Xplugin:ErrorProne -Xep:ComparableType:ERROR".toString()]
    }
}

jar {
    ...
}

test {
    useJUnitPlatform()
}

and Java class:

public class PubSubTest implements Comparable {

    ...

    //should fail error prone
    @Override
    public int compareTo(@NotNull Object o) {
        return 0;
    }
}

When I am trying to build it with Gradle 7.4 with ./gradlew build - it builds correctly but without any error or warnings.

Have I missed here?

Attached an example project pubsub-push.zip