From 14368e35188b8fa3c268cb8b7ad4a88d97501fdd Mon Sep 17 00:00:00 2001 From: Brandon Clayton <bclayton@usgs.gov> Date: Tue, 6 Dec 2022 09:44:53 -0700 Subject: [PATCH] add tasks --- gradle/nshm.gradle | 117 +++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 109 insertions(+), 8 deletions(-) diff --git a/gradle/nshm.gradle b/gradle/nshm.gradle index a925e004..57da084f 100644 --- a/gradle/nshm.gradle +++ b/gradle/nshm.gradle @@ -22,26 +22,127 @@ ext { } } -/** - * Download the NSHMs - */ -task downloadNshms() { +// Download and unzip nshm-alaska tag for Alaska 2023 +task alaska2023() { doLast { - // Download and unzip nshm-alaska tag for Alaska 2023 downloadNshm("nshm-alaska", "3.a.0") + } +} - // Download and unzip nshm-conus tag for CONUS 2018 +// Download and unzip nshm-conus tag for CONUS 2018 +task conus2018() { + doLast { downloadNshm("nshm-conus", "5.2.0") + } +} - // Download and unzip nshm-conus tag for CONUS 2023 +// Download and unzip nshm-conus tag for CONUS 2023 +task conus2023() { + doLast { downloadNshm("nshm-conus", "6.a.3") + } +} - // Download and unzip nshm-hawaii tag for Hawaii 2021 +// Download and unzip nshm-hawaii tag for Hawaii 2021 +task hawaii2021() { + doLast { downloadNshm("nshm-hawaii", "2.0.2") } } +// Download all NSHMs +task nshms() { + dependsOn alaska2023 + dependsOn conus2018 + dependsOn conus2023 + dependsOn hawaii2021 +} + task cleanNshm(type: Delete) { delete nshmDir } clean.dependsOn cleanNshm + +// Test Alaska 2023 NSHM +task testAlaska2023(type: Test) { + description = "Test Alaska 2023 NSHM" + group = "verification" + dependsOn alaska2023 + + testLogging { + exceptionFormat "full" + } + + useJUnitPlatform() + jvmArgs( + "-Xms2g", + "-Xmx8g", + ) + + filter { + includeTestsMatching "gov.usgs.earthquake.nshmp.model.NshmTests.testAlaska2023" + } +} + +// Test CONUS 2018 NSHM +task testConus2018(type: Test) { + description = "Test CONUS 2018 NSHM" + group = "verification" + dependsOn conus2018 + + testLogging { + exceptionFormat "full" + } + + useJUnitPlatform() + jvmArgs( + "-Xms2g", + "-Xmx8g", + ) + + filter { + includeTestsMatching "gov.usgs.earthquake.nshmp.model.NshmTests.testConus2018" + } +} + +// Test CONUS 2023 NSHM +task testConus2023(type: Test) { + description = "Test CONUS 2023 NSHM" + group = "verification" + dependsOn conus2023 + + testLogging { + exceptionFormat "full" + } + + useJUnitPlatform() + jvmArgs( + "-Xms2g", + "-Xmx8g", + ) + + filter { + includeTestsMatching "gov.usgs.earthquake.nshmp.model.NshmTests.testConus2023" + } +} + +// Test Hawaii 2021 NSHM +task testHawaii2021(type: Test) { + description = "Test Hawaii 2021 NSHM" + group = "verification" + dependsOn hawaii2021 + + testLogging { + exceptionFormat "full" + } + + useJUnitPlatform() + jvmArgs( + "-Xms2g", + "-Xmx8g", + ) + + filter { + includeTestsMatching "gov.usgs.earthquake.nshmp.model.NshmTests.testHawaii2021" + } +} -- GitLab