From 504e28d363a5693b42609726d3e31ac75160f4c8 Mon Sep 17 00:00:00 2001 From: Wojtek Zieba Date: Tue, 13 Aug 2024 13:43:21 +0200 Subject: [PATCH 1/3] Remove `dexOptions` extension To address: ``` WARNING: DSL element 'dexOptions' is obsolete and should be removed. It will be removed in version 8.0 of the Android Gradle plugin. Using it has no effect, and the AndroidGradle plugin optimizes dexing automatically. ``` --- WordPress/build.gradle | 5 ----- 1 file changed, 5 deletions(-) diff --git a/WordPress/build.gradle b/WordPress/build.gradle index 99d96ede5272..d9fc3741f9d9 100644 --- a/WordPress/build.gradle +++ b/WordPress/build.gradle @@ -128,11 +128,6 @@ android { useLibrary 'android.test.base' useLibrary 'android.test.mock' - dexOptions { - jumboMode = true - dexInProcess = true - } - namespace "org.wordpress.android" compileSdkVersion rootProject.compileSdkVersion From 99e276a2916ef366be094dfe3e0dae2f90ca4ccc Mon Sep 17 00:00:00 2001 From: Wojtek Zieba Date: Tue, 13 Aug 2024 13:45:43 +0200 Subject: [PATCH 2/3] Replace `compileSdkVersion` with `defaultConfig.compileSdk` The former is deprecated --- WordPress/build.gradle | 3 +-- libs/analytics/build.gradle | 3 +-- libs/editor/build.gradle | 3 +-- libs/image-editor/build.gradle | 3 +-- libs/mocks/build.gradle | 3 +-- libs/networking/build.gradle | 3 +-- 6 files changed, 6 insertions(+), 12 deletions(-) diff --git a/WordPress/build.gradle b/WordPress/build.gradle index d9fc3741f9d9..96be2da52c4d 100644 --- a/WordPress/build.gradle +++ b/WordPress/build.gradle @@ -130,8 +130,6 @@ android { namespace "org.wordpress.android" - compileSdkVersion rootProject.compileSdkVersion - def versionProperties = loadPropertiesFromFile(file("${rootDir}/version.properties")) defaultConfig { @@ -143,6 +141,7 @@ android { minSdkVersion rootProject.minSdkVersion targetSdkVersion rootProject.targetSdkVersion + compileSdk rootProject.compileSdkVersion testInstrumentationRunner 'org.wordpress.android.WordPressTestRunner' diff --git a/libs/analytics/build.gradle b/libs/analytics/build.gradle index d3e8edf28570..dba010fb5c97 100644 --- a/libs/analytics/build.gradle +++ b/libs/analytics/build.gradle @@ -25,11 +25,10 @@ dependencies { android { namespace "org.wordpress.android.analytics" - compileSdkVersion rootProject.compileSdkVersion - defaultConfig { minSdkVersion rootProject.minSdkVersion targetSdkVersion rootProject.targetSdkVersion + compileSdk rootProject.compileSdkVersion } lint { diff --git a/libs/editor/build.gradle b/libs/editor/build.gradle index d50c03155102..aff1c1205df7 100644 --- a/libs/editor/build.gradle +++ b/libs/editor/build.gradle @@ -31,11 +31,10 @@ repositories { android { namespace "org.wordpress.android.editor" - compileSdkVersion rootProject.compileSdkVersion - defaultConfig { minSdkVersion rootProject.minSdkVersion targetSdkVersion rootProject.targetSdkVersion + compileSdk rootProject.compileSdkVersion } lint { diff --git a/libs/image-editor/build.gradle b/libs/image-editor/build.gradle index 2cdd7f6bf40f..b5e467505b98 100644 --- a/libs/image-editor/build.gradle +++ b/libs/image-editor/build.gradle @@ -9,11 +9,10 @@ plugins { android { namespace "org.wordpress.android.imageeditor" - compileSdkVersion rootProject.compileSdkVersion - defaultConfig { minSdkVersion rootProject.minSdkVersion targetSdkVersion rootProject.targetSdkVersion + compileSdk rootProject.compileSdkVersion testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } diff --git a/libs/mocks/build.gradle b/libs/mocks/build.gradle index 40db9b3997cf..04c77ec499e6 100644 --- a/libs/mocks/build.gradle +++ b/libs/mocks/build.gradle @@ -5,11 +5,10 @@ plugins { android { namespace "org.wordpress.android.mocks" - compileSdkVersion rootProject.compileSdkVersion - defaultConfig { minSdkVersion rootProject.minSdkVersion targetSdkVersion rootProject.targetSdkVersion + compileSdk rootProject.compileSdkVersion } lint { diff --git a/libs/networking/build.gradle b/libs/networking/build.gradle index 457a92785de9..e532daff8d2e 100644 --- a/libs/networking/build.gradle +++ b/libs/networking/build.gradle @@ -5,11 +5,10 @@ plugins { android { namespace "org.wordpress.android.networking" - compileSdkVersion rootProject.compileSdkVersion - defaultConfig { minSdkVersion rootProject.minSdkVersion targetSdkVersion rootProject.targetSdkVersion + compileSdk rootProject.compileSdkVersion } lint { From c6c32e4d2b118d44095102d9699ba1b5b1bf0da3 Mon Sep 17 00:00:00 2001 From: Wojtek Zieba Date: Tue, 13 Aug 2024 13:55:00 +0200 Subject: [PATCH 3/3] Fix adding static aar files Addresses Gradle build-time warning: ``` WARNING: Using flatDir should be avoided because it doesn't support any meta-data formats. ``` and a lint issue on dependencies: ``` Unrecognized dependency annotation ``` --- WordPress/build.gradle | 4 ++-- build.gradle | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/WordPress/build.gradle b/WordPress/build.gradle index 96be2da52c4d..de640212577e 100644 --- a/WordPress/build.gradle +++ b/WordPress/build.gradle @@ -509,7 +509,7 @@ dependencies { implementation "com.github.indexos.media-for-mobile:domain:$indexosMediaForMobileVersion" implementation "com.github.indexos.media-for-mobile:android:$indexosMediaForMobileVersion" implementation "com.zendesk:support:$zendeskVersion" - implementation (name:'tenor-android-core-jetified', ext:'aar') // Jetified Tenor Gif library + implementation files('../aars/tenor-android-core-jetified.aar') // Jetified Tenor Gif library implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinxCoroutinesVersion" implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$kotlinxCoroutinesVersion" implementation "com.github.PhilJay:MPAndroidChart:$philjayMpAndroidChartVersion" @@ -564,7 +564,7 @@ dependencies { androidTestImplementation "tools.fastlane:screengrab:$screengrabVersion", { exclude group: 'com.android.support.test.uiautomator', module: 'uiautomator-v18' } - androidTestImplementation (name:'cloudtestingscreenshotter_lib', ext:'aar') // Screenshots on Firebase Cloud Testing + androidTestImplementation files('../aars/cloudtestingscreenshotter_lib.aar') // Screenshots on Firebase Cloud Testing androidTestImplementation "androidx.work:work-testing:$androidxWorkManagerVersion" androidTestImplementation "com.google.dagger:hilt-android-testing:$gradle.ext.daggerVersion" kspAndroidTest "com.google.dagger:hilt-android-compiler:$gradle.ext.daggerVersion" diff --git a/build.gradle b/build.gradle index c3f1bc3479ee..73724fc308d4 100644 --- a/build.gradle +++ b/build.gradle @@ -154,9 +154,6 @@ allprojects { includeVersion "com.jraska", "falcon", "2.1.1" } } - flatDir { - dirs '../aars' - } } tasks.register("checkstyle", Checkstyle) {