All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.danielsomerfield.cvecheck.gradle.DependencyCheckGradlePlugin.groovy Maven / Gradle / Ivy

There is a newer version: 0.6.2-100
Show newest version
package com.danielsomerfield.cvecheck.gradle

import com.danielsomerfield.cvecheck.GradleTaskConfigurator
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.slf4j.Logger
import org.slf4j.LoggerFactory

class DependencyCheckGradlePlugin implements Plugin {

  private Logger logger = LoggerFactory.getLogger(getClass())
  private CVECheckExtensionBootstrap bootstrap = new CVECheckExtensionBootstrap()

  @Override
  void apply(final Project project) {
    logVersion()
    GradleTaskConfigurator configurator = new GradleTaskConfigurator(project)
    project.extensions.add("cvecheck", bootstrap.extension())
    project.getTasks().create("scan") << {
      configurator.scanTask().scan(project)
    }
  }

  def logVersion() {
    Properties properties = new Properties()
    getClass().getResourceAsStream("/application.properties").withCloseable { InputStream i ->
      properties.load(i)
    }
    logger.info("Running version ${properties.getProperty("application.version")}")
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy