File tree Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -722,14 +722,23 @@ abstract class MuzzleTask extends DefaultTask {
722
722
MuzzleDirective muzzleDirective = null
723
723
) {
724
724
def workQueue
725
- String javaVersion = muzzleDirective?. javaVersion ?: " 8"
726
- def javaLauncher = javaToolchainService. launcherFor { spec ->
727
- spec. languageVersion. set(JavaLanguageVersion . of(javaVersion))
728
- }. get()
729
- workQueue = workerExecutor. processIsolation { spec ->
730
- spec. forkOptions { fork ->
731
- fork. executable = javaLauncher. executablePath
725
+ String javaVersion = muzzleDirective?. javaVersion
726
+ if (javaVersion) {
727
+ def javaLauncher = javaToolchainService. launcherFor { spec ->
728
+ spec. languageVersion. set(JavaLanguageVersion . of(javaVersion))
729
+ }. get()
730
+ // Note process isolation leaks gradle dependencies to the child process
731
+ // and may need additional code on muzzle plugin to filter those out
732
+ // See https://github.com/gradle/gradle/issues/33987
733
+ workQueue = workerExecutor. processIsolation { spec ->
734
+ spec. forkOptions { fork ->
735
+ fork. executable = javaLauncher. executablePath
736
+ }
732
737
}
738
+ } else {
739
+ // noIsolation worker is OK for muzzle tasks as their checks will inspect classes outline
740
+ // and should not be impacted by the actual running JDK.
741
+ workQueue = workerExecutor. noIsolation()
733
742
}
734
743
workQueue. submit(MuzzleAction . class, parameters -> {
735
744
parameters. buildStartedTime. set(invocationDetails. buildStartedTime)
You can’t perform that action at this time.
0 commit comments