You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to the documentation, the "stopAfter" task can be set from within the (Java)ExecFork task, i.e. the following should work (the "run" task simulates a task for example for integration tests that needs a server running) IMHO, right? (KTS)
However, it fails (tested with Gradle 7.1.1 and 7.4.2) with
* Exception is:
org.gradle.api.internal.tasks.DefaultTaskContainer$TaskCreationException: Could not create task ':startServer'.
[...]
Caused by: org.gradle.api.internal.AbstractMutationGuard$IllegalMutationException: DefaultTaskContainer#register(String, Class, Action) on task set cannot be executed in the current context.
at org.gradle.api.internal.AbstractMutationGuard.createIllegalStateException(AbstractMutationGuard.java:39)
at org.gradle.api.internal.AbstractMutationGuard.assertMutationAllowed(AbstractMutationGuard.java:27)
at org.gradle.api.internal.DefaultDomainObjectCollection.assertMutable(DefaultDomainObjectCollection.java:458)
at org.gradle.api.internal.tasks.DefaultTaskContainer.register(DefaultTaskContainer.java:374)
at com.github.psxpaul.task.AbstractExecFork.setStopAfter(AbstractExecFork.kt:98)
at Build_gradle$1$1.invoke(build.gradle.kts:14)
at Build_gradle$1$1.invoke(build.gradle.kts:1)
at Build_gradle$inlined$sam$i$org_gradle_api_Action$0.execute(TaskContainerExtensions.kt)
[...]
when the stop task gets registered in AbstractExecFork.kt. The same happens if
According to the documentation, the "stopAfter" task can be set from within the (Java)ExecFork task, i.e. the following should work (the "run" task simulates a task for example for integration tests that needs a server running) IMHO, right? (KTS)
However, it fails (tested with Gradle 7.1.1 and 7.4.2) with
when the stop task gets registered in
AbstractExecFork.kt
. The same happens ifis being replaced with
The only workaround I found so far was linking both tasks later on like this:
The text was updated successfully, but these errors were encountered: