From 4ecd7d0730752f77bbd915ed937e62bff10b06cf Mon Sep 17 00:00:00 2001 From: Wojtek Zieba Date: Tue, 14 Jan 2025 16:51:27 +0100 Subject: [PATCH 1/2] Set `dependencyResolutionManagement` This way, repositories for dependencies of all modules are configured from a single place, reducing repetitions. --- WooCommerce-Wear/build.gradle | 21 --------------- WooCommerce/build.gradle | 44 ------------------------------- build.gradle | 5 ---- libs/apifaker/build.gradle | 22 ---------------- settings.gradle | 49 +++++++++++++++++++++++++++++++++++ 5 files changed, 49 insertions(+), 92 deletions(-) diff --git a/WooCommerce-Wear/build.gradle b/WooCommerce-Wear/build.gradle index a2ff99459c0..43820a46e00 100644 --- a/WooCommerce-Wear/build.gradle +++ b/WooCommerce-Wear/build.gradle @@ -10,27 +10,6 @@ plugins { alias(libs.plugins.sentry) } -repositories { - maven { - url 'https://a8c-libs.s3.amazonaws.com/android' - content { - includeGroup "org.wordpress" - includeGroup "org.wordpress.fluxc" - includeGroup "org.wordpress.fluxc.plugins" - includeGroup "org.wordpress.wellsql" - includeGroup "com.automattic" - includeGroup "com.automattic.tracks" - } - } - mavenCentral() - maven { - url "https://a8c-libs.s3.amazonaws.com/android/jcenter-mirror" - content { - includeVersion "com.android.volley", "volley", "1.1.1" - } - } -} - sentry { includeSourceContext = true autoUploadSourceContext = true diff --git a/WooCommerce/build.gradle b/WooCommerce/build.gradle index 6bca880c5a5..57329a1b6f4 100644 --- a/WooCommerce/build.gradle +++ b/WooCommerce/build.gradle @@ -58,50 +58,6 @@ sentry { ] } -repositories { - maven { - url 'https://a8c-libs.s3.amazonaws.com/android' - content { - includeGroup "org.wordpress" - includeGroup "org.wordpress.fluxc" - includeGroup "org.wordpress.fluxc.plugins" - includeGroup "org.wordpress.wellsql" - includeGroup "org.wordpress.mediapicker" - includeGroup "com.automattic" - includeGroup "com.automattic.tracks" - includeGroup "com.gravatar" - includeGroup "org.wordpress.aztec" - } - } - maven { - url 'https://zendesk.jfrog.io/zendesk/repo' - content { - includeGroup "com.zendesk" - includeGroup "com.zendesk.belvedere2" - } - } - mavenCentral() - maven { - url "https://a8c-libs.s3.amazonaws.com/android/jcenter-mirror" - content { - includeVersion "com.android.volley", "volley", "1.1.1" - includeVersion "com.google.android", "flexbox", "2.0.1" - includeVersion "com.jraska", "falcon", "2.1.1" - includeVersion "org.wordpress", "wellsql", "1.6.0" - includeVersion "org.wordpress", "wellsql-core", "1.6.0" - } - } - maven { - url "https://jitpack.io" - content { - includeModule("com.github.wordpress-mobile.WordPress-Aztec-Android", "aztec") - includeModule("com.github.wordpress-mobile.WordPress-Aztec-Android", "glide-loader") - includeModule("com.github.chrisbanes", "PhotoView") - includeModule("com.github.PhilJay", "MPAndroidChart") - } - } -} - def versionProperties = loadPropertiesFromFile(file("${rootDir}/version.properties")) android { diff --git a/build.gradle b/build.gradle index 6fa70f15ae0..3bf701975cd 100644 --- a/build.gradle +++ b/build.gradle @@ -60,11 +60,6 @@ static def readPropertiesFromFile(File file) { allprojects { apply plugin: libs.plugins.detekt.get().pluginId - repositories { - google() - mavenCentral() - } - tasks.withType(KotlinCompile).all { kotlinOptions { jvmTarget = libs.versions.java.get() diff --git a/libs/apifaker/build.gradle b/libs/apifaker/build.gradle index db4e680480a..6be6403e7a6 100644 --- a/libs/apifaker/build.gradle +++ b/libs/apifaker/build.gradle @@ -6,28 +6,6 @@ plugins { alias(libs.plugins.ksp) } -repositories { - maven { - url 'https://a8c-libs.s3.amazonaws.com/android' - content { - includeGroup "org.wordpress" - includeGroup "org.wordpress.fluxc" - includeGroup "org.wordpress.fluxc.plugins" - includeGroup "org.wordpress.wellsql" - includeGroup "org.wordpress.mediapicker" - includeGroup "com.automattic" - includeGroup "com.automattic.tracks" - } - } - - maven { - url "https://a8c-libs.s3.amazonaws.com/android/jcenter-mirror" - content { - includeVersion "com.android.volley", "volley", "1.1.1" - } - } -} - android { namespace 'com.woocommerce.android.apifaker' diff --git a/settings.gradle b/settings.gradle index 70800e1fb03..388d45b7f20 100644 --- a/settings.gradle +++ b/settings.gradle @@ -20,6 +20,55 @@ plugins { id 'com.gradle.enterprise' version '3.17.2' } +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + mavenCentral() + google() + maven { + url 'https://a8c-libs.s3.amazonaws.com/android' + content { + includeGroup "org.wordpress" + includeGroup "org.wordpress.fluxc" + includeGroup "org.wordpress.fluxc.plugins" + includeGroup "org.wordpress.wellsql" + includeGroup "org.wordpress.mediapicker" + includeGroup "com.automattic" + includeGroup "com.automattic.tracks" + includeGroup "com.gravatar" + includeGroup "org.wordpress.aztec" + } + } + maven { + url 'https://zendesk.jfrog.io/zendesk/repo' + content { + includeGroup "com.zendesk" + includeGroup "com.zendesk.belvedere2" + } + } + maven { + url "https://a8c-libs.s3.amazonaws.com/android/jcenter-mirror" + content { + includeVersion "com.android.volley", "volley", "1.1.1" + includeVersion "com.google.android", "flexbox", "2.0.1" + includeVersion "com.jraska", "falcon", "2.1.1" + includeVersion "org.wordpress", "wellsql", "1.6.0" + includeVersion "org.wordpress", "wellsql-core", "1.6.0" + } + } + maven { + url "https://jitpack.io" + content { + includeModule("com.github.wordpress-mobile.WordPress-Aztec-Android", "aztec") + includeModule("com.github.wordpress-mobile.WordPress-Aztec-Android", "glide-loader") + includeModule("com.github.chrisbanes", "PhotoView") + includeModule("com.github.PhilJay", "MPAndroidChart") + } + } + } +} + + rootProject.name = 'WCAndroid' include ':libs:commons' From 107d6ffab0d21dc423b9bd16226e250a76488cf2 Mon Sep 17 00:00:00 2001 From: Wojtek Zieba Date: Tue, 14 Jan 2025 16:53:31 +0100 Subject: [PATCH 2/2] Remove unnecessary dependency exclusion Added in 1c79b61a8110275eb5098a45df243934d5899649 --- build.gradle | 6 ------ 1 file changed, 6 deletions(-) diff --git a/build.gradle b/build.gradle index 3bf701975cd..f55319d32e8 100644 --- a/build.gradle +++ b/build.gradle @@ -72,12 +72,6 @@ allprojects { } } -subprojects { - configurations { - compile.exclude group: 'org.jetbrains', module: 'annotations-java5' - } -} - tasks.register("detektAll", Detekt) { description = "Custom DETEKT build for all modules" parallel = true