opentelemetry-java-instrume.../instrumentation/grpc-1.5/grpc-1.5.gradle

67 lines
2.0 KiB
Groovy

apply from: "$rootDir/gradle/instrumentation.gradle"
apply plugin: 'org.unbroken-dome.test-sets'
apply plugin: 'com.google.protobuf'
apply plugin: 'idea'
muzzle {
pass {
group = "io.grpc"
module = "grpc-core"
versions = "[1.5.0,)"
}
}
buildscript {
repositories {
mavenLocal()
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.12'
}
}
def grpcVersion = '1.5.0'
protobuf {
protoc {
// Download compiler rather than using locally installed version:
artifact = 'com.google.protobuf:protoc:3.3.0'
}
plugins {
grpc { artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}" }
}
generateProtoTasks {
all()*.plugins { grpc {} }
}
}
testSets {
latestDepTest {
dirName = 'test'
}
}
dependencies {
compileOnly group: 'io.grpc', name: 'grpc-core', version: grpcVersion
testImplementation group: 'io.grpc', name: 'grpc-netty', version: grpcVersion
testImplementation group: 'io.grpc', name: 'grpc-protobuf', version: grpcVersion
testImplementation group: 'io.grpc', name: 'grpc-stub', version: grpcVersion
testImplementation group: 'javax.annotation', name: 'javax.annotation-api', version: '1.3.2'
testImplementation project(':utils:thread-utils')
latestDepTestImplementation sourceSets.test.output // include the protobuf generated classes
latestDepTestImplementation group: 'io.grpc', name: 'grpc-netty', version: '+'
latestDepTestImplementation group: 'io.grpc', name: 'grpc-protobuf', version: '+'
latestDepTestImplementation group: 'io.grpc', name: 'grpc-stub', version: '+'
// this instrumentation needs to be able to be able to reference the OpenTelemetry API's gRPC Context
// that is shaded in the bootstrap class loader (for sending telemetry to the agent),
// separately from the gRPC Context that is brought by gRPC
compileOnly project(path: ':opentelemetry-api-beta-shaded-for-instrumenting', configuration: 'shadow')
testImplementation project(path: ':opentelemetry-api-beta-shaded-for-instrumenting', configuration: 'shadow')
}