Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seperate proto version from nebula.release version #12

Merged
merged 1 commit into from
Jul 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading