Skip to content

Commit

Permalink
Merge pull request #23 from Ozsie/1.0.0-RC14-dev
Browse files Browse the repository at this point in the history
1.0.0 rc14 dev
  • Loading branch information
Ozsie authored May 22, 2019
2 parents 689d340 + 66b632b commit 4a928d7
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.github.ozsie</groupId>
<artifactId>detekt-maven-plugin</artifactId>
<version>1.0.0-RC14-2</version>
<version>1.0.0-RC14-3</version>
<packaging>maven-plugin</packaging>

<name>detekt-maven-plugin Maven Plugin</name>
Expand Down Expand Up @@ -39,7 +39,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<kotlin.version>1.3.21</kotlin.version>
<detekt.version>1.0.0-RC14</detekt.version>
<detekt.maven.version>1.0.0-RC14</detekt.maven.version>
<detekt.maven.version>1.0.0-RC14-2</detekt.maven.version>
<jcommander.version>1.72</jcommander.version>
<snakeyaml.version>1.21</snakeyaml.version>
</properties>
Expand Down Expand Up @@ -117,7 +117,7 @@
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-test</artifactId>
<version>${kotlin.version}</version>
<version>${kotlin.version}</version>
<scope>test</scope>
</dependency>

Expand Down Expand Up @@ -230,6 +230,7 @@
<phase>verify</phase>
<goals><goal>check</goal></goals>
<configuration>
<report>xml:reports/detekt.xml</report>
<filters>
<filter>.*test.*</filter>
</filters>
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/github/ozsie/CheckMojo.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ import java.nio.file.Paths
requiresDependencyResolution = ResolutionScope.TEST)
class CheckMojo : DetektMojo() {
override fun execute() {
getCliSting().forEach {
log.debug("Applying $it")
}
val cliArgs = parseArguments<CliArgs>(getCliSting().log().toTypedArray()).first
if (mavenProject?.basedir != null) {
skip = !Files.isDirectory(Paths.get("${mavenProject?.basedir}/src"))
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/github/ozsie/CreateBaselineMojo.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import org.apache.maven.plugins.annotations.Mojo
@Mojo(name = "create-baseline")
open class CreateBaselineMojo : DetektMojo() {
override fun execute() {
getCliSting().forEach {
log.debug("Applying $it")
}
val cliArgs = parseArguments<CliArgs>(cliString).first
if (!skip) Runner(cliArgs).execute()
}
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/com/github/ozsie/DetektMojo.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ const val PLUGINS = "-p"
const val PRINT_AST = "--print-ast"
const val RUN_RULE = "--run-rule"
const val REPORT = "-r"
const val BUILD_UPON_DEFAULT_CONFIG = "--build-upon-default-config"
const val FAIL_FAST = "--fail-fast"

const val MDP_ID = "com.github.ozsie:detekt-maven-plugin"

Expand Down Expand Up @@ -66,6 +68,12 @@ abstract class DetektMojo : AbstractMojo() {
@Parameter(property = "detekt.disableDefaultRuleset", defaultValue = "false")
var disableDefaultRuleset = false

@Parameter(property = "detekt.buildUponDefaultConfig", defaultValue = "false")
var buildUponDefaultConfig = false

@Parameter(property = "detekt.failFast", defaultValue = "false")
var failFast = false

@Parameter(property = "detekt.runRule", defaultValue = "")
var runRule = ""

Expand Down Expand Up @@ -93,6 +101,8 @@ abstract class DetektMojo : AbstractMojo() {
.useIf(runRule.isNotEmpty(), RUN_RULE, runRule)
.useIf(report.isNotEmpty(), toArgList(report))
.useIf(printAst, PRINT_AST)
.useIf(buildUponDefaultConfig, BUILD_UPON_DEFAULT_CONFIG)
.useIf(failFast, FAIL_FAST)
.useIf(disableDefaultRuleset, DISABLE_DEFAULT_RULE_SET)
.useIf(plugins.isNotEmpty(), PLUGINS, plugins.buildPluginPaths(mavenProject, localRepoLocation))
}
Expand Down

0 comments on commit 4a928d7

Please sign in to comment.