Skip to content
Snippets Groups Projects
fault-sections.gradle 993 B
Newer Older
  • Learn to ignore specific revisions
  • apply plugin: "de.undercouch.download"
    
    ext {
      archiveUrl = "https://code.usgs.gov/ghsc/nshmp/nshm-fault-sections/-/archive"
    
      faultsDir = "fault-sections";
    
    }
    
    task downloadFaultSections() {
      doLast {
        // Download and unzip nshm-fault-sections tag 1.1
        def zipFile1p1 = new File(faultsDir, "nshm-fault-sections-1.1.zip")
        download.run {
          src "${archiveUrl}/1.1/nshm-fault-sections-1.1.zip"
          dest zipFile1p1
        }
        copy {
          from zipTree(zipFile1p1)
          into faultsDir
        }
        delete {
          delete zipFile1p1
        }
    
    Clayton, Brandon Scott's avatar
    Clayton, Brandon Scott committed
    
        // Download and unzip nshm-fault-sections tag 1.1
        def zipFile1p2 = new File(faultsDir, "nshm-fault-sections-1.2.zip")
        download.run {
          src "${archiveUrl}/1.2/nshm-fault-sections-1.2.zip"
          dest zipFile1p2
        }
        copy {
          from zipTree(zipFile1p2)
          into faultsDir
        }
        delete {
          delete zipFile1p2
        }
    
      }
    }
    
    task faultSectionsClean(type: Delete) {
      delete faultsDir
    }
    clean.dependsOn faultSectionsClean