com.danielsomerfield.cvecheck.gradle.ScanTask.groovy Maven / Gradle / Ivy
package com.danielsomerfield.cvecheck.gradle
import com.danielsomerfield.cvecheck.ScanResultHandler
import com.danielsomerfield.cvecheck.gradle.handlers.VulnerabilityCountResultHandler
import org.gradle.api.Project
class ScanTask {
private final GradleProjectScanner scanner
private ScanResultHandler scanResultHandler;
public ScanTask(final GradleProjectScanner scanner, ScanResultHandler scanResultHandler = new VulnerabilityCountResultHandler(0)) {
this.scanner = scanner;
this.scanResultHandler = scanResultHandler;
}
def scan(Project project) {
scanResultHandler.handleScanResult(scanner.scan(project))
}
}