Any quick fix to the Gradle 8.8 removal of <https:...
# plugin-development
d
Any quick fix to the Gradle 8.8 removal of https://github.com/gradle/gradle/commit/f24f1d0c8beed516a74244fd665dc89b506b2d3d
org/gradle/internal/operations/BuildOperationExecutor#start(BuildOperationDescriptor.Builder descriptor)
I note the comment above talks of using runner API but the
#getRunner()
was also removed around the same time.
v
I guess that is an XY-problem. Mind telling us what your actual use-case is for using that internal API? I don't even know what it does.
d
Hi there thanks for reply, it is part of integration testing suite. So with Gradle plugin development you want to build you plugin and test with a wide range of Gradle versions, then run the integration tests against each. Use in question is https://github.com/dlmiles/gradle-xjc-plugin/blob/master/src/test/kotlin/org/unbrokendome/gradle/plugins/xjc/testutil/GradleTestUtils.kt#L23 but also the GHA actions are performing a similar thing externally. These failures are due to the API not being present https://github.com/dlmiles/gradle-xjc-plugin/actions/runs/10667193730
t
The question then is: why is this using internal APIs to begin with? (back to "what your actual use-case is") And have you looked at whether you could migrate to public APIs instead?
d
So then what is the public API for this ? FWIW to me my original question that started this thread, assume if a public API is known that a responder might be able to provide a pointer towards it.
v
As I have not idea what that Gradle-internal API is doing, I am not able to suggest a public alternative, which is why I asked what your use-case is. As you now pointed to a
Task.execute
extension function, I guess it is a try to replace the long-gone
Task.execute
method that was there and was never intended to be public API. Actually, searching with https://github.com/search?q=repo%3Adlmiles/gradle-xjc-plugin%20execute&amp;type=code I do not even see that method be used anywhere. The third link you shared seems to properly use the tooling api to run against different Gradle versions. So maybe that extension function is just a left-over and not actually used anymore?
Yeah, commit 3872262d324f7ab455a3284d9d79d67f318726b8 supports my thesis. That upgraded Gradle 4.7 to 6.6.1 while also rewriting the whole project from Groovy to Kotlin. The
execute()
method was remove in 5.0. But even in that commit from a cursory look I do not see a single spot using that function. So it seems to me like it was a needless error right from the start to add that extension function, especially if it was really added without reason. Also the IDE does not find any usages.
d
Thanks for this, I shall confirm the problem method/class-file is being used, deleting it from the project sounds like a good resolution to me. While I maybe keeping the plugin working/viable, I would not know the history of Gradle internal API changes over time to be able to spot this, so Thanks for that pointer, I try some CI tomorrow.
v
As even in the old code before that port I did see no usage of
execute
I don't think this is really directly related to Gradle removing the
execute
method. No idea why it was tried to replicate it. And even if it was used before, that was already a big mistake and replicating the method using internal API would only have been a quite bigger one. 🤷‍♂️ 🙂