-
Notifications
You must be signed in to change notification settings - Fork 415
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
use a Gradle logger via LoggerAdapter #2875
Conversation
The tests are failing with
I spent a few hours trying to understand the reason, as I thought that we were using different versions of Fortunately, this is not the case. It was difficult to understand which versions were used, but TLDR is the following: The Gradle plugin is published with the version The real reason, of course, is the proxy reflection magic in the current Gradle plugin. It tries to match the same method by the name and the parameter types. However, the equals check for parameter types returns null because So it looks like we can only add the logger once we migrate to workers in #2740, it's not possible to do without it :( Even if we match the methods, it'll fail during invocation with Sorry for asking you to extract it and wasting your time - I thought it would simplify review and we'll be able to benefit from it earlier, didn't expect we'd get this problem :( If you didn't delete this code from #2740 (doesn't look like that), I think we can close the PR. If you did, we can merge it after merging #2740 |
Ah thanks for looking into it. I just assumed the tests were flaky. I'm not sure I follow your explanation though... don't the integration tests patch KxS and Coroutines to use the Anyway, there's no problem with closing this PR and combining it with #2740 - although merging this PR separately would make #2740 smaller? |
It uses the Maven runner, so it doesn't have the reflection magic
They do. The problem is not with the plugin version or the core version as I feared initially. The integration tests use correct artifacts and as expected. The problem is caused by this line. As far as I understand, it tries to add a bridge for "the same" method between classes loaded in different classloaders. So you call To find the It doesn't happen with classes from java core (String, BiFunction) for some reason, presumably because they are loaded once (see Hopefully I didn't just repeat myself and it added some clarity 😅
It would, but if we merge this now I think the Gradle plugin as a whole will be broken, not just the tests |
# Conflicts: # runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/tasks/AbstractDokkaTask.kt
Definitely not! It's a lot clearer now. Thanks very much for explaining. I've pushed a change with some old code I had for duck-typing, maybe that fixes it. If not, I'll close this PR and it'll be picked up in #2740. |
Adapt a Gradle Logger to a [DokkaLogger], to be used by Dokka when generating documentation.
Using the Gradle logger means that the log-level will be controlled by the standard Gradle command line options, e.g.
--info
.