-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add configuration property to to select the gradle worker isolation strategy #205
Conversation
…solation strategy
Hi @cortinico , Here is my draft PR. Unfortunately I encountered an issue, that I am not sure how to resolve. Maybe you have an idea? What happened: Isolation strategy parallel works as expected. No Isolation strategy does not work with the error In the dependencies {
compileOnly(libs.ktfmt)
// Other dependencies...
testImplementation(libs.ktfmt)
} So for the tests, the ktfmt plugin is added as Ideally we could add the dependency after the configuration phase of the plugin to the classpath, when the isolation strategy is no-isolation. I tried to implement this with The only two other solutions I am able to come up with are:
|
For now: Maybe it ist worth to have a quick fix with just the process isolation, so that the plugin starts working again. And then we have more time to fix it and think about the solution. |
import com.ncorti.ktfmt.gradle.GradleWorkerIsolationStrategy | ||
|
||
ktfmt { | ||
gradleWorkerIsolationStrategy.set(GradleWorkerIsolationStrategy.NO_ISOLATION) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add an example for PROCESS_ISOLATION
also here?
Another option could be to ask users to add a
That's also another option. I'm not sure how that would work with the If you send another PR with the Process Isolation, we can merge it first, do a new release, and get back to this. |
That would be in my opinion the better solution. I did not think of that.
I will do that. Lets first fix it, then make it better :) |
I would close this PR for now. Then we still can think of a better solution if necessary :) |
🚀 Description
As discussed in this , add a new property to select the isolation strategy for the gradle worker.
📄 Motivation and Context
Fixes issue
The user is able to select between the default no-isolation strategy and a process-isolation strategy. I remove the classloader-isolation strategy since it does not seem wo work for larger projects, and I wanted to prevent future issues ;)
But it could be easily added, if desired.
🧪 How Has This Been Tested?
Added integration tests for the format and checkFormat task.
The property is set in the example project.
📦 Types of changes
✅ Checklist