com.danielsomerfield.cvecheck.gradle.CVECheckExtensionBootstrap.groovy Maven / Gradle / Ivy
package com.danielsomerfield.cvecheck.gradle
import com.danielsomerfield.cvecheck.gradle.handlers.buildRules.*
import com.danielsomerfield.util.Maybe
class CVECheckExtensionBootstrap {
def CVECheckExtension extension() {
return new CVECheckExtension(buildRuleBuilder(), defaultBuildRules())
}
def List defaultBuildRules() {
[
new CVSSIndividualThresholdBuildRule(new BuildRuleConfiguration(Maybe.some(5))),
new CVSSOverallThresholdBuildRule(new BuildRuleConfiguration(Maybe.some(10)))
]
}
def BuildRuleBuilder buildRuleBuilder() {
new CVEBuildRuleBuilder(buildRuleMapping())
}
def Map> buildRuleMapping() {
[
"cvss-overall-threshold" : CVSSOverallThresholdBuildRule.class,
"cvss-individual-threshold": CVSSOverallThresholdBuildRule.class
]
}
}