Skip to content

Commit

Permalink
Don't fail on lower versions of java on report
Browse files Browse the repository at this point in the history
  • Loading branch information
BraisGabin committed Mar 1, 2024
1 parent cd9f78e commit 23bdc52
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Expand Up @@ -6,10 +6,13 @@ import io.gitlab.arturbosch.detekt.testkit.ProjectLayout
import io.gitlab.arturbosch.detekt.testkit.reIndent
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.condition.EnabledForJreRange
import org.junit.jupiter.api.condition.JRE.JAVA_17

class DetektReportMergeSpec {
@Test
@Suppress("LongMethod")
@EnabledForJreRange(min = JAVA_17, disabledReason = "https://github.com/gradle/gradle/issues/28034")
fun `Sarif merge is configured correctly for multi module project`() {
val builder = DslTestBuilder.kotlin()
val buildFileContent = """
Expand Down Expand Up @@ -75,6 +78,7 @@ class DetektReportMergeSpec {

@Test
@Suppress("LongMethod")
@EnabledForJreRange(min = JAVA_17, disabledReason = "https://github.com/gradle/gradle/issues/28034")
fun `XML merge is configured correctly for multi module project`() {
val builder = DslTestBuilder.kotlin()
val buildFileContent = """
Expand Down
7 changes: 7 additions & 0 deletions website/docs/introduction/reporting.md
Expand Up @@ -74,6 +74,13 @@ tasks will not run if detekt finds issues.

:::

:::caution Attention

Because of [gradle/gradle#28034](https://github.com/gradle/gradle/issues/28034) to make `reportMerge` to work you need
to use JDK 17 or higher or [disable the Worker API](https://detekt.dev/docs/gettingstarted/gradle#options-for-detekt-gradle-properties).

:::

The machine-readable report formats support report merging.
Detekt Gradle Plugin is not opinionated in how merging is set up and respects each project's build logic, especially
the merging makes most sense in a multi-module project. In this spirit, only Gradle tasks are provided.
Expand Down

0 comments on commit 23bdc52

Please sign in to comment.