// this project will run in isolation under the agent's classloader buildscript { dependencies { classpath "net.bytebuddy:byte-buddy-gradle-plugin:${versions.bytebuddy}" } } plugins { id "com.github.johnrengelman.shadow" } apply from: "${rootDir}/gradle/java.gradle" Project instr_project = project subprojects { subProj -> apply plugin: "net.bytebuddy.byte-buddy" apply plugin: 'muzzle' subProj.byteBuddy { transformation { // Applying NoOp optimizes build by applying bytebuddy plugin to only compileJava task tasks = ['compileJava', 'compileScala'] plugin = 'datadog.trace.agent.tooling.muzzle.MuzzleGradlePlugin$NoOp' } } subProj.afterEvaluate { subProj.byteBuddy { transformation { tasks = ['compileJava', 'compileScala'] plugin = 'datadog.trace.agent.tooling.muzzle.MuzzleGradlePlugin' classPath = project(':dd-java-agent:agent-tooling').configurations.instrumentationMuzzle + subProj.configurations.compile + subProj.sourceSets.main.output } } } instr_project.dependencies { compile(project(subProj.getPath())) } } excludedClassesConverage += ['datadog.trace.instrumentation.*'] dependencies { compile(project(':dd-java-agent:agent-tooling')) { exclude module: ':dd-java-agent:agent-bootstrap' } } configurations { // exclude bootstrap dependencies from shadowJar runtime.exclude module: deps.opentracing runtime.exclude module: deps.slf4j runtime.exclude group: 'org.slf4j' runtime.exclude group: 'io.opentracing' } shadowJar { dependencies { exclude(project(':dd-java-agent:agent-bootstrap')) exclude(project(':dd-trace-api')) } } jar { classifier = 'unbundled' }