87 lines
2.7 KiB
Groovy
87 lines
2.7 KiB
Groovy
// common gradle file for instrumentation
|
|
|
|
apply plugin: 'net.bytebuddy.byte-buddy'
|
|
apply plugin: 'muzzle'
|
|
|
|
ext {
|
|
packageInAgentBundle = true
|
|
}
|
|
|
|
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'
|
|
}
|
|
}
|
|
|
|
// TODO(anuraaga): This needs to be added before adding publish.gradle, clean up this ordering restraint.
|
|
afterEvaluate {
|
|
archivesBaseName = 'opentelemetry-auto-' + archivesBaseName
|
|
}
|
|
|
|
apply from: "$rootDir/gradle/java.gradle"
|
|
if (project.ext.find("skipPublish") != true) {
|
|
apply from: "$rootDir/gradle/publish.gradle"
|
|
}
|
|
|
|
|
|
afterEvaluate {
|
|
byteBuddy {
|
|
transformation {
|
|
tasks = ['compileJava', 'compileScala', 'compileKotlin']
|
|
plugin = 'io.opentelemetry.auto.tooling.muzzle.MuzzleGradlePlugin'
|
|
classPath = project(':auto-tooling').configurations.instrumentationMuzzle + configurations.runtimeClasspath + sourceSets.main.output
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation(project(':auto-bootstrap'))
|
|
// Apply common dependencies for instrumentation.
|
|
implementation(project(':auto-tooling')) {
|
|
// OpenTelemetry SDK is not needed for compilation, and :opentelemetry-sdk-shaded-for-testing
|
|
// is brought in for tests by project(:testing-common) below
|
|
exclude group: 'io.opentelemetry', module: 'opentelemetry-sdk'
|
|
}
|
|
implementation deps.bytebuddy
|
|
annotationProcessor deps.autoservice
|
|
implementation deps.autoservice
|
|
implementation deps.slf4j
|
|
|
|
// Include instrumentations instrumenting core JDK classes tp ensure interoperability with other instrumentation
|
|
testImplementation project(':instrumentation:java-concurrent')
|
|
// FIXME: we should enable this, but currently this fails tests for google http client
|
|
//testImplementation project(':instrumentation:http-url-connection')
|
|
testImplementation project(':instrumentation:java-classloader')
|
|
|
|
testImplementation project(':testing-common')
|
|
testAnnotationProcessor deps.autoservice
|
|
testImplementation deps.autoservice
|
|
testImplementation project(':utils:test-utils')
|
|
}
|
|
}
|
|
|
|
tasks.withType(Test) {
|
|
if (it.name == 'test') {
|
|
useJUnit {
|
|
excludeCategories 'io.opentelemetry.auto.test.BytecodeTests'
|
|
}
|
|
} else {
|
|
useJUnit {
|
|
includeCategories 'io.opentelemetry.auto.test.BytecodeTests'
|
|
}
|
|
}
|
|
}
|
|
|
|
task integrationTest(type: Test) {
|
|
description = 'Runs instrumentation tests.'
|
|
group = 'verification'
|
|
shouldRunAfter test
|
|
|
|
useJUnit {
|
|
includeCategories 'io.opentelemetry.auto.test.BytecodeTests'
|
|
}
|
|
}
|
|
|
|
test.dependsOn integrationTest
|