Skip to content

Commit

Permalink
Enable gradle worker api
Browse files Browse the repository at this point in the history
  • Loading branch information
BraisGabin committed Jan 26, 2024
1 parent 6b5a5f9 commit ba09253
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Expand Up @@ -214,7 +214,7 @@ abstract class Detekt @Inject constructor(

@TaskAction
fun check() {
if (providers.gradleProperty(USE_WORKER_API).getOrElse("false") == "true") {
if (providers.gradleProperty(USE_WORKER_API).getOrElse("true").toBoolean()) {
logger.info("Executing $name using Worker API")
val workQueue = workerExecutor.processIsolation { workerSpec ->
workerSpec.classpath.from(detektClasspath)
Expand Down
Expand Up @@ -143,7 +143,7 @@ abstract class DetektCreateBaselineTask @Inject constructor(

@TaskAction
fun baseline() {
if (providers.gradleProperty(USE_WORKER_API).getOrElse("false") == "true") {
if (providers.gradleProperty(USE_WORKER_API).getOrElse("true").toBoolean()) {
logger.info("Executing $name using Worker API")
val workQueue = workerExecutor.processIsolation { workerSpec ->
workerSpec.classpath.from(detektClasspath)
Expand Down
Expand Up @@ -57,7 +57,7 @@ abstract class DetektGenerateConfigTask @Inject constructor(

Files.createDirectories(configFile.get().asFile.parentFile.toPath())

if (providers.gradleProperty(USE_WORKER_API).getOrElse("false") == "true") {
if (providers.gradleProperty(USE_WORKER_API).getOrElse("true").toBoolean()) {
logger.info("Executing $name using Worker API")
val workQueue = workerExecutor.processIsolation { workerSpec ->
workerSpec.classpath.from(detektClasspath)
Expand Down
2 changes: 1 addition & 1 deletion website/docs/gettingstarted/gradle.mdx
Expand Up @@ -310,7 +310,7 @@ detekt {
### <a name="gradle-properties">Options for detekt Gradle properties</a>

```groovy
// If set to true, enables Gradle Worker API for Detekt tasks. `false` by default.
// If set to true, enables Gradle Worker API for Detekt tasks. `true` by default.
// See the doc for the Worker API at https://docs.gradle.org/8.1/userguide/worker_api.html
detekt.use.worker.api = false
```
Expand Down

0 comments on commit ba09253

Please sign in to comment.