-
Notifications
You must be signed in to change notification settings - Fork 889
/
Copy pathinstrumentation.gradle
58 lines (50 loc) · 2.13 KB
/
instrumentation.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// common gradle file for instrumentation
apply plugin: 'io.opentelemetry.instrumentation.auto-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.javaagent.tooling.muzzle.MuzzleGradlePlugin$NoOp'
}
}
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.javaagent.tooling.muzzle.MuzzleGradlePlugin'
classPath = project(':javaagent-tooling').configurations.instrumentationMuzzle + configurations.runtimeClasspath + sourceSets.main.output
}
}
dependencies {
implementation project(':instrumentation-api')
implementation project(':auto-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')
}
}