Skip to content

Commit

Permalink
Merge pull request #12988 from woocommerce/enable_configuration_cache
Browse files Browse the repository at this point in the history
Enable configuration cache
  • Loading branch information
wzieba authored Nov 25, 2024
2 parents e5d79d7 + b27a044 commit 6311891
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 25 deletions.
8 changes: 1 addition & 7 deletions WooCommerce/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ android {
coreLibraryDesugaringEnabled true
}

flavorDimensions "buildType"
flavorDimensions = ["buildType"]

productFlavors {
// Used for release/beta builds. Usually shouldn't be build locally.
Expand Down Expand Up @@ -552,12 +552,6 @@ android.buildTypes.all { buildType ->
}
}

task printVersionName {
doLast {
println android.defaultConfig.versionName
}
}

static def loadPropertiesFromFile(inputFile) {
def properties = new Properties()
inputFile.withInputStream { stream ->
Expand Down
21 changes: 3 additions & 18 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ subprojects {
}
}

def detektAll = tasks.register("detektAll", Detekt) {
tasks.register("detektAll", Detekt) {
description = "Custom DETEKT build for all modules"
parallel = true
ignoreFailures = false
Expand All @@ -101,27 +101,12 @@ def detektAll = tasks.register("detektAll", Detekt) {
}
}

def detektAutoCorrectPrompt = tasks.register("detektAutoCorrectPrompt") {
doLast {
def detektTask = detektAll.get()
if (detektTask.state.failure != null && !detektTask.autoCorrect) {
println ".-----------------------------------------------------------------------------------------------------------------------------------.\n" +
"| 🛠 Did you know: you can ask Detekt to automatically resolve some of the issues by running `./gradlew detektAll --auto-correct` |\n" +
"'-----------------------------------------------------------------------------------------------------------------------------------'"
}
}
}

detektAll.configure {
finalizedBy detektAutoCorrectPrompt
}

dependencies {
detektPlugins(libs.detekt.formatting)
}

task clean(type: Delete) {
delete rootProject.buildDir
tasks.register('clean', Delete) {
delete rootProject.layout.buildDirectory
}

/**
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ ksp.allow.all.target.configuration=false

# Enables Gradle Build Cache - https://docs.gradle.org/current/userguide/build_cache.html
org.gradle.caching=true
org.gradle.configuration-cache=true

android.useAndroidX=true
android.enableJetifier=false
Expand Down

0 comments on commit 6311891

Please sign in to comment.