-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Unsupported method: TaskOperationDescriptor.getDependencies() with Gradle 6.8 #15824
Comments
And the same for |
@Vampire Can you describe what you are trying to achieve? And which Gradle versions are in play. |
Only 6.8 and no specific goal. To reproduce (sorry for the bad report before) just have this import org.gradle.kotlin.dsl.support.serviceOf
import org.gradle.tooling.events.FinishEvent
import org.gradle.tooling.events.OperationCompletionListener
import org.gradle.tooling.events.task.TaskOperationDescriptor
abstract class FooService : BuildService<BuildServiceParameters.None>, OperationCompletionListener {
override fun onFinish(event: FinishEvent?) {
val descriptor = event?.descriptor as? TaskOperationDescriptor
println("event?.descriptor?.dependencies = ${descriptor?.dependencies}")
println("event?.descriptor?.originPlugin = ${descriptor?.originPlugin}")
}
}
serviceOf<BuildEventsListenerRegistry>()
.onTaskCompletion(
serviceOf<BuildServiceRegistry>()
.registerIfAbsent("foo", FooService::class) { }
) and then execute the |
This also happens in 6.7. It looks like this is something unfinished. The TODO here is saying a lot: Line 226 in c20e0c8
The event types are shared with TAPI, but the conversion is done in a different way and some information isn't available/lost. @eskatos I'm guessing this is something low priority/only added to as we need something for CC. |
I'd like to add my similar use case. Didn't find a better workaround than resolving them in Maybe you can point on a correct way to find all predecessors of a task. |
Issue still happens to this day with 7.5.1 gradle version. I'm assuming it's not expected to work, right? Is there a known alternative? |
The docs of
TaskOperationDescriptor.getDependencies()
say that this will happen if a Gradle version < 5.1 is targeted as there the capability was added.But it happens with Gradle 6.8.
I didn't try this before, but I assume this used to work, thus reporting it as regression.
The text was updated successfully, but these errors were encountered: