Skip to content

chore(build): Skip empty parent instrumentation projects #9106

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ plugins {
id 'com.gradleup.shadow' version '8.3.6' apply false
id 'me.champeau.jmh' version '0.7.0' apply false
id 'org.gradle.playframework' version '0.13' apply false
id 'info.solidsoft.pitest' version '1.9.11' apply false
id 'info.solidsoft.pitest' version '1.9.11' apply false
}

description = 'dd-trace-java'
Expand Down
1 change: 0 additions & 1 deletion dd-java-agent/instrumentation/akka-http/build.gradle

This file was deleted.

157 changes: 0 additions & 157 deletions dd-java-agent/instrumentation/akka-http/gradle.lockfile

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion dd-java-agent/instrumentation/armeria/build.gradle

This file was deleted.

17 changes: 11 additions & 6 deletions dd-java-agent/instrumentation/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,17 @@ subprojects { Project subProj ->
subProj.tasks.withType(Javadoc).configureEach { enabled = false }

subProj.afterEvaluate {
if (!plugins.hasPlugin("java")) {
return
}
Comment on lines 55 to +58
Copy link
Contributor Author

@bric3 bric3 Jul 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: this afterEvaluate post pones this configuration at the very end. It might be improved instead with something like with the muzzle plugin applied within.

subProj.plugins.withId("java") { }

However, it doesn't work well at the moment because instrumentation projects may use the muzzle extension before declaring they are using muzzle plugin and before they are applying the java plugin.

In proper Gradle projects project should always prefer the plugins {} block to apply plugins.

String jdkCompile = null
if (project.hasProperty('minJavaVersionForTests') && project.getProperty('minJavaVersionForTests') != JavaVersion.VERSION_1_8) {
def version = JavaVersion.toVersion(project.getProperty('minJavaVersionForTests'))
def name = "java$version.majorVersion"
jdkCompile = "main_${name}Implementation"
}
configurations.muzzleBootstrap {
exclude group: 'org.snakeyaml', module : 'snakeyaml-engine' // we vendor this in the agent jar
exclude group: 'org.snakeyaml', module: 'snakeyaml-engine' // we vendor this in the agent jar
}
dependencies {
// Apply common dependencies for instrumentation.
Expand Down Expand Up @@ -122,10 +125,12 @@ subprojects { Project subProj ->
}

def path = subProj.getPath()
// don't include the redis RequestImpl stub
if (!path.equals(':dd-java-agent:instrumentation:vertx-redis-client-3.9:stubs')) {
parent_project.dependencies {
implementation project(path)
subProj.plugins.withId("java") {
if (!path.equals(':dd-java-agent:instrumentation:vertx-redis-client-3.9:stubs')) {
// don't include the redis RequestImpl stub
parent_project.dependencies {
implementation project(path)
}
}
}
}
Expand All @@ -137,7 +142,7 @@ dependencies {
implementation project(':dd-java-agent:agent-builder')
}

if (project.gradle.startParameter.taskNames.any {it.endsWith("generateMuzzleReport")}) {
if (project.gradle.startParameter.taskNames.any { it.endsWith("generateMuzzleReport") }) {
apply plugin: 'muzzle'
task("muzzleInstrumentationReport") {
dependsOn(project.getAllTasks(true).values().flatten().findAll { it.name.endsWith("generateMuzzleReport") })
Expand Down
1 change: 0 additions & 1 deletion dd-java-agent/instrumentation/couchbase/build.gradle

This file was deleted.

Loading