jmongard / Git.SemVersioning.Gradle

Gradle plugin for automatically versioning a project using semantic versioning and conventional commits with change log support based on git commit messages.
https://plugins.gradle.org/plugin/com.github.jmongard.git-semver-plugin
Apache License 2.0
38 stars 4 forks source link

printChangelog doesn't print out emojis on terminal #45

Closed tacascer closed 7 months ago

tacascer commented 7 months ago

We're currently using the printChangelog task to generate a Github release changelog.

We're using Jenkins to capture the stdout of the sh command and forwarding it to another step that creates the github release.

For whatever reason the emojis don't render when outputted to the shell, so they end up as "?" that get captured by the pipeline and forwarded to the github release step.

Then the changelog notes will have stuff like "Build ? & CI ??".

We've overridden the semver changelog to eliminate the emojis in the header strings. We figure that we'd need to do this for every project that we have and it could get tedious.

Is it possible to add a changelog template that strips away the emojis?

jmongard commented 7 months ago

Hi, If you want the emojis and you are getting "?" in the terminal it is probably an encoding issue. I got the same issue when running using windows powershell. It should be possible to change the terminal encoding or you can output the change log to a UTF-8 encoded file using: ./gradlew printChangeLog --file changelog.md

If you don't want the emoji at all you can change all the default texts:

semver {
    changeLogTexts {
        headerTexts["fix"] = "### Bug Fixes"
        headerTexts["feat"] = "### New Features"
        headerTexts["test"] = "### Tests "
        headerTexts["docs"] = "### Documentation"
        headerTexts["deps"] = "### Dependency Updates"
        headerTexts["build"] = "### Build & CI"
        headerTexts["ci"] = "### Build & CI"
        headerTexts["chore"] = "### Chores"
        headerTexts["perf"] = "### Performance Enhancements"
        headerTexts["refactor"] = "### Refactorings"
        breakingChange = "### Breaking Changes"
        otherChange = "### Other Changes"
    }
}
tacascer commented 7 months ago

I'll experiment with storing the info in a .md and loading it from there.

In the meanwhile do you think it wise to add a default changelog template that doesn't have the emojis?

jmongard commented 7 months ago

Yes, it could be a good Idea to have an easy way to configure the change log not to include emojis

tacascer commented 7 months ago

Closing due to #46 having implemented a plain text changelog