Skip to content

Commit 3ea7ad7

Browse files
committed
Fix version scan plugin
Now you can run `./gradlew :dd-java-agent:integrations:datastax-cassandra-3.2::scanVersionsReport -PshowClasses` to show you the classes you can use for that version range.
1 parent 7298b0a commit 3ea7ad7

File tree

2 files changed

+32
-31
lines changed

2 files changed

+32
-31
lines changed

buildSrc/src/main/groovy/VersionScanPlugin.groovy

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ class VersionScanPlugin implements Plugin<Project> {
3939
description = "Queries for all versions of configured modules and finds key classes"
4040
}
4141

42-
def hasRelevantTask = project.gradle.startParameter.taskNames.contains('scanVersions')
43-
hasRelevantTask |= project.gradle.startParameter.taskNames.contains('scanVersionsReport')
44-
hasRelevantTask |= project.gradle.startParameter.taskNames.contains('verifyVersionScan')
42+
def hasRelevantTask = project.gradle.startParameter.taskNames.any { it.contains('scanVersions') }
43+
hasRelevantTask |= project.gradle.startParameter.taskNames.any { it.contains('scanVersionsReport') }
44+
hasRelevantTask |= project.gradle.startParameter.taskNames.any { it.contains('verifyVersionScan') }
4545

4646
if (!hasRelevantTask) {
4747
return
@@ -80,7 +80,7 @@ class VersionScanPlugin implements Plugin<Project> {
8080
}
8181
}
8282
}
83-
if (project.gradle.startParameter.taskNames.contains('scanVersions')) {
83+
if (project.gradle.startParameter.taskNames.any { it.contains('scanVersions') }) {
8484
scanVersions.finalizedBy(scanVersionsReport)
8585
}
8686

@@ -176,7 +176,7 @@ class VersionScanPlugin implements Plugin<Project> {
176176
}
177177
}
178178

179-
if (project.gradle.startParameter.taskNames.contains('scanVersions')) {
179+
if (project.gradle.startParameter.taskNames.any { it.contains('scanVersions') }) {
180180
scanVersions.finalizedBy(verifyVersionScan)
181181
}
182182
}
Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,33 @@
11
// TODO: VersionScan plugin does not report which version failed, which is making it hard to get meaningful results out of this block.
22
// Once versionScan can report on which version failed, this can be enabled.
33
// The desire is to apply the instrumentation to cassandra-datastax 2.3 and beyond.
4-
// apply plugin: 'version-scan'
54

6-
// versionScan {
7-
// group = "com.datastax.cassandra"
8-
// module = "cassandra-driver-core"
9-
// versions = "[3.2.0,)"
10-
// verifyPresent = [
11-
// // class we're advising
12-
// 'com.datastax.driver.core.Cluster$Manager': null,
13-
// // used by TracingSession
14-
// 'com.datastax.driver.core.BoundStatement' : null,
15-
// 'com.datastax.driver.core.BoundStatement' : null,
16-
// 'com.datastax.driver.core.CloseFuture' : null,
17-
// 'com.datastax.driver.core.Cluster' : null,
18-
// 'com.datastax.driver.core.Host' : null,
19-
// 'com.datastax.driver.core.PreparedStatement' : null,
20-
// 'com.datastax.driver.core.RegularStatement' : null,
21-
// 'com.datastax.driver.core.ResultSet' : null,
22-
// 'com.datastax.driver.core.ResultSetFuture' : null,
23-
// 'com.datastax.driver.core.Session' : null,
24-
// 'com.datastax.driver.core.Statement' : null,
25-
// 'com.google.common.base.Function' : null,
26-
// 'com.google.common.util.concurrent.Futures' : null,
27-
// 'com.google.common.util.concurrent.ListenableFuture' : null
28-
// ]
29-
// }
5+
apply plugin: 'version-scan'
6+
7+
versionScan {
8+
group = "com.datastax.cassandra"
9+
module = "cassandra-driver-core"
10+
versions = "[3.2.0,)"
11+
// verifyPresent = [
12+
// // class we're advising
13+
// 'com.datastax.driver.core.Cluster$Manager' : null,
14+
// // used by TracingSession
15+
// 'com.datastax.driver.core.BoundStatement' : null,
16+
// 'com.datastax.driver.core.BoundStatement' : null,
17+
// 'com.datastax.driver.core.CloseFuture' : null,
18+
// 'com.datastax.driver.core.Cluster' : null,
19+
// 'com.datastax.driver.core.Host' : null,
20+
// 'com.datastax.driver.core.PreparedStatement' : null,
21+
// 'com.datastax.driver.core.RegularStatement' : null,
22+
// 'com.datastax.driver.core.ResultSet' : null,
23+
// 'com.datastax.driver.core.ResultSetFuture' : null,
24+
// 'com.datastax.driver.core.Session' : null,
25+
// 'com.datastax.driver.core.Statement' : null,
26+
// 'com.google.common.base.Function' : null,
27+
// 'com.google.common.util.concurrent.Futures' : null,
28+
// 'com.google.common.util.concurrent.ListenableFuture': null
29+
// ]
30+
}
3031

3132
apply from: "${rootDir}/gradle/java.gradle"
3233

@@ -40,4 +41,4 @@ dependencies {
4041

4142
compile deps.bytebuddy
4243
compile deps.opentracing
43-
}
44+
}

0 commit comments

Comments
 (0)