Skip to content

Simple way to specify the version prefix for each version by name #278

@jodiew

Description

@jodiew

Is your feature request related to a problem? Please describe.
Some of the comparison links in the CHANGELOG.md file in this repository (and others) don't work because the plugin has a default tag prefix of "v", but not all the tags have a "v" prefix.

Describe the solution you'd like
A property in the changelog section of build.gradle.kts that lets you specify a function that takes the version name and returns the prefix to use, similar to the sectionUrlBuilder. Something like

changelog {
    groups.empty()
    repositoryUrl = providers.gradleProperty("pluginRepositoryUrl")
    versionPrefixBuilder = VersionPrefixBuilder { version -> when (version) {
        "1.0.0" -> "v"
        else -> ""
    }   }
}

Describe alternatives you've considered

  • it works to use sectionUrlBuilder, by re-creating the default behaviour and just adding new values for the prefixes, this would just be a bit more clear
  • you could re-release with renamed tags, but that seems like bad practice
  • versionPrefix = "" to set a different default prefix doesn't work as the tags don't all have the same prefix

Additional context
I made a related PR in JetBrains/intellij-platform-plugin-template#557 that fixes the CHANGELOG.md in that repository with the sectionUrlBuilder. I would also be interested in doing the PR for this if it's decided to be helpful and appropriate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions