|
1 | 1 | plugins { |
2 | 2 | // https://plugins.gradle.org/plugin/com.gradleup.shadow |
3 | | - id("com.gradleup.shadow").version("9.2.2") |
| 3 | + alias(libs.plugins.com.gradleup.shadow) |
4 | 4 | // https://plugins.gradle.org/plugin/de.undercouch.download |
5 | | - id("de.undercouch.download").version("5.6.0") |
| 5 | + alias(libs.plugins.de.undercouch.download) |
6 | 6 | id("java") |
7 | 7 | // https://github.com/tbroyer/gradle-errorprone-plugin |
8 | | - id("net.ltgt.errorprone").version("4.3.0") |
| 8 | + alias(libs.plugins.net.ltgt.errorprone) |
9 | 9 | // https://docs.gradle.org/current/userguide/eclipse_plugin.html |
10 | 10 | id("eclipse") |
11 | 11 |
|
12 | 12 | id("groovy") // needed for formatting Gradle files |
| 13 | + |
13 | 14 | // Code formatting; defines targets "spotlessApply" and "spotlessCheck". |
14 | 15 | // https://github.com/diffplug/spotless/tags ; see tags starting "gradle/" |
15 | 16 | // Only works on JDK 11+ (even including the plugin crashes Gradle on JDK 8); |
16 | 17 | // shell scripts in checker/bin-devel/ ensure spotless isn't called unless |
17 | 18 | // the JDK is 17 or later. |
18 | | - id("com.diffplug.spotless").version("8.1.0") |
| 19 | + alias(libs.plugins.com.diffplug.spotless) |
19 | 20 | } |
20 | 21 | apply from: rootProject.file("release.gradle") |
21 | 22 |
|
@@ -122,7 +123,7 @@ spotlessPredeclare { |
122 | 123 | // > Could not create task ":spotlessJava'. |
123 | 124 | // > Add a step with [com.google.googlejavaformat:google-java-format:1.15.0] into the `spotlessPredeclare` block in the root project. |
124 | 125 | java { |
125 | | - googleJavaFormat(googleJavaFormatVersion) |
| 126 | + googleJavaFormat(libs.google.java.format.get().version) |
126 | 127 | } |
127 | 128 | groovyGradle { |
128 | 129 | greclipse() |
@@ -207,11 +208,11 @@ allprojects { currentProj -> |
207 | 208 | } |
208 | 209 |
|
209 | 210 | dependencies { |
210 | | - errorprone("com.google.errorprone:error_prone_core:${errorproneVersion}") |
| 211 | + errorprone(libs.error.prone.core) |
211 | 212 |
|
212 | | - javacJar("com.google.errorprone:javac:9+181-r4173-1") |
| 213 | + javacJar(libs.javac) |
213 | 214 |
|
214 | | - errorproneJavac("com.google.errorprone:javac:9+181-r4173-1") |
| 215 | + errorproneJavac(libs.javac) |
215 | 216 |
|
216 | 217 | allProjects(subprojects) |
217 | 218 | } |
@@ -349,10 +350,10 @@ allprojects { currentProj -> |
349 | 350 | targetExclude(doNotFormat) |
350 | 351 |
|
351 | 352 | if (project.hasProperty("eisopFormatting")) { |
352 | | - googleJavaFormat(googleJavaFormatVersion).aosp() |
| 353 | + googleJavaFormat(libs.google.java.format.get().version).aosp() |
353 | 354 | importOrder("com", "jdk", "lib", "lombok", "org", "java", "javax") |
354 | 355 | } else { |
355 | | - googleJavaFormat(googleJavaFormatVersion) // the formatter to apply to Java files |
| 356 | + googleJavaFormat(libs.google.java.format.get().version) // the formatter to apply to Java files |
356 | 357 | } |
357 | 358 | formatAnnotations() |
358 | 359 | } |
@@ -575,7 +576,7 @@ allprojects { currentProj -> |
575 | 576 | "-Xep:NonOverridingEquals:OFF", |
576 | 577 | // Suggests using a class that's in Error Prone itself, not in any library for clients. |
577 | 578 | // It requires "import com.google.errorprone.util.ASTHelpers;", and (in build.gradle) |
578 | | - // implementation("com.google.errorprone:error_prone_core:${errorproneVersion}") |
| 579 | + // implementation(libs.error.prone.core) |
579 | 580 | // Adding that line in build.gradle causes a javac crash when running the Checker Framework. |
580 | 581 | "-Xep:ASTHelpersSuggestions:OFF", |
581 | 582 | // Removing "public" from private class members loses information about the abstraction. |
@@ -825,7 +826,7 @@ configurations { |
825 | 826 | requireJavadoc |
826 | 827 | } |
827 | 828 | dependencies { |
828 | | - requireJavadoc("org.plumelib:require-javadoc:2.0.0") |
| 829 | + requireJavadoc(libs.require.javadoc) |
829 | 830 | } |
830 | 831 | tasks.register("requireJavadoc", JavaExec) { |
831 | 832 | description = "Ensures that Javadoc documentation exists in source code." |
@@ -957,8 +958,8 @@ subprojects { |
957 | 958 |
|
958 | 959 | dependencies { |
959 | 960 | // TODO: it's a bug that annotatedlib:guava requires the error_prone_annotations dependency. |
960 | | - annotatedGuava("com.google.errorprone:error_prone_annotations:${errorproneVersion}") |
961 | | - annotatedGuava("org.checkerframework.annotatedlib:guava:33.1.0.2-jre") { |
| 961 | + annotatedGuava(libs.error.prone.annotations) |
| 962 | + annotatedGuava(libs.guava) { |
962 | 963 | // So long as Guava only uses annotations from checker-qual, excluding it should not cause problems. |
963 | 964 | exclude group: "org.checkerframework" |
964 | 965 | } |
|
0 commit comments