Skip to content

Commit

Permalink
Enable Gradle's configuration cache by default (detekt#4576)
Browse files Browse the repository at this point in the history
* Flag tasks known to be incompatible with Gradle's configuration cache

* Enable Gradle's configuration cache by default
  • Loading branch information
3flex authored and Goooler committed Feb 10, 2022
1 parent f2c547e commit e00eafe
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codecoverage.yaml
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Generate Coverage Report
uses: gradle/gradle-build-action@v2
with:
arguments: --configuration-cache jacocoMergedReport
arguments: jacocoMergedReport

- name: Publish Coverage
if: success()
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/detekt-with-type-resolution.yaml
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Run detekt-cli with argsfile
uses: gradle/gradle-build-action@v2
with:
arguments: --configuration-cache :detekt-cli:runWithArgsFile
arguments: :detekt-cli:runWithArgsFile

- name: Upload SARIF to Github using the upload-sarif action
uses: github/codeql-action/upload-sarif@v1
Expand All @@ -49,4 +49,4 @@ jobs:
- name: Run analysis
uses: gradle/gradle-build-action@v2
with:
arguments: --configuration-cache detektMain detektTest
arguments: detektMain detektTest
6 changes: 3 additions & 3 deletions .github/workflows/pre-merge.yaml
Expand Up @@ -40,11 +40,11 @@ jobs:
- name: Run detekt-cli --help
uses: gradle/gradle-build-action@v2
with:
arguments: --configuration-cache :detekt-cli:runWithHelpFlag
arguments: :detekt-cli:runWithHelpFlag
- name: Run detekt-cli with argsfile
uses: gradle/gradle-build-action@v2
with:
arguments: --configuration-cache :detekt-cli:runWithArgsFile
arguments: :detekt-cli:runWithArgsFile

verify-generated-config-file:
if: ${{ !contains(github.event.head_commit.message, 'ci skip') }}
Expand Down Expand Up @@ -76,4 +76,4 @@ jobs:
- name: Build and compile test snippets
uses: gradle/gradle-build-action@v2
with:
arguments: --configuration-cache test -x :detekt-gradle-plugin:test -Pcompile-test-snippets=true
arguments: test -x :detekt-gradle-plugin:test -Pcompile-test-snippets=true
4 changes: 4 additions & 0 deletions build-logic/src/main/kotlin/module.gradle.kts
Expand Up @@ -21,6 +21,10 @@ val versionCatalog = project.extensions.getByType<VersionCatalogsExtension>().na

jacoco.toolVersion = versionCatalog.findVersion("jacoco").get().requiredVersion

tasks.withType<PublishToMavenRepository>().configureEach {
notCompatibleWithConfigurationCache("https://github.com/gradle/gradle/issues/13468")
}

tasks.withType<Test>().configureEach {
useJUnitPlatform()
systemProperty("spek2.jvm.cg.scan.concurrency", 1) // use one thread for classpath scanning
Expand Down
4 changes: 4 additions & 0 deletions detekt-api/build.gradle.kts
Expand Up @@ -33,6 +33,10 @@ tasks.withType<DokkaTask>().configureEach {
outputDirectory.set(rootDir.resolve("docs/pages/kdoc"))
}

tasks.dokkaJekyll {
notCompatibleWithConfigurationCache("https://github.com/Kotlin/dokka/issues/1217")
}

apiValidation {
ignoredPackages.add("io.gitlab.arturbosch.detekt.api.internal")
}
1 change: 1 addition & 0 deletions detekt-generator/build.gradle.kts
Expand Up @@ -67,6 +67,7 @@ val generateDocumentation by tasks.registering(JavaExec::class) {
}

val verifyGeneratorOutput by tasks.registering(Exec::class) {
notCompatibleWithConfigurationCache("cannot serialize object of type java.io.ByteArrayOutputStream")
dependsOn(generateDocumentation)
description = "Verifies that the default-detekt-config.yml is up-to-date"
val configDiff = ByteArrayOutputStream()
Expand Down
4 changes: 4 additions & 0 deletions detekt-gradle-plugin/build.gradle.kts
Expand Up @@ -136,6 +136,10 @@ tasks {
check {
dependsOn(testing.suites.named("functionalTest"))
}

ideaModule {
notCompatibleWithConfigurationCache("https://github.com/gradle/gradle/issues/13480")
}
}

// Skip publishing of test fixture API & runtime variants
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Expand Up @@ -3,3 +3,4 @@ systemProp.sonar.host.url=http://localhost:9000
org.gradle.parallel=true
org.gradle.caching=true
org.gradle.jvmargs=-Xmx1g -XX:MaxMetaspaceSize=512m -Dfile.encoding=UTF-8
org.gradle.unsafe.configuration-cache=true

0 comments on commit e00eafe

Please sign in to comment.