Skip to content

Commit

Permalink
Follow ups after 1.1.0 release (#1291)
Browse files Browse the repository at this point in the history
* Follow ups after 1.1.0 release
* Fix `user.home` for diktat gradle plugin (attempt 2)
* Move log4j into scope `test` (diktat-common, diktat-rules)
* Remove deprecated properties of `DiktatExtension`
* Bump default version of diktat-rules in build.gradle.kts
  • Loading branch information
petertrr committed May 4, 2022
1 parent ca8cd62 commit 535a8c8
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 23 deletions.
2 changes: 2 additions & 0 deletions diktat-common/pom.xml
Expand Up @@ -38,10 +38,12 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
Expand Down
2 changes: 1 addition & 1 deletion diktat-gradle-plugin/build.gradle.kts
Expand Up @@ -28,7 +28,7 @@ repositories {

// default value is needed for correct gradle loading in IDEA; actual value from maven is used during build
val ktlintVersion = project.properties.getOrDefault("ktlintVersion", "0.43.0") as String
val diktatVersion = project.version.takeIf { it.toString() != Project.DEFAULT_VERSION } ?: "0.5.2"
val diktatVersion = project.version.takeIf { it.toString() != Project.DEFAULT_VERSION } ?: "1.1.0"
val junitVersion = project.properties.getOrDefault("junitVersion", "5.8.1") as String
val jacocoVersion = project.properties.getOrDefault("jacocoVersion", "0.8.7") as String
dependencies {
Expand Down
@@ -1,6 +1,5 @@
package org.cqfn.diktat.plugin.gradle

import org.gradle.api.file.FileCollection
import org.gradle.api.tasks.InputFile
import org.gradle.api.tasks.PathSensitive
import org.gradle.api.tasks.PathSensitivity
Expand Down Expand Up @@ -40,18 +39,6 @@ open class DiktatExtension(
*/
var output: String = ""

/**
* Paths that will be excluded from diktat run
*/
@Deprecated("Configuration via inputs/excludes is unsupported, use inputs(Action)")
var excludes: FileCollection? = null

/**
* Paths that will be scanned for .kt(s) files
*/
@Deprecated("Configuration via inputs/excludes is unsupported, use inputs(Action)")
var inputs: FileCollection? = null

/**
* Baseline file, containing a list of errors that will be ignored.
* If this file doesn't exist, it will be created on the first invocation.
Expand Down
Expand Up @@ -63,14 +63,6 @@ open class DiktatJavaExecTaskBase @Inject constructor(
@get:PathSensitive(PathSensitivity.RELATIVE)
@get:InputFiles
val actualInputs: FileCollection by lazy {
with(diktatExtension) {
// validate configuration
require(inputs == null && excludes == null) {
"`inputs` and `excludes` arguments for diktat task are deprecated and now should be changed for `inputs {}` " +
"with configuration for PatternFilterable. Please check https://github.com/analysis-dev/diktat/README.md for more info."
}
}

if (inputs.includes.isEmpty() && inputs.excludes.isEmpty()) {
inputs.include("src/**/*.kt")
}
Expand Down Expand Up @@ -192,7 +184,7 @@ open class DiktatJavaExecTaskBase @Inject constructor(
// githubActions should have higher priority than a custom input
if (diktatExtension.githubActions) {
// need to set user.home specially for ktlint, so it will be able to put a relative path URI in SARIF
systemProperty("user.home", project.projectDir.toString())
systemProperty("user.home", project.rootDir.toString())
reporterFlag = "--reporter=sarif"
}

Expand Down
2 changes: 2 additions & 0 deletions diktat-rules/pom.xml
Expand Up @@ -57,10 +57,12 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
Expand Down

0 comments on commit 535a8c8

Please sign in to comment.