Skip to content

Commit 36490a6

Browse files
authored
Fix small gradle mistakes (#9300)
* fix: 'metadataSources' is defined by 'ivy' but used within 'patternLayout' * fix: 'mustRunAfter' is defined by 'configureEach' but used within 'subprojects' * fix: Use testFixture notation, instead of project's compile test fixture task output Especially, the test fixtures of the servlet instrumentation needs to export their dependencies to :dd-java-agent:testing
1 parent 4fed081 commit 36490a6

File tree

7 files changed

+12
-14
lines changed

7 files changed

+12
-14
lines changed

dd-java-agent/instrumentation/liberty-20/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ dependencies {
3737
webappCompileOnly group: 'javax.servlet', name: 'javax.servlet-api', version: '3.1.0'
3838
// compileOnly to avoid bringing all the test dependencies to the test app
3939
// these are to be provided by the system classloader on test time
40-
webappCompileOnly project(':dd-java-agent:instrumentation:servlet:request-3')
41-
.tasks['compileTestFixturesJava'].classpath
40+
webappCompileOnly testFixtures(project(':dd-java-agent:instrumentation:servlet:request-3'))
4241
// only the testFixtures jar (not its dependencies) and groovy should be included in the webapp
4342
webappImplementation files(
4443
project(':dd-java-agent:instrumentation:servlet:request-3')

dd-java-agent/instrumentation/liberty-23/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ dependencies {
4141
webappCompileOnly group: 'jakarta.servlet', name: 'jakarta.servlet-api', version: '5.0.0'
4242
// compileOnly to avoid bringing all the test dependencies to the test app
4343
// these are to be provided by the system classloader on test time
44-
webappCompileOnly project(':dd-java-agent:instrumentation:servlet:request-5')
45-
.tasks['compileTestFixturesJava'].classpath
44+
webappCompileOnly testFixtures(project(':dd-java-agent:instrumentation:servlet:request-5'))
4645
// only the testFixtures jar (not its dependencies) and groovy should be included in the webapp
4746
webappImplementation files(
4847
project(':dd-java-agent:instrumentation:servlet:request-5')

dd-java-agent/instrumentation/servlet/request-3/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ dependencies {
3838
compileOnly group: 'javax.servlet', name: 'javax.servlet-api', version: '3.1.0'
3939
implementation project(':dd-java-agent:instrumentation:servlet-common')
4040

41-
testFixturesImplementation(project(':dd-java-agent:testing')) {
41+
testFixturesApi(project(':dd-java-agent:testing')) {
4242
exclude group: 'org.eclipse.jetty', module: 'jetty-server'
4343
}
4444
testFixturesCompileOnly group: 'javax.servlet', name: 'javax.servlet-api', version: '3.0.1'

dd-java-agent/instrumentation/servlet/request-5/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ dependencies {
6464
transitive = false
6565
}
6666

67-
testFixturesImplementation(project(':dd-java-agent:testing')) {
67+
testFixturesApi(project(':dd-java-agent:testing')) {
6868
exclude group: 'org.eclipse.jetty', module: 'jetty-server'
6969
}
7070
testFixturesCompileOnly group: 'jakarta.servlet', name: 'jakarta.servlet-api', version: '5.0.0'

dd-smoke-tests/springboot-tomcat/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ repositories {
1919
url 'https://archive.apache.org/dist'
2020
patternLayout {
2121
artifact '/[organisation]/[module]/v[revision]/bin/apache-[organisation]-[revision].[ext]'
22-
metadataSources {
23-
artifact()
24-
}
22+
}
23+
metadataSources {
24+
it.artifact()
2525
}
2626
}
2727
}

dd-smoke-tests/wildfly/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ repositories {
1414
// artifact '/[organisation]/[revision]/[module]/[organisation]-[module]-[revision].[ext]'
1515
// we download the full EE profile and not the servlet minimal one
1616
artifact '/[organisation]/[revision]/[organisation]-[revision].[ext]'
17-
metadataSources {
18-
artifact()
19-
}
17+
}
18+
metadataSources {
19+
it.artifact()
2020
}
2121
}
2222
}

gradle/publish.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ configurations {
111111
}
112112
}
113113

114-
tasks.withType(AbstractPublishToMaven).configureEach {
114+
tasks.withType(AbstractPublishToMaven).configureEach { task ->
115115
rootProject.subprojects {
116-
mustRunAfter tasks.matching { it instanceof VerificationTask }
116+
task.mustRunAfter tasks.matching { it instanceof VerificationTask }
117117
}
118118
}

0 commit comments

Comments
 (0)