Skip to content

Commit

Permalink
Fix sonar.sources and sonar.tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JavierSegoviaCordoba committed Jun 8, 2023
1 parent 05bb17d commit 84d6b4a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

### Fixed

- `sonar.sources` and `sonar.tests`

### Updated

## [0.5.0-alpha.30] - 2023-06-08
Expand All @@ -35,7 +37,7 @@

### Added

- apply JavierSC Kotlin compiler dependencies in Kotlin Compiler feature
- apply JavierSC Kotlin compiler dependencies in Kotlin Compiler feature

### Fixed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,30 @@ constructor(

// TODO: https://github.com/detekt/detekt/issues/5412
// https://github.com/detekt/detekt/issues/5896
properties.property("sonar.sources", project.kotlinSrcDirsWithoutBuild.get())
properties.property("sonar.tests", project.kotlinTestsSrcDirsWithoutBuild.get())
properties.property("sonar.sources", project.kotlinDirs)
properties.property("sonar.tests", project.kotlinTestDirs)
}
}
}

private val Project.kotlinDirs: List<String>
get() =
kotlinSrcDirsWithoutBuild.orNull
.orEmpty()
.asSequence()
.filter(File::exists)
.map(File::getPath)
.toList()

private val Project.kotlinTestDirs: List<String>
get() =
kotlinTestsSrcDirsWithoutBuild.orNull
.orEmpty()
.asSequence()
.filter(File::exists)
.map(File::getPath)
.toList()

private fun Project.configureAndroidLintReportPaths(properties: SonarProperties) {
val reportsDir: File = buildDir.resolve("reports")
val sonarAndroidLintReportPaths = "sonar.androidLint.reportPaths"
Expand Down

0 comments on commit 84d6b4a

Please sign in to comment.