blob: 22ca8c1507119a87fed189a61393abf83e56fa4f [file] [log] [blame]
apply plugin: "java"
apply plugin: "java-library"
apply from: "$rootDir/gradle/test-launcher.gradle"
if (!base.archivesName.get().startsWith("mockito-")) {
base.archivesName = "mockito-" + project.name
}
apply from: "$rootDir/gradle/java-publication.gradle"
generatePomFileForJavaLibraryPublication.doLast {
//validates the the pom has correct artifact id to avoid issues like #1444
def pom = new groovy.xml.XmlSlurper().parse(destination)
assert pom.artifactId == base.archivesName.get()
assert pom.name == base.archivesName.get()
}
java {
sourceCompatibility = 11
targetCompatibility = 11
}
tasks.named("test", Test) {
include "**/*Test.class"
testLogging {
exceptionFormat 'full'
showCauses true
}
if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_17)
&& 'member-accessor-reflection' == System.getenv('MEMBER_ACCESSOR')) {
jvmArgs = ['--add-opens=java.base/java.lang=ALL-UNNAMED']
}
}
apply from: "$rootDir/gradle/retry-test.gradle"
tasks.withType(Checkstyle).configureEach {
reports {
xml.required = false
html.required = true
html.stylesheet resources.text.fromFile("$rootDir/config/checkstyle/checkstyle.xsl")
}
}