-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
36 lines (30 loc) · 899 Bytes
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import de.undercouch.gradle.tasks.download.Download
import java.time.Year
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'de.undercouch:gradle-download-task:3.3.0'
}
}
apply plugin: 'de.undercouch.download'
group 'com.ugrave'
version '1.0-SNAPSHOT'
task mirror(type: Download, description: "Mirrors the NVD database", group: "NVD") {
def urls = [CVE_XML_12_MODIFIED_URL, CVE_XML_20_MODIFIED_URL, CVE_JSON_10_MODIFIED_URL]
def from = CVE_START_YEAR as int
def to = Year.now().getValue()
(from..to).each { year ->
urls << String.format(CVE_XML_12_BASE_URL, year)
urls << String.format(CVE_XML_20_BASE_URL, year)
urls << String.format(CVE_JSON_10_BASE_URL, year)
}
src(urls)
dest "$buildDir/nvd"
onlyIfNewer true
}
task clean(type: Delete) {
delete buildDir
}
mirror.mustRunAfter clean