Skip to content

Commit 94ff365

Browse files
committed
Disable checkerframework Gradle plugin by default.
See comment.
1 parent 60defce commit 94ff365

File tree

3 files changed

+38
-2
lines changed

3 files changed

+38
-2
lines changed

lsif-java/src/main/scala/com/sourcegraph/lsif_java/buildtools/GradleBuildTool.scala

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,17 @@ class GradleBuildTool(index: IndexCommand) extends BuildTool("Gradle", index) {
7878
buildCommand +=
7979
s"-Porg.gradle.java.installations.paths=${toolchains.paths()}"
8080
}
81-
buildCommand ++= index.finalBuildCommand(List("clean", "compileTestJava"))
81+
buildCommand ++=
82+
index.finalBuildCommand(
83+
List(
84+
// Disable the checkerframework plugin because it updates the processorpath
85+
// in a way that causes the error "plug-in not found: semanticdb".
86+
// Details: https://github.com/kelloggm/checkerframework-gradle-plugin/blob/76d1926ae22144b082dfcfde1abe625750469398/src/main/groovy/org/checkerframework/gradle/plugin/CheckerFrameworkPlugin.groovy#L374-L376
87+
"-PskipCheckerFramework",
88+
"clean",
89+
"compileTestJava"
90+
)
91+
)
8292
buildCommand += lsifJavaDependencies
8393

8494
val result = index.process(buildCommand, env = Map("TERM" -> "dumb"))

tests/buildTools/src/test/scala/tests/BaseBuildToolSuite.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ abstract class BaseBuildToolSuite extends MopedSuite(LsifJava.app) {
7676
if (semanticdbFiles.length != expectedSemanticdbFiles) {
7777
fail(
7878
s"Expected $expectedSemanticdbFiles SemanticDB file(s) to be generated.",
79-
clues(semanticdbFiles)
79+
clues(semanticdbFiles, app.capturedOutput)
8080
)
8181
}
8282
if (expectedPackages.nonEmpty) {

tests/buildTools/src/test/scala/tests/GradleBuildToolSuite.scala

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,4 +207,30 @@ class GradleBuildToolSuite extends BaseBuildToolSuite {
207207
2, // Two files because `conf/routes` generates a Java file.
208208
initCommand = gradleVersion("6.8")
209209
)
210+
211+
checkBuild(
212+
"checkerframework",
213+
"""|/build.gradle
214+
|plugins {
215+
| id 'java'
216+
| id 'org.checkerframework' version '0.5.24'
217+
|}
218+
|repositories {
219+
| mavenCentral()
220+
|}
221+
|java {
222+
| toolchain {
223+
| languageVersion = JavaLanguageVersion.of(8)
224+
| }
225+
|}
226+
|/src/main/java/foo/Example.java
227+
|package foo;
228+
|public class Example {}
229+
|/src/test/java/foo/ExampleSuite.java
230+
|package foo;
231+
|public class ExampleSuite {}
232+
|""".stripMargin,
233+
2,
234+
initCommand = gradleVersion("6.8.3")
235+
)
210236
}

0 commit comments

Comments
 (0)