@@ -17,9 +17,10 @@ plugins {
1717If you are upgrading from plugin version 0.x to 1.x, see the [ migration
1818guide] ( #migrating-from-0x-to-1x ) .
1919
20- The plugin supports Gradle versions 7.3 and above, which requires Java 17 and
21- above. Although you must compile your project using at least Java 17, the
22- compiled classfiles can be compatible with, and can run on, any version of Java.
20+ The plugin supports Gradle version 7.3 and later, and it requires Java 17 or
21+ later. Although you must compile your project using at least Java 17, the
22+ compiled class files can be compatible with, and can run on, any version of
23+ Java.
2324
2425The plugin is compatible with Gradle's [ configuration
2526cache] ( https://docs.gradle.org/current/userguide/configuration_cache.html ) .
@@ -32,7 +33,7 @@ You must specify which
3233[ version] ( https://github.com/typetools/checker-framework/releases ) of the
3334Checker Framework to use.
3435
35- * The Gradle developers recommend to modify two files. Add this to ` build.gradle ` :
36+ * The Gradle developers recommend modifying two files. Add this to ` build.gradle ` :
3637
3738 ``` groovy
3839 checkerFramework {
@@ -47,24 +48,25 @@ Checker Framework to use.
4748 checker-framework = " org.checkerframework:checker:4.2.3"
4849 ```
4950
50- * Alternately , you can edit just one file. Add this to ` build.gradle ` :
51+ * Alternatively , you can edit just one file. Add this to ` build.gradle ` :
5152
5253 ``` groovy
5354 checkerFramework {
5455 version = "4.2.3"
5556 }
5657 ```
5758
58- The special value ** "local"** means to use a locally-built version of the
59- Checker Framework, found at environment variable ` $CHECKERFRAMEWORK ` .
59+ The special value ** "local"** means to use a locally built version of the
60+ Checker Framework, in the directory named by the ` CHECKERFRAMEWORK ` environment
61+ variable.
6062
6163The command-line argument ** ` -PcfVersion=... ` ** (where "..." is a version number
62- or "local") overrides settings in gradle buildfiles .
64+ or "local") overrides settings in Gradle build files .
6365
6466#### Checker Framework jar files
6567
66- Alternately , you can directly specify which checker and checker-qual jars to
67- use. You must also set the Checker Framework version to the special value
68+ Alternatively , you can directly specify which checker and checker-qual jar files
69+ to use. You must also set the Checker Framework version to the special value
6870** ` "dependencies" ` ** . Put the following in your ` build.gradle ` file:
6971
7072``` groovy
@@ -86,7 +88,8 @@ dependencies {
8688
8789### Which checkers to run
8890
89- You must specify which checkers to run using ` checkerFramework.checkers ` property.
91+ You must specify which checkers to run, using the ` checkerFramework.checkers `
92+ property.
9093
9194For example, using Groovy syntax in a ` build.gradle ` file:
9295
@@ -167,9 +170,9 @@ checkerFramework {
167170}
168171```
169172
170- From the command line, add ` -PskipCheckerFramework ` to your gradle invocation. You can also pass
171- ` -PskipCheckerFramework=false ` to enable the Checker Framework even if the configuration has
172- ` skipCheckerFramework = true ` .
173+ From the command line, add ` -PskipCheckerFramework ` to your Gradle invocation.
174+ You can also pass ` -PskipCheckerFramework=false ` to enable the Checker Framework
175+ even if the configuration has ` skipCheckerFramework = true ` .
173176
174177### Disabling the Checker Framework for tests
175178
@@ -240,12 +243,12 @@ for different subprojects (for instance, if you want to run different checkers).
240243
241244## Modules
242245
243- The Checker Framework inserts inferred annotations into bytecode even if none
244- appear in source code, so you must make them known to the compiler even if you
245- write no annotations in your code. When running the plugin on a Java project
246- that uses modules, you need to add annotations to the module path .
246+ When running the plugin on a Java project that uses modules, you need to add the
247+ annotations to the module path. This is necessary even if you write no
248+ annotations in your code, because the Checker Framework inserts inferred
249+ annotations into the bytecode .
247250
248- Add following to your ` module-info.java ` :
251+ Add the following to your ` module-info.java ` :
249252
250253``` java
251254requires org. checkerframework. checker. qual;
@@ -254,7 +257,7 @@ requires org.checkerframework.checker.qual;
254257The addition of ` requires ` is typically enough.
255258
256259If it does not fix your compilation issues, you can additionally add the ` checker-qual.jar `
257- artifact (which only contains annotations) to the module path:
260+ artifact (which contains only annotations) to the module path:
258261
259262``` groovy
260263checkerFramework {
@@ -272,36 +275,36 @@ the [Lombok Gradle Plugin](https://plugins.gradle.org/plugin/io.freefair.lombok)
272275to delombok your source code before it is passed to the Checker Framework
273276for type-checking. This plugin does not support any other use of Lombok.
274277
275- For the Checker Framework to work properly on delombok'd source code,
278+ For the Checker Framework to work properly on delomboked source code,
276279you must include the following key in your project's ` lombok.config ` file:
277280
278281``` config
279282lombok.addLombokGeneratedAnnotation = true
280283```
281284
282285By default, Lombok suppresses all warnings in the code it generates. If you
283- want to typecheck the code that Lombok generates, set the ` addSuppressWarnings `
284- to false:
286+ want to typecheck the code that Lombok generates, set ` addSuppressWarnings ` to
287+ false:
285288
286289``` config
287290lombok.addSuppressWarnings = false
288291```
289292
290- Note that doing so will cause * all* tools (including Javac itself) to begin issuing
293+ Note that doing so will cause * all* tools (including javac itself) to begin issuing
291294warnings in the code that Lombok generates.
292295
293- ## Using a locally- built plugin
296+ ## Using a locally built plugin
294297
295- To use a locally- modified version of this plugin:
298+ To use a locally modified version of this plugin:
296299
2973001 . Publish the plugin to your local Maven repository:
298301
299302 ``` sh
300303 ./gradlew publishToMavenLocal
301304 ```
302305
303- 2 . Add the following to the ` settings.gradle ` file in
304- the Gradle project that you want to use the plugin:
306+ 2 . Add the following to the ` settings.gradle ` file of the Gradle project in
307+ which you want to use the plugin:
305308
306309 ``` groovy
307310 pluginManagement {
@@ -336,7 +339,7 @@ you need to make some changes in order to use version 1.x.
336339 to configure interaction with Lombok.
337340
338341 * ** ` skipVersionCheck ` ** : There is no longer a version check that might cause
339- "zip file too large" error. Remove the ` -PskipVersionCheck ` command-line
342+ a "zip file too large" error. Remove the ` -PskipVersionCheck ` command-line
340343 argument and remove Gradle code like
341344
342345 ``` groovy
@@ -345,34 +348,34 @@ you need to make some changes in order to use version 1.x.
345348 }
346349 ```
347350
348- * **`cfLocal`**: Set the version to `"local"` to use a locally- built version
351+ * **`cfLocal`**: Set the version to `"local"` to use a locally built version
349352 of the Checker Framework. Change command-line argument `-PcfLocal` to
350353 `-PcfVersion=local`. (Note: The `cfLocal` functionality was not an
351354 official part of the plugin, but a number of projects use it.)
352355
353- 4. If you want to use a non-standard Checker Framework jar file (such as that of
354- eisop) see [Checker Framework jar files](#checker-framework-jar-files).
356+ 4. If you want to use a nonstandard Checker Framework jar file (such as that of
357+ eisop), see [Checker Framework jar files](#checker-framework-jar-files).
355358
356359## Troubleshooting
357360
358361### ClassCastException for a javac class
359362
360363If you encounter a crash with a `ClassCastException` referencing some internal
361- Javac class, disable incremental compilation in your build using the following
364+ javac class, disable incremental compilation in your build using the following
362365code in your `checkerFramework` configuration block:
363366
364367```groovy
365- checkerFramework {
366- incrementalize = false
367- }
368+ checkerFramework {
369+ incrementalize = false
370+ }
368371```
369372
370373Background: By default, the plugin assumes that all checkers are [ "isolating
371374incremental annotation
372375processors"] ( https://docs.gradle.org/current/userguide/java_plugin.html#sec:incremental_annotation_processing ) .
373376This assumption speeds up builds by enabling incremental compilation. Gradle's
374377documentation warns that incremental compilation with the Checker Framework
375- plugin (or any other plugin that uses internal Javac APIs) may crash, because
378+ plugin (or any other plugin that uses internal javac APIs) may crash, because
376379Gradle wraps some of those APIs.
377380
378381### Incompatibility with Error Prone 2.3.4 and earlier
@@ -382,9 +385,9 @@ you need to use Error Prone version 2.4.0 (released in May 2020) or later.
382385
383386<!--
384387LocalWords: JavaCompile gradle checkerframework checkerFramework toml lombok
385- LocalWords: PcfVersion buildfiles qual eisopVersion eisop1 checkerQual config
388+ LocalWords: PcfVersion qual eisopVersion eisop1 checkerQual config delomboked
386389LocalWords: kotlin CheckerFrameworkExtension listOf extraJavacArgs Multi eisop
387- LocalWords: Werror Astubs testCompileJava excludeTests camelCase classfiles
390+ LocalWords: Werror Astubs testCompileJava excludeTests camelCase
388391LocalWords: withType configureEach compileMainGeneratedDataTemplateJava
389392LocalWords: compileMainGeneratedRestJava subprojects allprojects mavenLocal
390393LocalWords: delombok addLombokGeneratedAnnotation addSuppressWarnings cfLocal
0 commit comments