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

com.github.ozsie.CheckMojo.kt Maven / Gradle / Ivy

There is a newer version: 1.23.7
Show newest version
package com.github.ozsie

import io.gitlab.arturbosch.detekt.cli.CliArgs
import io.gitlab.arturbosch.detekt.cli.parseArguments
import io.gitlab.arturbosch.detekt.cli.runners.Runner
import org.apache.maven.plugins.annotations.LifecyclePhase
import org.apache.maven.plugins.annotations.Mojo
import org.apache.maven.plugins.annotations.ResolutionScope
import java.nio.file.Files
import java.nio.file.Paths

@Suppress("unused")
@Mojo(name = "check",
        defaultPhase = LifecyclePhase.VERIFY,
        requiresDependencyCollection = ResolutionScope.TEST)
class CheckMojo : DetektMojo() {
    override fun execute() {
        getCliSting().forEach {
            log.debug("Applying $it")
        }
        val cliArgs = parseArguments(getCliSting().log().toTypedArray()).first
        skip = !Files.isDirectory(Paths.get(input))
        if (!skip) return Runner(cliArgs).execute() else log.info("Input directory '$input' not found, skipping module")
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy