58 lines
2.2 KiB
Groovy
58 lines
2.2 KiB
Groovy
// common gradle file for instrumentation
|
|
import io.opentelemetry.instrumentation.gradle.bytebuddy.ByteBuddyPluginConfigurator
|
|
|
|
apply plugin: 'io.opentelemetry.javaagent.instrumentation-instrumentation'
|
|
apply plugin: 'net.bytebuddy.byte-buddy'
|
|
apply plugin: 'muzzle'
|
|
|
|
ext {
|
|
packageInAgentBundle = true
|
|
mavenGroupId = 'io.opentelemetry.javaagent.instrumentation'
|
|
}
|
|
|
|
apply from: "$rootDir/gradle/java.gradle"
|
|
if (project.ext.find("skipPublish") != true) {
|
|
apply from: "$rootDir/gradle/publish.gradle"
|
|
}
|
|
|
|
apply from: "$rootDir/gradle/instrumentation-common.gradle"
|
|
|
|
if (projectDir.name == 'javaagent') {
|
|
archivesBaseName = projectDir.parentFile.name
|
|
}
|
|
|
|
afterEvaluate {
|
|
dependencies {
|
|
implementation project(':instrumentation-api')
|
|
implementation project(':javaagent-api')
|
|
// Apply common dependencies for instrumentation.
|
|
implementation(project(':javaagent-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')
|
|
|
|
testImplementation deps.testcontainers
|
|
}
|
|
|
|
def pluginName = 'io.opentelemetry.javaagent.tooling.muzzle.collector.MuzzleCodeGenerationPlugin'
|
|
new ByteBuddyPluginConfigurator(project, sourceSets.main, pluginName,
|
|
project(':javaagent-tooling').configurations.instrumentationMuzzle + configurations.runtimeClasspath
|
|
).configure()
|
|
}
|