Newer
Older
* In order to build and run services locally,
* one needs to include the following directorie(s) in the root project (they
* models/
* ak/
* 2007/
* wus/
* 2008/
* 2014/
* 2014b/
* 2018/
* ceus/
* 2008/
* 2014/
* 2018/
*
* ...with each 'year' directory being an alias to the corresponding
* git repository. One only needs to include the model they will run in the services.
*
* Then build the JAR file: ./gradlew assemble
*
* One can then specify the model to run in the services:
* java -jar build/libs/nshmp-haz.jar --models=/path/to/models
*
* Where <MODEL> is one of the model enums in nshmp.www.Model
id "com.diffplug.spotless" version "${spotlessVersion}"
id "com.github.johnrengelman.shadow" version "${shadowVersion}"
id "com.github.node-gradle.node" version "${nodeVersion}"
id "com.github.spotbugs" version "${spotbugsVersion}"
id "com.star-zero.gradle.githook" version "${githooksVersion}"
id "io.micronaut.application" version "${mnPluginVersion}"
configurations {
nshmp
}
apply from: "${projectDir}/gradle/dependencies.gradle"
apply from: "${projectDir}/gradle/ext.gradle"
apply from: "${projectDir}/gradle/jar.gradle"
apply from: "${projectDir}/gradle/repositories.gradle"
compileJava.options.encoding = "UTF-8"
mainClassName = "gov.usgs.earthquake.nshmp.www.Application"
filter {
excludeTestsMatching "gov.usgs.earthquake.nshmp.model.NshmTestsLarge"
}
}
jacocoTestReport {
reports {
xml.enabled true
classDirectories.from(files(classDirectories.files.collect {
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
options.compilerArgs.add("-parameters")
}
tasks.withType(JavaExec) {
jvmArgs('-noverify', '-Xms2g', '-Xmx8g', '-XX:TieredStopAtLevel=1', '-Dcom.sun.management.jmxremote')
tasks.withType(com.github.spotbugs.snom.SpotBugsTask) {
html {
enabled true
stylesheet = 'fancy-hist.xsl'
}
task libsClean(type: Delete) {
delete libsDir
}
clean.dependsOn libsClean
gradle.afterProject {
copy {
from {
configurations.nshmp.collect { zipTree(it) }
}
into nshmpLib
}
apply from: "${nshmpLibGradleDir}/git-hooks.gradle"
apply from: "${nshmpLibGradleDir}/node.gradle"
apply from: "${nshmpLibGradleDir}/spotbugs.gradle"
apply from: "${nshmpLibGradleDir}/spotless.gradle"
}