Closed sirinath closed 3 years ago
Yes! Would you be willing to contribute it? I assume you are an SBT user, which none of the Checker Framework developers is. Therefore, you can do this much more efficiently than we can, and you can test it in real-world scenarios which we cannot.
The introduction to the "Integration with external tools" chapter (before the first section) gives some hints about how to get started.
I am not that familiar with SBT internals.
To write a plugin might require use of SBT internals. To write a manual section about how to change your own build files should be possible without knowledge of SBT internals. Would you be willing to do that? Thanks in advance.
Is the Checker Framework configured through java options?
Can you specify all checkers?
Is the Checker Framework configured through java options?
Yes. The Introduction says:
These checkers are easy to use and are invoked as arguments to javac.
That is also explained in the "Integration with external tools" chapter, which says:
If your build system or IDE is not listed above, you should customize how it runs the javac command on your behalf. See your build system or IDE documentation to learn how to customize it, adapting the instructions for javac in Section 35.6.
I think you can do something like javacOptions ++= Seq( ... )
Following would be a way to get it working:
javacOptions ++= Seq(
"-J-Xbootclasspath/p:$CHECKERFRAMEWORK/checker/dist/javac.jar",
"-cp $CHECKERFRAMEWORK/checker/dist/checker-qual.jar",
"-processorpath $CHECKERFRAMEWORK/checker/dist/checker.jar",
"-processor org.checkerframework.checker.nullness.NullnessChecker",
"-source 8", "-target 8"
)
javacOptions ++= Seq(
"-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED",
"-processorpath $CHECKERFRAMEWORK/checker/dist/checker.jar",
"-cp $CHECKERFRAMEWORK/checker/dist/checker-qual.jar",
"-processor org.checkerframework.checker.nullness.NullnessChecker"
)
javacOptions ++= Seq(
"-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED",
"-processorpath $CHECKERFRAMEWORK/checker/dist/checker.jar",
"--module-path $CHECKERFRAMEWORK/checker/dist/checker-qual.jar",
"-processor org.checkerframework.checker.nullness.NullnessChecker"
)
Thank you for these details. I have created a pull request to put them in the manual.
Can you mention an all available processor
list on one place so this line can be directly copied for the javac
options?
Do you mean the list that appears in https://checkerframework.org/manual/#introduction?
I don't think it's good style to run every possible checker. The manual recommends starting with just one, so I don't want to violate this recommendation in the new section by showing a verbose -processor
argument that includes every checker.
I have added a cross-reference to section 2.2, however. Does that help?
Yes. But you can add a table/list of processors which you can choose from.
Where in the manual would you like that table/list to appear?
Better under command line where the checkers are listed out.
You said "in the intro", but the list is already in the introduction. It's literally the 4th sentence in the manual.
OK, you edited your comment from "in the intro" to "Better under command line where the checkers are listed out." I don't understand what you are referring to. Can you be more specific, with a concrete reference to a manual section?
All information is scattered around in the manual. So you can have:
javac
option in one place with a summaryIt can be 2 appendices if it turns out to be too long.
I'm going to merge the pull request now, since it addresses the original issue.
A distinct issue is creating an appendix that mixes together all information about all checkers. If you wish to do that, please open a pull request for it.
Thanks again for the SBT instructions; I appreciate it!
Can SBT support be added.