diff --git a/.buildkite/schedules/dependency-analysis.yml b/.buildkite/schedules/dependency-analysis.yml new file mode 100644 index 000000000..dcd893c01 --- /dev/null +++ b/.buildkite/schedules/dependency-analysis.yml @@ -0,0 +1,24 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json +--- + +# Nodes with values to reuse in the pipeline. +common_params: + # Common plugin settings to use with the `plugins` key. + - &common_plugins + - automattic/a8c-ci-toolkit#2.14.0 + +# Run everything on the `android` queue +agents: + queue: android + +steps: + - label: "dependency analysis" + command: | + echo "--- 📊 Analyzing" + ./gradlew buildHealth + plugins: *common_plugins + artifact_paths: + - "build/reports/dependency-analysis/build-health-report.*" + notify: + - slack: "#android-core-notifs" + if: build.state == "failed" diff --git a/build.gradle b/build.gradle index 72decc280..4f3f2ac08 100644 --- a/build.gradle +++ b/build.gradle @@ -13,6 +13,7 @@ plugins { id "com.android.application" apply false id "org.jetbrains.kotlin.android" apply false id "com.automattic.android.publish-to-s3" apply false + id "com.autonomousapps.dependency-analysis" } allprojects { diff --git a/gradle.properties b/gradle.properties index a288b9792..e8b57edfa 100644 --- a/gradle.properties +++ b/gradle.properties @@ -22,3 +22,6 @@ android.enableJetifier=false android.useAndroidX=true android.nonTransitiveRClass=true + +# Dependency Analysis Plugin +dependency.analysis.android.ignored.variants=release diff --git a/settings.gradle b/settings.gradle index 4b010eccf..f5477c396 100644 --- a/settings.gradle +++ b/settings.gradle @@ -2,12 +2,14 @@ pluginManagement { gradle.ext.kotlinVersion = '1.9.24' gradle.ext.agpVersion = '8.1.0' gradle.ext.automatticPublishToS3Version = '0.8.0' + gradle.ext.dependencyAnalysisVersion = '1.28.0' plugins { id "com.android.library" version gradle.ext.agpVersion id "com.android.application" version gradle.ext.agpVersion id "org.jetbrains.kotlin.android" version gradle.ext.kotlinVersion id "com.automattic.android.publish-to-s3" version gradle.ext.automatticPublishToS3Version + id "com.autonomousapps.dependency-analysis" version gradle.ext.dependencyAnalysisVersion } repositories { maven {