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

Can't get commit hash in version string #53

Closed edzaffirm closed 7 months ago

edzaffirm commented 7 months ago

I'm using version 0.12.2 of the plugin.

When I print semver.semVersion.toString() in my build.gradle.kts file, the result doesn't include the commit hash, even though ./gradlew printSemVersion does.

When I try to call semver.semVersion.toInfoVersionString, my IDE thinks that the toInfoVersionString method doesn't exist.

These are the settings I've applied:

semver {
    releaseTagNameFormat = "v%s"
    createReleaseCommit = false
}

Any help would be appreciated. Thanks for the great work on the plugin!

jmongard commented 7 months ago

While updating the plugin to work with Gradle's configuration cache, I divided the original SemVersion class into three parts. This was done to avoid triggering Gradle's configuration change detection if the version number remained the same.

Unfortunately, I mistakenly moved the implementation containing the SHA property and toInfoVersionString method to a new property. To fix this, I've reverted to the original property name in version 0.12.3.

Thanks for using the Plugin :-)