Skip to content

Commit 242dfbc

Browse files
committed
Fix build
1 parent c9a3059 commit 242dfbc

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

build.gradle.kts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import com.google.protobuf.gradle.*
22
import de.undercouch.gradle.tasks.download.Download
3-
import nebula.plugin.release.git.opinion.Strategies
3+
import nebula.plugin.release.git.base.TagStrategy
4+
import nebula.plugin.release.git.semver.NearestVersionLocator
45
import java.time.Duration
56

67
plugins {
@@ -14,7 +15,6 @@ plugins {
1415
}
1516

1617
release {
17-
defaultVersionStrategy = Strategies.getSNAPSHOT()
1818
}
1919

2020
tasks {
@@ -25,6 +25,13 @@ tasks {
2525

2626
description = "Java Bindings for the OpenTelemetry Protocol (OTLP)"
2727

28+
// Project version is set from -Prelease.version or inferred from the latest tag
29+
if (properties.contains("release.version")) {
30+
version = properties.get("release.version") as String
31+
} else {
32+
version = NearestVersionLocator(TagStrategy()).locate(release.grgit).any.toString()
33+
}
34+
2835
val grpcVersion = "1.56.1"
2936
val protobufVersion = "3.23.4"
3037

@@ -64,10 +71,7 @@ protobuf {
6471
}
6572
}
6673

67-
// Extract semnver portion of version string by stripping off portion after "-"
68-
// E.g. "0.20.0-SNAPSHOT" => "0.20.0", or "0.20.0-dev.3.uncommitted+update.dependencies.ecd2254" => "0.20.0"
69-
val protoVersion = version.toString().substring(0, version.toString().indexOf("-"))
70-
74+
val protoVersion = version
7175
val protoArchive = file("$buildDir/archives/opentelemetry-proto-$protoVersion.zip")
7276

7377
tasks {

0 commit comments

Comments
 (0)