diff --git a/.buildkite/schedules/dependency-analysis.yml b/.buildkite/schedules/dependency-analysis.yml new file mode 100644 index 000000000..76bb30d63 --- /dev/null +++ b/.buildkite/schedules/dependency-analysis.yml @@ -0,0 +1,23 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json +--- + +common_params: + # Common plugin settings to use with the `plugins` key. + - &common_plugins + - automattic/a8c-ci-toolkit#2.15.0 + +agents: + queue: "android" + +steps: + - label: "dependency analysis" + command: | + echo "--- 📊 Analyzing" + cp gradle.properties-example gradle.properties + ./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 053dcb333..4aa42004d 100644 --- a/build.gradle +++ b/build.gradle @@ -3,6 +3,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { id "com.android.library" apply false id "org.jetbrains.kotlin.android" apply false + id "com.autonomousapps.dependency-analysis" } allprojects { diff --git a/gradle.properties-example b/gradle.properties-example index cf7de29a8..b7b498698 100644 --- a/gradle.properties-example +++ b/gradle.properties-example @@ -4,3 +4,6 @@ android.useAndroidX=true android.enableJetifier=false android.nonTransitiveRClass=true + +# Dependency Analysis Plugin +dependency.analysis.android.ignored.variants=release diff --git a/settings.gradle b/settings.gradle index 3e90c0f9d..5b9360df7 100644 --- a/settings.gradle +++ b/settings.gradle @@ -2,11 +2,13 @@ pluginManagement { gradle.ext.kotlinVersion = '1.9.22' gradle.ext.agpVersion = '8.1.0' gradle.ext.automatticPublishToS3Version = '0.9.0' + gradle.ext.dependencyAnalysisVersion = '1.28.0' plugins { id "org.jetbrains.kotlin.android" version gradle.ext.kotlinVersion id "com.android.library" version gradle.ext.agpVersion id "com.automattic.android.publish-to-s3" version gradle.ext.automatticPublishToS3Version + id "com.autonomousapps.dependency-analysis" version gradle.ext.dependencyAnalysisVersion } repositories { maven {