Skip to content
Snippets Groups Projects
build.gradle 1.73 KiB
Newer Older
Clayton, Brandon Scott's avatar
Clayton, Brandon Scott committed
plugins {
Clayton, Brandon Scott's avatar
Clayton, Brandon Scott committed
  id "application"
  id "com.diffplug.spotless" version "${spotlessVersion}"
  id "com.github.johnrengelman.shadow" version "${shadowVersion}"
  id "com.github.node-gradle.node" version "${nodePluginVersion}"
Clayton, Brandon Scott's avatar
Clayton, Brandon Scott committed
  id "com.github.spotbugs" version "${spotbugsVersion}"
  id "com.palantir.git-version" version "${gitVersionVersion}"
Clayton, Brandon Scott's avatar
Clayton, Brandon Scott committed
  id "com.star-zero.gradle.githook" version "${githooksVersion}"
  id "de.undercouch.download" version "${downloadVersion}"
Clayton, Brandon Scott's avatar
Clayton, Brandon Scott committed
  id "eclipse-wtp"
  id "jacoco"
  id "java-library"
  id "maven-publish"
Clayton, Brandon Scott's avatar
Clayton, Brandon Scott committed
compileJava.options.encoding = "UTF-8"
compileTestJava.options.encoding = "UTF-8"
Clayton, Brandon Scott's avatar
Clayton, Brandon Scott committed
mainClassName = "gov.usgs.earthquake.nshmp.www.Application"
sourceCompatibility = JavaVersion.VERSION_11
java {
  withSourcesJar()
}

apply from: "${projectDir}/gradle/app-version.gradle"
apply from: "${projectDir}/gradle/dependencies.gradle"
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"
Clayton, Brandon Scott's avatar
Clayton, Brandon Scott committed
test {
Clayton, Brandon Scott's avatar
Clayton, Brandon Scott committed
  useJUnitPlatform()

Clayton, Brandon Scott's avatar
Clayton, Brandon Scott committed
  reports {
    junitXml.enabled = true
    html.enabled = true
  }
}

jacocoTestReport {
  reports {
    xml.enabled true
    html.enabled true
  }
}
check.dependsOn jacocoTestReport

Clayton, Brandon Scott's avatar
Clayton, Brandon Scott committed
shadowJar {
  mergeServiceFiles()
}

Clayton, Brandon Scott's avatar
Clayton, Brandon Scott committed
tasks.withType(JavaCompile) {
  options.encoding = "UTF-8"
Clayton, Brandon Scott's avatar
Clayton, Brandon Scott committed
  options.compilerArgs.add("-parameters")
tasks.withType(JavaExec) {
  jvmArgs('-noverify', '-XX:TieredStopAtLevel=1', '-Dcom.sun.management.jmxremote')
}

/* Add HTML reports to SpotBugs */
Clayton, Brandon Scott's avatar
Clayton, Brandon Scott committed
tasks.withType(com.github.spotbugs.snom.SpotBugsTask) {
  reports {
Clayton, Brandon Scott's avatar
Clayton, Brandon Scott committed
    html {
      enabled true
      stylesheet = 'fancy-hist.xsl'
    }