Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
jack-berg committed Jul 21, 2023
1 parent c9a3059 commit 242dfbc
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import com.google.protobuf.gradle.*
import de.undercouch.gradle.tasks.download.Download
import nebula.plugin.release.git.opinion.Strategies
import nebula.plugin.release.git.base.TagStrategy
import nebula.plugin.release.git.semver.NearestVersionLocator
import java.time.Duration

plugins {
Expand All @@ -14,7 +15,6 @@ plugins {
}

release {
defaultVersionStrategy = Strategies.getSNAPSHOT()
}

tasks {
Expand All @@ -25,6 +25,13 @@ tasks {

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

// Project version is set from -Prelease.version or inferred from the latest tag
if (properties.contains("release.version")) {
version = properties.get("release.version") as String
} else {
version = NearestVersionLocator(TagStrategy()).locate(release.grgit).any.toString()
}

val grpcVersion = "1.56.1"
val protobufVersion = "3.23.4"

Expand Down Expand Up @@ -64,10 +71,7 @@ protobuf {
}
}

// Extract semnver portion of version string by stripping off portion after "-"
// E.g. "0.20.0-SNAPSHOT" => "0.20.0", or "0.20.0-dev.3.uncommitted+update.dependencies.ecd2254" => "0.20.0"
val protoVersion = version.toString().substring(0, version.toString().indexOf("-"))

val protoVersion = version
val protoArchive = file("$buildDir/archives/opentelemetry-proto-$protoVersion.zip")

tasks {
Expand Down

0 comments on commit 242dfbc

Please sign in to comment.