Giter Club home page Giter Club logo

lombok-checkframework's Introduction

Sample project with Lombok, Checker Framework and Gradle

See build.gradle.

Run with Check Framework

You can see Checker Framework working with gradle and lombok. In terminal:

$ ./gradlew clean compileJava
:clean
:compileJava
/Users/kui/IdeaProjects/lombok-checkframework/src/main/java/Main.java:7: エラー: [argument.type.incompatible] incompatible types in argument.
        greet(null);
              ^
  found   : null
  required: @Initialized @NonNull Person
エラー1個
:compileJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 1.429 secs

Check test codes

Current gradle was configured that Checker Framework checks src/main codes, and doesn't check test codes.

Fix as belowing if you want to check test codes too:

diff --git a/build.gradle b/build.gradle
index 8718de3..ea4114c 100644
--- a/build.gradle
+++ b/build.gradle
@@ -30,12 +30,12 @@ dependencies {
     compileOnly lombok
 }

-compileJava {
+tasks.withType(JavaCompile).all { compile ->
     def processors = [
             'org.checkerframework.checker.nullness.NullnessChecker',
             'lombok.launch.AnnotationProcessorHider\$AnnotationProcessor',
     ]
-    options.compilerArgs = [
+    compile.options.compilerArgs = [
             '-processor', processors.join(','),
             '-processorpath', "${configurations.annotationProcessors.asPath}",
             "-Xbootclasspath/p:${configurations.checkerFrameworkAnnotatedJDK.asPath}"

lombok-checkframework's People

Contributors

kui avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.