Skip to content

Commit

Permalink
add auto versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
j5155 committed Dec 1, 2024
1 parent ee950be commit b865c35
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
13 changes: 12 additions & 1 deletion core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
import java.io.ByteArrayOutputStream

/* Gets the version name from the latest Git tag */
fun getVersionName(): String {
val stdout = ByteArrayOutputStream()
exec {
commandLine("git", "describe", "--tags", "--always")
standardOutput = stdout
}
return stdout.toString().trim()
}
plugins {
kotlin("jvm") version "2.0.20"
`maven-publish`
Expand Down Expand Up @@ -54,7 +65,7 @@ publishing {
create<MavenPublication>("maven") {
groupId = "page.j5155.roadrunner.expressway"
artifactId = "core"
version = "0.3.1"
version = getVersionName()
from(components["java"])
}
}
Expand Down
16 changes: 15 additions & 1 deletion ftc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
import java.io.ByteArrayOutputStream

/* Gets the version name from the latest Git tag */
fun getVersionName(): String {
val stdout = ByteArrayOutputStream()
exec {
commandLine("git", "describe", "--tags", "--always")
standardOutput = stdout
}
return stdout.toString().trim()
}

plugins {
id("com.android.library")
id("org.jetbrains.kotlin.android")
Expand Down Expand Up @@ -81,9 +93,11 @@ afterEvaluate {
create<MavenPublication>("maven") {
groupId = "page.j5155.roadrunner.expressway"
artifactId = "ftc"
version = "0.3.2"
version = getVersionName()
from(components["release"])
}
}
}
}


0 comments on commit b865c35

Please sign in to comment.