Skip to content

Commit

Permalink
Include nextPlannedVersion in all snapshot versions
Browse files Browse the repository at this point in the history
  • Loading branch information
lukellmann committed Aug 15, 2024
1 parent e9c4674 commit dd73718
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,10 @@ mapping of the Voice API on Kotlin/JVM

Replace `{version}` with the latest version number on maven central.

For Snapshots replace `{version}` with `{branch}-SNAPSHOT`
For Snapshots replace `{version}` with `{nextPlannedVersion}-SNAPSHOT` or `{nextPlannedVersion}-{branch}-SNAPSHOT` for a
branch other than `main`. See `nextPlannedVersion` in [`gradle.properties`](gradle.properties).

e.g: `feature-amazing-thing-SNAPSHOT` for the branch `feature/amazing-thing`

For Snapshots for the branch `main` replace `{version}` with `{nextPlannedVersion}-SNAPSHOT` (see `nextPlannedVersion`
in [`gradle.properties`](gradle.properties))
e.g.: `0.15.0-SNAPSHOT` for `main` or `0.15.0-feature-amazing-thing-SNAPSHOT` for the branch `feature/amazing-thing`

[![Download](https://img.shields.io/maven-central/v/dev.kord/kord-core.svg?label=Maven%20Central&style=for-the-badge)](https://central.sonatype.com/artifact/dev.kord/kord-core)

Expand Down
9 changes: 5 additions & 4 deletions buildSrc/src/main/kotlin/Projects.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ private val Project.tag

val Project.libraryVersion
get() = tag ?: run {
val snapshotPrefix = when (val branch = git("branch", "--show-current")) {
"main" -> providers.gradleProperty("nextPlannedVersion").get()
else -> branch.replace('/', '-')
val branch = git("branch", "--show-current")
val nextPlannedVersion = providers.gradleProperty("nextPlannedVersion").get()
when (branch) {
"main" -> "$nextPlannedVersion-SNAPSHOT"
else -> "$nextPlannedVersion-${branch.replace('/', '-')}-SNAPSHOT"
}
"$snapshotPrefix-SNAPSHOT"
}

val Project.commitHash get() = git("rev-parse", "--verify", "HEAD")
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# the version that is planned to be released next, snapshot versions for the 'main' branch are based on this
# the version that is planned to be released next, snapshot versions start with this version
nextPlannedVersion=0.15.0

#dokka will run out of memory with the default meta space
Expand Down

0 comments on commit dd73718

Please sign in to comment.