File tree Expand file tree Collapse file tree 2 files changed +14
-10
lines changed
kotlin/datadog/gradle/plugin/muzzle Expand file tree Collapse file tree 2 files changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -152,17 +152,16 @@ abstract class InstrumentTask extends DefaultTask {
152152 }
153153
154154 private workQueue () {
155- if (this . javaVersion) {
156- def javaLauncher = this . javaToolchainService. launcherFor { spec ->
157- spec. languageVersion. set(JavaLanguageVersion . of(this . javaVersion))
158- }. get()
159- return this . workerExecutor. processIsolation { spec ->
160- spec. forkOptions { fork ->
161- fork. executable = javaLauncher. executablePath
162- }
155+ if (! this . javaVersion) {
156+ this . javaVersion = " 8"
157+ }
158+ def javaLauncher = this . javaToolchainService. launcherFor { spec ->
159+ spec. languageVersion. set(JavaLanguageVersion . of(this . javaVersion))
160+ }. get()
161+ return this . workerExecutor. processIsolation { spec ->
162+ spec. forkOptions { fork ->
163+ fork. executable = javaLauncher. executablePath
163164 }
164- } else {
165- return this . workerExecutor. noIsolation()
166165 }
167166 }
168167}
Original file line number Diff line number Diff line change @@ -40,12 +40,17 @@ abstract class MuzzleTask : DefaultTask() {
4040 val javaLauncher = javaToolchainService.launcherFor {
4141 languageVersion.set(JavaLanguageVersion .of(muzzleDirective.javaVersion!! ))
4242 }.get()
43+ // Note process isolation leaks gradle dependencies to the child process
44+ // and may need additional code on muzzle plugin to filter those out
45+ // See https://github.com/gradle/gradle/issues/33987
4346 workerExecutor.processIsolation {
4447 forkOptions {
4548 executable(javaLauncher.executablePath)
4649 }
4750 }
4851 } else {
52+ // noIsolation worker is OK for muzzle tasks as their checks will inspect classes outline
53+ // and should not be impacted by the actual running JDK.
4954 workerExecutor.noIsolation()
5055 }
5156 workQueue.submit(MuzzleAction ::class .java) {
You can’t perform that action at this time.
0 commit comments