Skip to content

Commit

Permalink
tie version number to the git tag
Browse files Browse the repository at this point in the history
  • Loading branch information
MustafaHaddara committed Jan 14, 2025
1 parent 5599b39 commit ccca974
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 6 deletions.
10 changes: 10 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ plugins {
alias(libs.plugins.publish.plugin)
}

allprojects {
val tag: String? = System.getenv("CIRCLE_TAG")
version = if (tag != null && tag.startsWith("v")) {
tag.slice(1 until tag.length)
} else {
"0.0.0-DEVELOPMENT"
}
}
println("outer: " + project.version)

nexusPublishing {
repositories {
sonatype {
Expand Down
4 changes: 2 additions & 2 deletions compose/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ android {
minCompileSdk = 21
}

buildConfigField("String", "HONEYCOMB_COMPOSE_DISTRO_VERSION", "\"0.0.1-experimental2\"")
buildConfigField("String", "HONEYCOMB_DISTRO_VERSION", "\"${project.version}\"")

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles("consumer-rules.pro")
Expand Down Expand Up @@ -100,7 +100,7 @@ publishing {
create<MavenPublication>("release") {
groupId = "io.honeycomb.android"
artifactId = "honeycomb-opentelemetry-android-compose"
version = "0.0.1-experimental2"
version = project.version.toString()

afterEvaluate {
from(components["release"])
Expand Down
4 changes: 2 additions & 2 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ android {
minCompileSdk = 21
}

buildConfigField("String", "HONEYCOMB_DISTRO_VERSION", "\"0.0.1-experimental2\"")
buildConfigField("String", "HONEYCOMB_DISTRO_VERSION", "\"${project.version}\"")

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles("consumer-rules.pro")
Expand Down Expand Up @@ -101,7 +101,7 @@ publishing {
create<MavenPublication>("release") {
groupId = "io.honeycomb.android"
artifactId = "honeycomb-opentelemetry-android"
version = "0.0.1-experimental2"
version = project.version.toString()

afterEvaluate {
from(components["release"])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class HoneycombOptionsInstrumentedTest {
assertEquals(
mapOf(
"service.name" to "unknown_service",
"honeycomb.distro.version" to "0.0.1-experimental2",
"honeycomb.distro.version" to "0.0.0-DEVELOPMENT",
"honeycomb.distro.runtime_version" to Build.VERSION.RELEASE,
),
options.resourceAttributes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ class HoneycombOptionsUnitTest {
mapOf(
"service.name" to "service",
"resource" to "aaa",
"honeycomb.distro.version" to "0.0.1-experimental2",
"honeycomb.distro.version" to "0.0.0-DEVELOPMENT",
"honeycomb.distro.runtime_version" to "unknown",
),
options.resourceAttributes,
Expand Down

0 comments on commit ccca974

Please sign in to comment.