Closed jayasuryat closed 1 year ago
It might have been a mistake from the Groovy rewrite to Kotlin. You might look at the original Groovy code to confirm. PRs are always welcome
Looks like this also existed in the groovy
version:
https://github.com/ben-manes/gradle-versions-plugin/blob/b53e44f1459e7950706e77007b916ee522684baf/src/main/groovy/com/github/benmanes/gradle/versions/reporter/HtmlReporter.groovy#L169-L172
PlainTextReporter
seems to be correct in the both versionsPlainTextReporter
- Kotlin
https://github.com/ben-manes/gradle-versions-plugin/blob/bb9be6edbee2d2e7427b96685b2ae0a7f1d8fa76/gradle-versions-plugin/src/main/kotlin/com/github/benmanes/gradle/versions/reporter/PlainTextReporter.kt#L70-L71
PlainTextReporter
- Groovy
https://github.com/ben-manes/gradle-versions-plugin/blob/b53e44f1459e7950706e77007b916ee522684baf/src/main/groovy/com/github/benmanes/gradle/versions/reporter/PlainTextReporter.groovy#L127-L128
Thanks for the quick response @ben-manes, I'd love to contribute the fix for this. Let me know if my understanding of the existence of the issue sounds right to you.
Yep, it looks like it was maybe changed in #508 where that method used to use the "available version" but had a refactoring mistake. In the original contribution it called item.getLatest()
.
@ben-manes I've created a PR with the change, the said change only changes the dependency.version
to dependency.latest
.
I didn't find any tests that needed to be updated, altho some tests are failing only in the DifferentGradleVersionsSpec
class, (rest all test classes are passing fine). From what I could understand these were due to Java version mismatch.
Let me know if there is anything else needed to be updated.
The tests pass on CI, so I think you're fine too.
I tried it locally by bumping the version, running publishToMavenLocal
, and checking the report generated by examples/groovy
(which sources the latest from mavenLocal if available). It looked perfect to me.
Glad to know that everything is working as expected.
This was super quick, thanks @ben-manes.
Hi @ben-manes, Thanks for this awesome plugin.
I recently encountered this issue, where while reporting exceeded versions, the plugin correctly reports the
Latest version
in theconsole output
, but in theHTML
report theCurrent version
is being reported as theLatest version
.I did some quick digging in the source code, and found this : https://github.com/ben-manes/gradle-versions-plugin/blob/bb9be6edbee2d2e7427b96685b2ae0a7f1d8fa76/gradle-versions-plugin/src/main/kotlin/com/github/benmanes/gradle/versions/reporter/HtmlReporter.kt#L335-L344
Looks like the same value
dependency.version
is being printed for bothCurrent version
&Latest version
(instead ofdependency.latest
(I'm assuming)).