Skip to content

Commit

Permalink
Seperate proto version from nebula.release version (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
jack-berg authored Jul 26, 2023
1 parent 3a9bbbd commit a15ee36
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 8 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,28 @@ your desired version.
implementation("io.opentelemetry.proto:opentelemetry-proto:{{version}}")
```

## Project setup

The build downloads proto definitions
from [open-telemetry/opentelemetry-proto](https://github.com/open-telemetry/opentelemetry-proto) and
generates Java bindings:

```shell
./gradlew build
```

By default protos definitions will be downloaded for the latest published tag
of `opentelemetry-proto-java`. For example, if the latest version
is [0.20.0](https://github.com/open-telemetry/opentelemetry-proto-java/tree/v0.20.0), protos will be
downloaded from
the [v0.20.0 release](https://github.com/open-telemetry/opentelemetry-proto/releases/tag/v0.20.0).
This can be overridden for the build or other gradle tasks (e.g. `publishToMavenLocal`)
with `-Prelease.version`:

```shell
./gradlew build -Prelease.version=1.0.0
```

## Releasing

See [RELEASING.md](./RELEASING.md)
17 changes: 9 additions & 8 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ plugins {
}

release {
defaultVersionStrategy = nebula.plugin.release.git.opinion.Strategies.getSNAPSHOT()
}

tasks {
Expand All @@ -25,13 +26,6 @@ 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 @@ -71,7 +65,14 @@ protobuf {
}
}

val protoVersion = version
// Proto version is set from -Prelease.version or inferred from the latest tag
var protoVersion = if (properties.contains(
"release.version"
)) {
properties.get("release.version") as String
} else {
NearestVersionLocator(TagStrategy()).locate(release.grgit).any.toString()
}
val protoArchive = file("$buildDir/archives/opentelemetry-proto-$protoVersion.zip")

tasks {
Expand Down

0 comments on commit a15ee36

Please sign in to comment.