diff --git a/dd-java-agent/instrumentation/apache-httpclient/apache-httpasyncclient-4.0/build.gradle b/dd-java-agent/instrumentation/apache-httpclient/apache-httpasyncclient-4.0/build.gradle deleted file mode 100644 index 0cf8ceded0e..00000000000 --- a/dd-java-agent/instrumentation/apache-httpclient/apache-httpasyncclient-4.0/build.gradle +++ /dev/null @@ -1,21 +0,0 @@ - -muzzle { - pass { - group = "org.apache.httpcomponents" - module = "httpasyncclient" - versions = "[4.0,)" - assertInverse = true - } -} - -apply from: "$rootDir/gradle/java.gradle" - -addTestSuiteForDir('latestDepTest', 'test') - -dependencies { - compileOnly group: 'org.apache.httpcomponents', name: 'httpasyncclient', version: '4.0' - - testImplementation group: 'org.apache.httpcomponents', name: 'httpasyncclient', version: '4.0' - - latestDepTestImplementation group: 'org.apache.httpcomponents', name: 'httpasyncclient', version: '+' -} diff --git a/dd-java-agent/instrumentation/apache-httpclient/apache-httpasyncclient-4.0/build.gradle.kts b/dd-java-agent/instrumentation/apache-httpclient/apache-httpasyncclient-4.0/build.gradle.kts new file mode 100644 index 00000000000..d9d2c1196f6 --- /dev/null +++ b/dd-java-agent/instrumentation/apache-httpclient/apache-httpasyncclient-4.0/build.gradle.kts @@ -0,0 +1,32 @@ +import groovy.lang.Closure + +plugins { + `java-library` +} + +muzzle { + pass { + group = "org.apache.httpcomponents" + module = "httpasyncclient" + versions = "[4.0,)" + assertInverse = true + } +} + +apply(from = "$rootDir/gradle/java.gradle") + +// Helper extension for custom method from Groovy DSL +fun addTestSuiteForDir(name: String, dirName: String) { + (project.extra["addTestSuiteForDir"] as? Closure<*>)?.call(name, dirName) +} + +addTestSuiteForDir("latestDepTest", "test") + +dependencies { + compileOnly("org.apache.httpcomponents:httpasyncclient:4.0") + + testImplementation("org.apache.httpcomponents:httpasyncclient:4.0") + + // Kotlin accessors are not generated if not created by a plugin or explicitly declared + add("latestDepTestImplementation", "org.apache.httpcomponents:httpasyncclient:+") +} diff --git a/dd-java-agent/instrumentation/apache-httpclient/apache-httpclient-4.0/build.gradle b/dd-java-agent/instrumentation/apache-httpclient/apache-httpclient-4.0/build.gradle deleted file mode 100644 index 469aff39b1c..00000000000 --- a/dd-java-agent/instrumentation/apache-httpclient/apache-httpclient-4.0/build.gradle +++ /dev/null @@ -1,55 +0,0 @@ -muzzle { - fail { - group = "commons-httpclient" - module = "commons-httpclient" - versions = "[,4.0)" - skipVersions += '3.1-jenkins-1' - skipVersions += '2.0-final' // broken metadata on maven central - } - pass { - group = "org.apache.httpcomponents" - module = "httpclient" - versions = "[4.0,5)" - assertInverse = true - } - pass { - // We want to support the dropwizard clients too. - group = 'io.dropwizard' - module = 'dropwizard-client' - versions = "[,3)" // dropwizard-client 3+ uses httpclient5 - } -} - -apply from: "$rootDir/gradle/java.gradle" - -addTestSuiteForDir('latestDepTest', 'test') -addTestSuite('iastIntegrationTest') -addTestSuiteExtendingForDir('v41IastIntegrationTest', 'iastIntegrationTest', 'iastIntegrationTest') -addTestSuiteExtendingForDir('v42IastIntegrationTest', 'iastIntegrationTest', 'iastIntegrationTest') -addTestSuiteExtendingForDir('v43IastIntegrationTest', 'iastIntegrationTest', 'iastIntegrationTest') -addTestSuiteExtendingForDir('v44IastIntegrationTest', 'iastIntegrationTest', 'iastIntegrationTest') -addTestSuiteExtendingForDir('v45IastIntegrationTest', 'iastIntegrationTest', 'iastIntegrationTest') - -dependencies { - compileOnly group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.0' - testImplementation project(':dd-java-agent:agent-iast:iast-test-fixtures') - testImplementation group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.0' - testImplementation(project(':dd-java-agent:instrumentation:apache-httpclient:apache-httpasyncclient-4.0')) - // to instrument the integration test - iastIntegrationTestImplementation project(':dd-java-agent:agent-iast:iast-test-fixtures') - iastIntegrationTestImplementation group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.0' - iastIntegrationTestRuntimeOnly(project(':dd-java-agent:instrumentation:jetty:jetty-server:jetty-server-9.0')) - iastIntegrationTestRuntimeOnly(project(':dd-java-agent:instrumentation:apache-httpcore:apache-httpcore-4.0')) - iastIntegrationTestRuntimeOnly(project(':dd-java-agent:instrumentation:servlet')) - iastIntegrationTestRuntimeOnly(project(':dd-java-agent:instrumentation:java-lang')) - iastIntegrationTestRuntimeOnly(project(':dd-java-agent:instrumentation:java-net')) - iastIntegrationTestRuntimeOnly project(':dd-java-agent:instrumentation:iast-instrumenter') - - v41IastIntegrationTestImplementation group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.1' - v42IastIntegrationTestImplementation group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.2' - v43IastIntegrationTestImplementation group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.3' - v44IastIntegrationTestImplementation group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.4' - v45IastIntegrationTestImplementation group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5' - - latestDepTestImplementation group: 'org.apache.httpcomponents', name: 'httpclient', version: '+' -} diff --git a/dd-java-agent/instrumentation/apache-httpclient/apache-httpclient-4.0/build.gradle.kts b/dd-java-agent/instrumentation/apache-httpclient/apache-httpclient-4.0/build.gradle.kts new file mode 100644 index 00000000000..11ec39b7766 --- /dev/null +++ b/dd-java-agent/instrumentation/apache-httpclient/apache-httpclient-4.0/build.gradle.kts @@ -0,0 +1,73 @@ +import groovy.lang.Closure + +plugins { + `java-library` +} + +muzzle { + fail { + group = "commons-httpclient" + module = "commons-httpclient" + versions = "[,4.0)" + skipVersions += "3.1-jenkins-1" + skipVersions += "2.0-final" // broken metadata on maven central + } + pass { + group = "org.apache.httpcomponents" + module = "httpclient" + versions = "[4.0,5)" + assertInverse = true + } + pass { + // We want to support the dropwizard clients too. + group = "io.dropwizard" + module = "dropwizard-client" + versions = "[,3)" // dropwizard-client 3+ uses httpclient5 + } +} + +apply(from = "$rootDir/gradle/java.gradle") + +// Helper extensions for custom methods from Groovy DSL +fun addTestSuite(name: String) { + (project.extra["addTestSuite"] as? Closure<*>)?.call(name) +} +fun addTestSuiteForDir(name: String, dirName: String) { + (project.extra["addTestSuiteForDir"] as? Closure<*>)?.call(name, dirName) +} +fun addTestSuiteExtendingForDir(testSuiteName: String, parentSuiteName: String, dirName: String) { + (project.extra["addTestSuiteExtendingForDir"] as? Closure<*>)?.call(testSuiteName, parentSuiteName, dirName) +} + +addTestSuiteForDir("latestDepTest", "test") +addTestSuite("iastIntegrationTest") +addTestSuiteExtendingForDir("v41IastIntegrationTest", "iastIntegrationTest", "iastIntegrationTest") +addTestSuiteExtendingForDir("v42IastIntegrationTest", "iastIntegrationTest", "iastIntegrationTest") +addTestSuiteExtendingForDir("v43IastIntegrationTest", "iastIntegrationTest", "iastIntegrationTest") +addTestSuiteExtendingForDir("v44IastIntegrationTest", "iastIntegrationTest", "iastIntegrationTest") +addTestSuiteExtendingForDir("v45IastIntegrationTest", "iastIntegrationTest", "iastIntegrationTest") + +dependencies { + compileOnly("org.apache.httpcomponents:httpclient:4.0") + testImplementation(project(":dd-java-agent:agent-iast:iast-test-fixtures")) + testImplementation("org.apache.httpcomponents:httpclient:4.0") + testImplementation(project(":dd-java-agent:instrumentation:apache-httpclient:apache-httpasyncclient-4.0")) + // to instrument the integration test + "iastIntegrationTestImplementation"(project(":dd-java-agent:agent-iast:iast-test-fixtures")) + "iastIntegrationTestImplementation"("org.apache.httpcomponents:httpclient:4.0") + "iastIntegrationTestRuntimeOnly"(project(":dd-java-agent:instrumentation:jetty:jetty-server:jetty-server-9.0")) + "iastIntegrationTestRuntimeOnly"(project(":dd-java-agent:instrumentation:apache-httpcore:apache-httpcore-4.0")) + "iastIntegrationTestRuntimeOnly"(project(":dd-java-agent:instrumentation:servlet")) + "iastIntegrationTestRuntimeOnly"(project(":dd-java-agent:instrumentation:java-lang")) + "iastIntegrationTestRuntimeOnly"(project(":dd-java-agent:instrumentation:java-net")) + "iastIntegrationTestRuntimeOnly"(project(":dd-java-agent:instrumentation:iast-instrumenter")) + + "v41IastIntegrationTestImplementation"("org.apache.httpcomponents:httpclient:4.1") + "v42IastIntegrationTestImplementation"("org.apache.httpcomponents:httpclient:4.2") + "v43IastIntegrationTestImplementation"("org.apache.httpcomponents:httpclient:4.3") + "v44IastIntegrationTestImplementation"("org.apache.httpcomponents:httpclient:4.4") + "v45IastIntegrationTestImplementation"("org.apache.httpcomponents:httpclient:4.5") + + // Kotlin accessors are not generated if not created by a plugin or explicitly declared + add("latestDepTestImplementation", "org.apache.httpcomponents:httpclient:+") +} diff --git a/dd-java-agent/instrumentation/apache-httpclient/apache-httpclient-5.0/build.gradle b/dd-java-agent/instrumentation/apache-httpclient/apache-httpclient-5.0/build.gradle deleted file mode 100644 index 0bcee37c285..00000000000 --- a/dd-java-agent/instrumentation/apache-httpclient/apache-httpclient-5.0/build.gradle +++ /dev/null @@ -1,20 +0,0 @@ -muzzle { - pass { - group = "org.apache.httpcomponents.client5" - module = "httpclient5" - versions = "[5.0,)" - assertInverse = true - } -} - -apply from: "$rootDir/gradle/java.gradle" - -addTestSuiteForDir('latestDepTest', 'test') - -dependencies { - compileOnly group: 'org.apache.httpcomponents.client5', name: 'httpclient5', version: '5.0' - - testImplementation group: 'org.apache.httpcomponents.client5', name: 'httpclient5', version: '5.0' - - latestDepTestImplementation group: 'org.apache.httpcomponents.client5', name: 'httpclient5', version: '+' -} diff --git a/dd-java-agent/instrumentation/apache-httpclient/apache-httpclient-5.0/build.gradle.kts b/dd-java-agent/instrumentation/apache-httpclient/apache-httpclient-5.0/build.gradle.kts new file mode 100644 index 00000000000..190b5ca0970 --- /dev/null +++ b/dd-java-agent/instrumentation/apache-httpclient/apache-httpclient-5.0/build.gradle.kts @@ -0,0 +1,32 @@ +import groovy.lang.Closure + +plugins { + `java-library` +} + +muzzle { + pass { + group = "org.apache.httpcomponents.client5" + module = "httpclient5" + versions = "[5.0,)" + assertInverse = true + } +} + +apply(from = "$rootDir/gradle/java.gradle") + +// Helper extension for custom method from Groovy DSL +fun addTestSuiteForDir(name: String, dirName: String) { + (project.extra["addTestSuiteForDir"] as? Closure<*>)?.call(name, dirName) +} + +addTestSuiteForDir("latestDepTest", "test") + +dependencies { + compileOnly("org.apache.httpcomponents.client5:httpclient5:5.0") + + testImplementation("org.apache.httpcomponents.client5:httpclient5:5.0") + + // Kotlin accessors are not generated if not created by a plugin or explicitly declared + add("latestDepTestImplementation", "org.apache.httpcomponents.client5:httpclient5:+") +} diff --git a/dd-java-agent/instrumentation/apache-httpcore/apache-httpcore-4.0/build.gradle b/dd-java-agent/instrumentation/apache-httpcore/apache-httpcore-4.0/build.gradle deleted file mode 100644 index 096173402d1..00000000000 --- a/dd-java-agent/instrumentation/apache-httpcore/apache-httpcore-4.0/build.gradle +++ /dev/null @@ -1,20 +0,0 @@ -muzzle { - pass { - group = "org.apache.httpcomponents" - module = "httpcore" - versions = "[4.0,5)" - assertInverse = true - } -} - -apply from: "$rootDir/gradle/java.gradle" - -addTestSuiteForDir('latestDepTest', 'test') - -dependencies { - compileOnly group: 'org.apache.httpcomponents', name: 'httpcore', version: '4.0' - - testImplementation group: 'org.apache.httpcomponents', name: 'httpcore', version: '4.0' - - latestDepTestImplementation group: 'org.apache.httpcomponents', name: 'httpcore', version: '+' -} diff --git a/dd-java-agent/instrumentation/apache-httpcore/apache-httpcore-4.0/build.gradle.kts b/dd-java-agent/instrumentation/apache-httpcore/apache-httpcore-4.0/build.gradle.kts new file mode 100644 index 00000000000..b3381078958 --- /dev/null +++ b/dd-java-agent/instrumentation/apache-httpcore/apache-httpcore-4.0/build.gradle.kts @@ -0,0 +1,32 @@ +import groovy.lang.Closure + +plugins { + `java-library` +} + +muzzle { + pass { + group = "org.apache.httpcomponents" + module = "httpcore" + versions = "[4.0,5)" + assertInverse = true + } +} + +apply(from = "$rootDir/gradle/java.gradle") + +// Helper extensions for custom methods from Groovy DSL +fun addTestSuiteForDir(name: String, dirName: String) { + (project.extra["addTestSuiteForDir"] as? Closure<*>)?.call(name, dirName) +} + +addTestSuiteForDir("latestDepTest", "test") + +dependencies { + compileOnly("org.apache.httpcomponents:httpcore:4.0") + + testImplementation("org.apache.httpcomponents:httpcore:4.0") + + // Kotlin accessors are not generated if not created by a plugin or explicitly declared + add("latestDepTestImplementation", "org.apache.httpcomponents:httpcore:+") +} diff --git a/dd-java-agent/instrumentation/apache-httpcore/apache-httpcore-5.0/build.gradle b/dd-java-agent/instrumentation/apache-httpcore/apache-httpcore-5.0/build.gradle deleted file mode 100644 index 60002ac1043..00000000000 --- a/dd-java-agent/instrumentation/apache-httpcore/apache-httpcore-5.0/build.gradle +++ /dev/null @@ -1,20 +0,0 @@ -muzzle { - pass { - group = "org.apache.httpcomponents.core5" - module = "httpcore5" - versions = "[5.0,)" - assertInverse = true - } -} - -apply from: "$rootDir/gradle/java.gradle" - -addTestSuiteForDir('latestDepTest', 'test') - -dependencies { - compileOnly group: 'org.apache.httpcomponents.core5', name: 'httpcore5', version: '5.0' - - testImplementation group: 'org.apache.httpcomponents.core5', name: 'httpcore5', version: '5.0' - - latestDepTestImplementation group: 'org.apache.httpcomponents.core5', name: 'httpcore5', version: '+' -} diff --git a/dd-java-agent/instrumentation/apache-httpcore/apache-httpcore-5.0/build.gradle.kts b/dd-java-agent/instrumentation/apache-httpcore/apache-httpcore-5.0/build.gradle.kts new file mode 100644 index 00000000000..f6c0f67cd72 --- /dev/null +++ b/dd-java-agent/instrumentation/apache-httpcore/apache-httpcore-5.0/build.gradle.kts @@ -0,0 +1,32 @@ +import groovy.lang.Closure + +plugins { + `java-library` +} + +muzzle { + pass { + group = "org.apache.httpcomponents.core5" + module = "httpcore5" + versions = "[5.0,)" + assertInverse = true + } +} + +apply(from = "$rootDir/gradle/java.gradle") + +// Helper extensions for custom methods from Groovy DSL +fun addTestSuiteForDir(name: String, dirName: String) { + (project.extra["addTestSuiteForDir"] as? Closure<*>)?.call(name, dirName) +} + +addTestSuiteForDir("latestDepTest", "test") + +dependencies { + compileOnly("org.apache.httpcomponents.core5:httpcore5:5.0") + + testImplementation("org.apache.httpcomponents.core5:httpcore5:5.0") + + // Kotlin accessors are not generated if not created by a plugin or explicitly declared + add("latestDepTestImplementation", "org.apache.httpcomponents.core5:httpcore5:+") +}