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.
This commit is contained in:
Tyler Benson 2017-11-28 18:34:56 -08:00
parent 7298b0a31a
commit 3ea7ad73ed
2 changed files with 32 additions and 31 deletions

View File

@ -39,9 +39,9 @@ class VersionScanPlugin implements Plugin<Project> {
description = "Queries for all versions of configured modules and finds key classes" description = "Queries for all versions of configured modules and finds key classes"
} }
def hasRelevantTask = project.gradle.startParameter.taskNames.contains('scanVersions') def hasRelevantTask = project.gradle.startParameter.taskNames.any { it.contains('scanVersions') }
hasRelevantTask |= project.gradle.startParameter.taskNames.contains('scanVersionsReport') hasRelevantTask |= project.gradle.startParameter.taskNames.any { it.contains('scanVersionsReport') }
hasRelevantTask |= project.gradle.startParameter.taskNames.contains('verifyVersionScan') hasRelevantTask |= project.gradle.startParameter.taskNames.any { it.contains('verifyVersionScan') }
if (!hasRelevantTask) { if (!hasRelevantTask) {
return return
@ -80,7 +80,7 @@ class VersionScanPlugin implements Plugin<Project> {
} }
} }
} }
if (project.gradle.startParameter.taskNames.contains('scanVersions')) { if (project.gradle.startParameter.taskNames.any { it.contains('scanVersions') }) {
scanVersions.finalizedBy(scanVersionsReport) scanVersions.finalizedBy(scanVersionsReport)
} }
@ -176,7 +176,7 @@ class VersionScanPlugin implements Plugin<Project> {
} }
} }
if (project.gradle.startParameter.taskNames.contains('scanVersions')) { if (project.gradle.startParameter.taskNames.any { it.contains('scanVersions') }) {
scanVersions.finalizedBy(verifyVersionScan) scanVersions.finalizedBy(verifyVersionScan)
} }
} }

View File

@ -1,15 +1,16 @@
// TODO: VersionScan plugin does not report which version failed, which is making it hard to get meaningful results out of this block. // TODO: VersionScan plugin does not report which version failed, which is making it hard to get meaningful results out of this block.
// Once versionScan can report on which version failed, this can be enabled. // Once versionScan can report on which version failed, this can be enabled.
// The desire is to apply the instrumentation to cassandra-datastax 2.3 and beyond. // The desire is to apply the instrumentation to cassandra-datastax 2.3 and beyond.
// apply plugin: 'version-scan'
// versionScan { apply plugin: 'version-scan'
// group = "com.datastax.cassandra"
// module = "cassandra-driver-core" versionScan {
// versions = "[3.2.0,)" group = "com.datastax.cassandra"
module = "cassandra-driver-core"
versions = "[3.2.0,)"
// verifyPresent = [ // verifyPresent = [
// // class we're advising // // class we're advising
// 'com.datastax.driver.core.Cluster$Manager': null, // 'com.datastax.driver.core.Cluster$Manager' : null,
// // used by TracingSession // // used by TracingSession
// 'com.datastax.driver.core.BoundStatement' : null, // 'com.datastax.driver.core.BoundStatement' : null,
// 'com.datastax.driver.core.BoundStatement' : null, // 'com.datastax.driver.core.BoundStatement' : null,
@ -24,9 +25,9 @@
// 'com.datastax.driver.core.Statement' : null, // 'com.datastax.driver.core.Statement' : null,
// 'com.google.common.base.Function' : null, // 'com.google.common.base.Function' : null,
// 'com.google.common.util.concurrent.Futures' : null, // 'com.google.common.util.concurrent.Futures' : null,
// 'com.google.common.util.concurrent.ListenableFuture' : null // 'com.google.common.util.concurrent.ListenableFuture': null
// ] // ]
// } }
apply from: "${rootDir}/gradle/java.gradle" apply from: "${rootDir}/gradle/java.gradle"