Fix NoSuchMethodError with Gradle 8.0 RC1 #2816
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
An attempt to fix #2796
The
dokkaHtmlMultiModule
started failing after the change in Gradle: gradle/gradle@7d9d6c4#diff-8d6d587bb7323c4c8105f5616986da4d67c575f8f7fb576071e58587e17a6878 where a new constructor appeared.AbstractTaskDependency
toDefaultTaskDependency
.The logic behind this: the message https://github.com/gradle/gradle/blob/ab07117466b9a28de41c1ec85a3fb6f4c61abbcd/subprojects/core/src/main/java/org/gradle/api/internal/AbstractTask.java#L102 that
AbstactTask
should be replaced withDefaultTask
. So I apply the same forAbstractTaskDependency
andDefaultTaskDependency
. even they are both are in*internal*
package. But we try to override methodpublic TaskDependencyInternal getTaskDependencies()
that returns an interface from the same*internal*
package.visitDependencies
fromTaskDependencyInternalWithAdditions
and delegate it to the default implementation of theDefaultTaskDependency
. It seems to contain the same. And for that, I inject tasks inside theDefaultTaskDependency
.DefaultTaskDependency
according to documentation (javadoc): in the constructor and with theadd
function. The way with the constructor is even recommended from a performance point of view.But it requires adding a dependency to Google common collections (full guava?) and I tried to avoid it.