73 lines
		
	
	
		
			1.9 KiB
		
	
	
	
		
			Groovy
		
	
	
	
			
		
		
	
	
			73 lines
		
	
	
		
			1.9 KiB
		
	
	
	
		
			Groovy
		
	
	
	
// this project will run in isolation under the agent's classloader
 | 
						|
buildscript {
 | 
						|
 | 
						|
  repositories {
 | 
						|
    mavenCentral()
 | 
						|
  }
 | 
						|
 | 
						|
  dependencies {
 | 
						|
    classpath "net.bytebuddy:byte-buddy-gradle-plugin:${versions.bytebuddy}"
 | 
						|
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}"
 | 
						|
  }
 | 
						|
}
 | 
						|
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', 'compileKotlin']
 | 
						|
      plugin = 'datadog.trace.agent.tooling.muzzle.MuzzleGradlePlugin$NoOp'
 | 
						|
    }
 | 
						|
  }
 | 
						|
 | 
						|
  subProj.afterEvaluate {
 | 
						|
    subProj.byteBuddy {
 | 
						|
      transformation {
 | 
						|
        tasks = ['compileJava', 'compileScala', 'compileKotlin']
 | 
						|
        plugin = 'datadog.trace.agent.tooling.muzzle.MuzzleGradlePlugin'
 | 
						|
        classPath = project(':dd-java-agent:agent-tooling').configurations.instrumentationMuzzle + subProj.configurations.compile + subProj.sourceSets.main.output
 | 
						|
      }
 | 
						|
    }
 | 
						|
 | 
						|
    // Make it so all instrumentation subproject tests can be run with a single command.
 | 
						|
    instr_project.tasks.test.dependsOn(subProj.tasks.test)
 | 
						|
  }
 | 
						|
 | 
						|
  instr_project.dependencies {
 | 
						|
    compile(project(subProj.getPath()))
 | 
						|
  }
 | 
						|
}
 | 
						|
 | 
						|
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'
 | 
						|
}
 |