Skip to content

Commit d9c9a36

Browse files
committed
Only assign options.isFork if needed
This is in preparation for Gradle 9 that will change isFork to a lazy property (and dynamically rewrite the plugin bytecode) which will make it immutable at execution time. With this change, users can manually configure isFork=true when needed to avoid the error, as the plugin will no longer try to set isFork to true if it already is. This is a first step towards fixing #97
1 parent 4954b35 commit d9c9a36

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/kotlin/net/ltgt/gradle/errorprone/ErrorPronePlugin.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ class ErrorPronePlugin @Inject constructor(
135135
if (!errorproneOptions.isEnabled.getOrElse(false)) return@doFirst
136136
jvmArgumentProvider.compilerVersion?.let {
137137
if (it < JavaVersion.VERSION_1_8) throw UnsupportedOperationException(TOO_OLD_TOOLCHAIN_ERROR_MESSAGE)
138-
if (it == JavaVersion.VERSION_1_8 || (it == JavaVersion.current() && CURRENT_JVM_NEEDS_FORKING)) options.isFork = true
138+
if ((it == JavaVersion.VERSION_1_8 || (it == JavaVersion.current() && CURRENT_JVM_NEEDS_FORKING)) && !options.isFork) options.isFork = true
139139
}
140140
}
141141
}

0 commit comments

Comments
 (0)