Skip to content

Commit 68db193

Browse files
committed
chore(build): Skip empty parent instrumentation projects
1 parent 1de42c8 commit 68db193

File tree

24 files changed

+18
-1445
lines changed

24 files changed

+18
-1445
lines changed

build.gradle

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ plugins {
2626
id 'com.gradleup.shadow' version '8.3.6' apply false
2727
id 'me.champeau.jmh' version '0.7.0' apply false
2828
id 'org.gradle.playframework' version '0.13' apply false
29-
id 'info.solidsoft.pitest' version '1.9.11' apply false
29+
id 'info.solidsoft.pitest' version '1.9.11' apply false
3030
}
3131

3232
description = 'dd-trace-java'
@@ -126,9 +126,12 @@ tasks.register('writeMuzzleTasksToFile') {
126126
def muzzleFile = file("${buildDir}/muzzleTasks")
127127
assert muzzleFile.parentFile.mkdirs() || muzzleFile.parentFile.directory
128128

129-
muzzleFile.text = subprojects.findAll { subproject -> subproject.plugins.hasPlugin('muzzle') }
130-
.collect { it.path + ":muzzle" }
131-
.join('\n')
129+
muzzleFile.text = subprojects
130+
.findAll { subproject ->
131+
subproject.plugins.hasPlugin('java') && subproject.plugins.hasPlugin('muzzle')
132+
}
133+
.collect { it.path + ":muzzle" }
134+
.join('\n')
132135
}
133136
}
134137

dd-java-agent/instrumentation/akka-http/build.gradle

Lines changed: 0 additions & 1 deletion
This file was deleted.

dd-java-agent/instrumentation/akka-http/gradle.lockfile

Lines changed: 0 additions & 157 deletions
This file was deleted.

dd-java-agent/instrumentation/apache-httpclient/build.gradle

Lines changed: 0 additions & 1 deletion
This file was deleted.

dd-java-agent/instrumentation/apache-httpcore/build.gradle

Lines changed: 0 additions & 1 deletion
This file was deleted.

dd-java-agent/instrumentation/armeria/build.gradle

Lines changed: 0 additions & 1 deletion
This file was deleted.

dd-java-agent/instrumentation/build.gradle

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,17 @@ subprojects { Project subProj ->
5353
subProj.tasks.withType(Javadoc).configureEach { enabled = false }
5454

5555
subProj.afterEvaluate {
56+
if (!plugins.hasPlugin("java")) {
57+
return
58+
}
5659
String jdkCompile = null
5760
if (project.hasProperty('minJavaVersionForTests') && project.getProperty('minJavaVersionForTests') != JavaVersion.VERSION_1_8) {
5861
def version = JavaVersion.toVersion(project.getProperty('minJavaVersionForTests'))
5962
def name = "java$version.majorVersion"
6063
jdkCompile = "main_${name}Implementation"
6164
}
6265
configurations.muzzleBootstrap {
63-
exclude group: 'org.snakeyaml', module : 'snakeyaml-engine' // we vendor this in the agent jar
66+
exclude group: 'org.snakeyaml', module: 'snakeyaml-engine' // we vendor this in the agent jar
6467
}
6568
dependencies {
6669
// Apply common dependencies for instrumentation.
@@ -122,10 +125,12 @@ subprojects { Project subProj ->
122125
}
123126

124127
def path = subProj.getPath()
125-
// don't include the redis RequestImpl stub
126-
if (!path.equals(':dd-java-agent:instrumentation:vertx-redis-client-3.9:stubs')) {
127-
parent_project.dependencies {
128-
implementation project(path)
128+
subProj.plugins.withId("java") {
129+
if (!path.equals(':dd-java-agent:instrumentation:vertx-redis-client-3.9:stubs')) {
130+
// don't include the redis RequestImpl stub
131+
parent_project.dependencies {
132+
implementation project(path)
133+
}
129134
}
130135
}
131136
}
@@ -137,7 +142,7 @@ dependencies {
137142
implementation project(':dd-java-agent:agent-builder')
138143
}
139144

140-
if (project.gradle.startParameter.taskNames.any {it.endsWith("generateMuzzleReport")}) {
145+
if (project.gradle.startParameter.taskNames.any { it.endsWith("generateMuzzleReport") }) {
141146
apply plugin: 'muzzle'
142147
task("muzzleInstrumentationReport") {
143148
dependsOn(project.getAllTasks(true).values().flatten().findAll { it.name.endsWith("generateMuzzleReport") })

dd-java-agent/instrumentation/couchbase/build.gradle

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)