diff --git a/build.gradle b/build.gradle index 71a978bf1..0d9b5ffa6 100644 --- a/build.gradle +++ b/build.gradle @@ -291,6 +291,26 @@ task javadocJar(type: Jar, dependsOn: javadoc) { from javadoc.destinationDir } +// This adds HARNESS_JAVA_AGENT to the testing command if it's +// provided through the command line. +// Local builds will still remain same as it only adds if the +// parameter is provided. +tasks.withType(Test) { + if(System.getProperty("HARNESS_JAVA_AGENT")) { + jvmArgs += [System.getProperty("HARNESS_JAVA_AGENT")] + } +} + +// This makes sure that any test tasks for subprojects don't +// fail in case the test filter does not match. +gradle.projectsEvaluated { + tasks.withType(Test) { + filter { + setFailOnNoMatchingTests(false) + } + } +} + artifacts { archives sourcesJar archives javadocJar