refreshVersions icon indicating copy to clipboard operation
refreshVersions copied to clipboard

Version comments are not aligned with original version in version catalog

Open Vampire opened this issue 2 years ago • 1 comments

When running refreshVersions with a version catalog, the version comments are not aligned with the original version like in other places. It looks like this:

build-kotlin = "1.7.10"
##        ⬆ = "1.7.20"
##        ⬆ = "1.7.21"
##        ⬆ = "1.7.22"
##        ⬆ = "1.8.0"
##        ⬆ = "1.8.10"

while it probably should look like this:

build-kotlin = "1.7.10"
##         ⬆ = "1.7.20"
##         ⬆ = "1.7.21"
##         ⬆ = "1.7.22"
##         ⬆ = "1.8.0"
##         ⬆ = "1.8.10"

Vampire avatar Feb 06 '23 12:02 Vampire

Here a work-around:

gradle.rootProject {
    tasks.configureEach {
        if (name == "refreshVersions") {
            doLast {
                file("gradle/libs.versions.toml").apply {
                    readText()
                        .replace("⬆ =", " ⬆ =")
                        .also { writeText(it) }
                }
            }
        }
    }
}

Vampire avatar Feb 08 '23 18:02 Vampire