Newer
Older
id "com.diffplug.spotless"
id "com.github.spotbugs"
id "com.github.node-gradle.node"
id "com.star-zero.gradle.githook"
id "eclipse-wtp"
id "jacoco"
id "java-library"
compileTestJava.options.encoding = "UTF-8"
sourceCompatibility = JavaVersion.VERSION_11
apply from: "${projectDir}/gradle/git-hooks.gradle"
apply from: "${projectDir}/gradle/node.gradle"
apply from: "${projectDir}/gradle/repositories.gradle"
apply from: "${projectDir}/gradle/spotbugs.gradle"
apply from: "${projectDir}/gradle/spotless.gradle"
api "com.google.guava:guava:${guavaVersion}"
api "com.google.code.gson:gson:${gsonVersion}"
testImplementation "org.junit.jupiter:junit-jupiter:${junitVersion}"
}
jacocoTestReport {
reports {
xml.enabled true
check.dependsOn jacocoTestReport
java {
withJavadocJar()
withSourcesJar()
}
def docTitle = "<a href=\"https://code.usgs.gov/ghsc/nshmp/nshmp-lib.git\">${project.name}</a>"
options.setUse(true)
options.author(true)
options.version(true)
options.encoding("UTF-8")
options.docEncoding("UTF-8")
options.charSet("UTF-8")
options.addBooleanOption("Xdoclint:none", true)
options.addBooleanOption("-no-module-directories", true)
"https://docs.oracle.com/en/java/javase/11/docs/api/",
"https://google.github.io/guava/releases/26.0-jre/api/docs/")
include "gov/usgs/earthquake/nshmp/**"
// temporary task to support local running of lib while developing
// model parsing classes; TODO remove when parser is stable
task fatJar(type: Jar) {
from {
configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
with jar
}
/* Add HTML reports to SpotBugs */
tasks.withType(com.github.spotbugs.snom.SpotBugsTask) {
reports {
html {
enabled true
test {
useJUnitPlatform()
maxHeapSize = "1g"
reports {
junitXml.enabled = true
html.enabled = true
}
filter {
excludeTestsMatching "gov.usgs.earthquake.nshmp.model.NshmTestsLargeTmp"
// e.g. excludeTestsMatching "gov.usgs.earthquake.nshmp.model.LoaderTests"
}
}