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

51 lines
1.7 KiB
Groovy

// common gradle file for instrumentation
apply plugin: 'net.bytebuddy.byte-buddy'
apply plugin: 'muzzle'
byteBuddy {
transformation {
// Applying NoOp optimizes build by applying bytebuddy plugin to only compileJava task
tasks = ['compileJava', 'compileScala', 'compileKotlin']
plugin = 'io.opentelemetry.auto.tooling.muzzle.MuzzleGradlePlugin$NoOp'
}
}
apply from: "$rootDir/gradle/java.gradle"
tasks.withType(Test) {
forkEvery = 1
}
afterEvaluate {
byteBuddy {
transformation {
tasks = ['compileJava', 'compileScala', 'compileKotlin']
plugin = 'io.opentelemetry.auto.tooling.muzzle.MuzzleGradlePlugin'
classPath = project(':auto-tooling').configurations.instrumentationMuzzle + configurations.compile + sourceSets.main.output
}
}
dependencies {
// Apply common dependencies for instrumentation.
compile(project(':auto-tooling')) {
// OpenTelemetry SDK is not needed for compilation, and :opentelemetry-sdk-shaded-for-testing
// is brought in for tests by project(:testing) below
exclude group: 'io.opentelemetry', module: 'opentelemetry-sdk'
}
compile deps.bytebuddy
annotationProcessor deps.autoservice
implementation deps.autoservice
// Include instrumentations instrumenting core JDK classes tp ensure interoperability with other instrumentation
testCompile project(':instrumentation:java-concurrent')
// FIXME: we should enable this, but currently this fails tests for google http client
//testCompile project(':instrumentation:http-url-connection')
testCompile project(':instrumentation:java-class-loader')
testCompile project(':testing')
testAnnotationProcessor deps.autoservice
testImplementation deps.autoservice
}
}