Skip to content

Commit

Permalink
Only assign options.isFork if needed
Browse files Browse the repository at this point in the history
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
  • Loading branch information
tbroyer committed Jun 21, 2024
1 parent 4954b35 commit d9c9a36
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class ErrorPronePlugin @Inject constructor(
if (!errorproneOptions.isEnabled.getOrElse(false)) return@doFirst
jvmArgumentProvider.compilerVersion?.let {
if (it < JavaVersion.VERSION_1_8) throw UnsupportedOperationException(TOO_OLD_TOOLCHAIN_ERROR_MESSAGE)
if (it == JavaVersion.VERSION_1_8 || (it == JavaVersion.current() && CURRENT_JVM_NEEDS_FORKING)) options.isFork = true
if ((it == JavaVersion.VERSION_1_8 || (it == JavaVersion.current() && CURRENT_JVM_NEEDS_FORKING)) && !options.isFork) options.isFork = true
}
}
}
Expand Down

0 comments on commit d9c9a36

Please sign in to comment.