littlerobots / version-catalog-update-plugin

Gradle plugin for updating a project version catalog
Apache License 2.0
555 stars 22 forks source link

`build/dependencyUpdates/report.json` missing; passing `-DoutputFormatter=json` explicitly needed #100

Closed PawelLipski closed 1 year ago

PawelLipski commented 1 year ago

See this CI pipeline:

Generated report file build/dependencyUpdates/report.txt

> Task :versionCatalogUpdate FAILED

FAILURE: Build failed with an exception.

* What went wrong:
A problem was found with the configuration of task ':versionCatalogUpdate' (type 'VersionCatalogUpdateTask').
  - In plugin 'nl.littlerobots.version-catalog-update' type 'nl.littlerobots.vcu.plugin.VersionCatalogUpdateTask' property 'reportJson' specifies file '/root/git-machete-intellij-plugin/build/dependencyUpdates/report.json' which doesn't exist.

    Reason: An input file was expected to be present but it doesn't exist.

The only report file that gets generated by gradle-versions-filter plugin is build/dependencyUpdates/report.txt; report.json expected by VCU plugin is missing.

Note that it might be the problem with gradle-versions-filter plugin rather than with VCU plugin; CCing @janderssonse just in case.

PawelLipski commented 1 year ago

Versions:

[plugins]
versionCatalogUpdate = "nl.littlerobots.version-catalog-update:0.7.0"
versionsFilter = "se.ascp.gradle.gradle-versions-filter:0.1.16"

Fix PR: https://github.com/VirtusLab/git-machete-intellij-plugin/pull/1534

janderssonse commented 1 year ago

Thanks for the report, I plan to do an overhaul of the plugin in a not to distant future, and will have a look at this issue at the same time.

hvisser commented 1 year ago

One fix on the side of this plugin could be to use a separate dependencyUpdates task (not the default one), but then the issue is that you can no longer get away with configuring the versions task only once, so I'm not sure what the best solution would be.

hvisser commented 1 year ago

Circling back to this, VCU is already configuring the versions plugin to format all reports (https://github.com/littlerobots/version-catalog-update-plugin/blob/main/plugin/src/main/kotlin/nl/littlerobots/vcu/plugin/VersionCatalogUpdatePlugin.kt#L62), which I don't love either, but it can be reconfigured by anything after that. So I don't think I can do much about it here other than document that that report should be enabled.

PawelLipski commented 1 year ago

Ok! thx, lemme close the issue then