1
1
import com.google.protobuf.gradle.*
2
2
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
4
5
import java.time.Duration
5
6
6
7
plugins {
@@ -14,7 +15,6 @@ plugins {
14
15
}
15
16
16
17
release {
17
- defaultVersionStrategy = Strategies .getSNAPSHOT()
18
18
}
19
19
20
20
tasks {
@@ -25,6 +25,13 @@ tasks {
25
25
26
26
description = " Java Bindings for the OpenTelemetry Protocol (OTLP)"
27
27
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
+
28
35
val grpcVersion = " 1.56.1"
29
36
val protobufVersion = " 3.23.4"
30
37
@@ -64,10 +71,7 @@ protobuf {
64
71
}
65
72
}
66
73
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
71
75
val protoArchive = file(" $buildDir /archives/opentelemetry-proto-$protoVersion .zip" )
72
76
73
77
tasks {
0 commit comments