Drop (most) Groovy DSL tests#4687
Conversation
Codecov Report
@@ Coverage Diff @@
## main #4687 +/- ##
=========================================
Coverage 84.44% 84.44%
Complexity 3436 3436
=========================================
Files 492 492
Lines 11337 11337
Branches 2083 2083
=========================================
Hits 9573 9573
Misses 703 703
Partials 1061 1061 Continue to review full report at Codecov.
|
| val mainBuildFileContent: String = """ | ||
| |plugins { | ||
| | id "io.gitlab.arturbosch.detekt" apply false | ||
| | id("io.gitlab.arturbosch.detekt") |
There was a problem hiding this comment.
This is the only behaviour change I had to introduce (here, and again in a later test in this class).
Because of the way Gradle generates type-safe accessors for extensions provided by plugins it's necessary to apply the plugin to the root project so that the detekt extension can be used later in the subprojects block. This doesn't impact the behaviour of the test itself though.
* Drop Groovy DSL-based tests where Kotlin DSL-based equivalent exists * Rewrite remaining Groovy DSL-based tests to use Kotlin DSL * Add dedicated Groovy DSL test * Use kotlin dependency extension where possible * Suppress LongMethod detekt warning
Closes #4560
There's a new Groovy DSL test in
DetektTaskGroovyDslSpecwhich covers the entire DSL for the extension and the three detekt tasks. It doesn't run the task since many files etc. won't be accessible. Instead, the:helptask is run, which compiles the build files. Usingtasks.createfor these tasks means the tasks will be created & configured even though they're not run.