diff --git a/build.gradle b/build.gradle index a36b11a5d79fde0503e70fc7cbb65dc5066efd8c..e373f596d6ce961421a7802fc87b7d007d06a17e 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,4 @@ plugins { - id "application" id "com.diffplug.spotless" version "${spotlessVersion}" id "com.github.johnrengelman.shadow" version "${shadowVersion}" id "com.github.node-gradle.node" version "${nodePluginVersion}" @@ -8,61 +7,69 @@ plugins { id "eclipse-wtp" id "jacoco" id "java" - id "maven-publish" } -compileJava.options.encoding = "UTF-8" -compileTestJava.options.encoding = "UTF-8" -mainClassName = "gov.usgs.earthquake.nshmp.netcdf.www.Application" -sourceCompatibility = JavaVersion.VERSION_11 - -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" - -test { - useJUnitPlatform() +task runAashto(type: JavaExec) { + dependsOn(":src:aashto:run") } -jacoco { - toolVersion = "0.8.4" +task runHazard(type: JavaExec) { + dependsOn(":src:hazard:run") } -jacocoTestReport { - reports { - xml.enabled true - html.enabled true +subprojects { + apply plugin: "application" + apply plugin: "com.diffplug.spotless" + apply plugin: "com.github.johnrengelman.shadow" + apply plugin: "com.github.node-gradle.node" + apply plugin: "com.github.spotbugs" + apply plugin: "com.star-zero.gradle.githook" + apply plugin: "com.github.johnrengelman.shadow" + apply plugin: "java" + + application { + mainClass = "gov.usgs.earthquake.nshmp.netcdf.www.Application" } -} -check.dependsOn jacocoTestReport -shadowJar { - mergeServiceFiles() -} + compileJava.options.encoding = "UTF-8" + compileTestJava.options.encoding = "UTF-8" + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 -tasks.withType(JavaCompile) { - options.encoding = "UTF-8" - options.compilerArgs.add("-parameters") -} + apply from: "${rootDir}/gradle/dependencies.gradle" + apply from: "${rootDir}/gradle/git-hooks.gradle" + apply from: "${rootDir}/gradle/node.gradle" + apply from: "${rootDir}/gradle/repositories.gradle" + apply from: "${rootDir}/gradle/spotbugs.gradle" + apply from: "${rootDir}/gradle/spotless.gradle" -tasks.withType(JavaExec) { - jvmArgs('-noverify', '-XX:TieredStopAtLevel=1', '-Dcom.sun.management.jmxremote') -} + test { + useJUnitPlatform() + } -task libsClean(type: Delete) { - delete "libs" -} -clean.dependsOn libsClean + jacoco { + toolVersion = "0.8.4" + } + + jacocoTestReport { + reports { + xml.enabled true + html.enabled true + } + } + check.dependsOn jacocoTestReport + + shadowJar { + mergeServiceFiles() + } -/* SpotBugs */ -tasks.withType(com.github.spotbugs.snom.SpotBugsTask) { - reports { - html { - enabled true - stylesheet = 'fancy-hist.xsl' + /* SpotBugs */ + tasks.withType(com.github.spotbugs.snom.SpotBugsTask) { + reports { + html { + enabled true + stylesheet = 'fancy-hist.xsl' + } } } }