Skip to content

Commit

Permalink
Also record the latest release version
Browse files Browse the repository at this point in the history
  • Loading branch information
Virtlink committed Jul 13, 2024
1 parent 9d82621 commit d3568c8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project are documented in this file, based on [Keep
## [Unreleased]


## [1.4.1] - 2024-07-14
- Also record the latest release version in the properties file.


## [1.4.0] - 2024-07-14
- Add `writeBuildProperties` task that writes build and version information to a properties file. Example usage:
```kotlin
Expand Down Expand Up @@ -53,7 +57,8 @@ All notable changes to this project are documented in this file, based on [Keep
- `Project.DEFAULT_VERSION` (`"unspecified"`) is assigned as version if no Git repository is found, instead of failing.


[Unreleased]: https://github.com/metaborg/gitonium/compare/release-1.4.0...HEAD
[Unreleased]: https://github.com/metaborg/gitonium/compare/release-1.4.1...HEAD
[1.4.1]: https://github.com/metaborg/gitonium/compare/release-1.4.0...release-1.4.1
[1.4.0]: https://github.com/metaborg/gitonium/compare/release-1.3.1...release-1.4.0
[1.3.1]: https://github.com/metaborg/gitonium/compare/release-1.3.0...release-1.3.1
[1.3.0]: https://github.com/metaborg/gitonium/compare/release-1.2.0...release-1.3.0
Expand Down
1 change: 1 addition & 0 deletions src/main/kotlin/mb/gitonium/GitoniumPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ class GitoniumPlugin : Plugin<Project> {
val p = Properties()
with(extension.versionInfo) {
versionString?.let { p["version"] = it }
releaseVersionString?.let { p["release-version"] = it }
commit?.let { p["commit"] = it }
p["build-time"] = buildDateTimeStr
}
Expand Down
10 changes: 8 additions & 2 deletions src/main/kotlin/mb/gitonium/GitoniumVersion.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@ data class GitoniumVersion(
val branch: String?,
/** The current commit ID; of `null` if it could not be determined. */
val commit: String?,
/** The version string; or `null` if it could not be determined. */
/** The current version string; or `null` if it could not be determined. */
val versionString: String?,
/** The version; or `null` if it could not be determined. */
/** The current version; or `null` if it could not be determined. */
val version: SemanticVersion?,
/** The most recent release version string; or `null` if it could not be determined. */
val releaseVersionString: String?,
/** The most recent release version; or `null` if it could not be determined. */
val releaseVersion: SemanticVersion?,
/** Whether the repository is dirty (i.e., has uncommitted changes). */
val isDirty: Boolean,
/** Whether the current commit has a release version tag. */
Expand Down Expand Up @@ -80,6 +84,8 @@ data class GitoniumVersion(
commit = commit,
versionString = version?.toString(),
version = version,
releaseVersionString = tagVersion?.toString(),
releaseVersion = tagVersion,
isDirty = repo.isDirty(),
isRelease = !isSnapshot
)
Expand Down

0 comments on commit d3568c8

Please sign in to comment.