Skip to content
13 changes: 13 additions & 0 deletions WooCommerce-Wear/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -219,3 +219,16 @@ static def loadPropertiesFromFile(inputFile) {
}
return properties
}

dependencyAnalysis {
issues {
onUnusedDependencies {
// This dependency is actually needed otherwise the app will crash with a runtime exception.
exclude(libs.androidx.hilt.navigation.compose.get().module.toString())
// This dependency is actually needed otherwise the app will crash with a runtime exception.
exclude(libs.androidx.preference.ktx.get().module.toString())
// This dependency is actually needed otherwise the app will crash with a runtime exception.
exclude(libs.androidx.work.runtime.ktx.get().module.toString())
}
}
}
15 changes: 15 additions & 0 deletions WooCommerce/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -514,4 +514,19 @@ def isLeakCanaryEnabled() {
return developerProperties.get("enable_leak_canary") ?: true
}

dependencyAnalysis {
issues {
onUnusedDependencies {
// This dependency is actually needed otherwise UI tests will crash with a runtime exception.
exclude(libs.apache.http.client.android.get().module.toString())
// This dependency is actually needed otherwise it will cause the app to fail to build.
exclude(libs.androidx.hilt.navigation.compose.get().module.toString())
// This dependency is actually needed otherwise it will cause the app to fail to build.
exclude(libs.androidx.work.runtime.ktx.get().module.toString())
// This dependency is actually needed otherwise it will cause the app to fail to build.
exclude(libs.google.protobuf.kotlinlite.get().module.toString())
}
}
}

apply from: '../config/gradle/build_optimization.gradle'
11 changes: 11 additions & 0 deletions libs/apifaker/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,14 @@ dependencies {
testImplementation(libs.mockito.kotlin)
testImplementation(libs.kotlinx.coroutines.test)
}

dependencyAnalysis {
issues {
onUnusedDependencies {
// This dependency is actually needed otherwise the app will crash with a runtime exception.
exclude(libs.androidx.compose.material.icons.extended.get().module.toString())
// This dependency is actually needed otherwise the app will crash with a runtime exception.
exclude(libs.androidx.hilt.navigation.compose.get().module.toString())
}
}
}
9 changes: 9 additions & 0 deletions libs/fluxc-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,12 @@ dependencies {
androidTestImplementation libs.androidx.test.ext.junit
androidTestImplementation libs.assertj.core
}

dependencyAnalysis {
issues {
onUnusedDependencies {
// This dependency is actually needed otherwise it will cause the app to fail to build.
exclude(libs.androidx.core.ktx.get().module.toString())
}
}
}
9 changes: 9 additions & 0 deletions libs/fluxc-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,12 @@ dependencies {
testImplementation libs.androidx.arch.core.testing
testImplementation libs.androidx.paging.runtime
}

dependencyAnalysis {
issues {
onUnusedDependencies {
// This dependency is actually needed; otherwise, tests fail.
exclude(libs.androidx.paging.runtime.get().module.toString())
}
}
}
6 changes: 4 additions & 2 deletions libs/fluxc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,12 @@ tasks.withType(KotlinCompile).configureEach {
dependencyAnalysis {
issues {
onUnusedDependencies {
// This dependency is actually needed otherwise the app will crash with a runtime exception.
// This dependency is actually needed; otherwise, the app will crash with a runtime exception.
exclude(libs.eventbus.android.get().module.toString())
// This dependency is actually needed otherwise UI tests will crash with a runtime exception.
// This dependency is actually needed; otherwise, UI tests will crash with a runtime exception.
exclude(libs.apache.http.client.android.get().module.toString())
// This dependency is actually needed; otherwise, NoClassDefFoundError will be thrown during card reader connection flow.
exclude(libs.squareup.okhttp3.tls.get().module.toString())
}
}
}