Only add integration dependencies when building agent shadowJar
@@ -31,12 +31,22 @@ dependencies {
testCompile deps.opentracingMock
}
-// add all subprojects under 'integrations' to the agent's dependencies
+
+// include dd-java-agent:integrations:* in shadowJar
Project java_agent_project = project
subprojects { subProj ->
- if (subProj.getPath().startsWith(java_agent_project.getPath() + ':integrations:')) {
+ if (subProj.getPath().startsWith("${java_agent_project.path}:integrations:")) {
+ java_agent_project.shadowJar.dependsOn "${subProj.path}:assemble"
+ }
+}
+gradle.taskGraph.whenReady {
+ if (gradle.taskGraph.hasTask("${java_agent_project.getPath()}:shadowJar")) {
+ subprojects { subProj ->
+ if (subProj.getPath().startsWith("${java_agent_project.path}:integrations:")) {
java_agent_project.dependencies {
- compile(project(subProj.getPath()))
+ compile(project(subProj.path))
+ }
+ }
}
}
}
