From 6d3fbe64540dd480a78c8c3321644d59584c87b2 Mon Sep 17 00:00:00 2001 From: Oussama Date: Mon, 21 Aug 2023 14:32:44 +0200 Subject: [PATCH] chore: upgrade agp to 8.1 --- app/build.gradle.kts | 3 ++- .../src/main/kotlin/AndroidApplicationConventionPlugin.kt | 3 +-- .../kotlin/com/wire/android/gradle/ComposeConfiguration.kt | 2 +- .../com/wire/android/gradle/KotlinAndroidConfiguration.kt | 4 ++-- buildSrc/src/main/kotlin/scripts/variants.gradle.kts | 3 +-- gradle/libs.versions.toml | 5 +++-- gradle/wrapper/gradle-wrapper.properties | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index f7548c34ef4..44dcfb1030e 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -53,10 +53,11 @@ android { exclude(module = "protobuf-java") } - packagingOptions { + packaging { resources.pickFirsts.add("google/protobuf/*.proto") jniLibs.pickFirsts.add("**/libsodium.so") } + android.buildFeatures.buildConfig = true } kapt { diff --git a/build-logic/plugins/src/main/kotlin/AndroidApplicationConventionPlugin.kt b/build-logic/plugins/src/main/kotlin/AndroidApplicationConventionPlugin.kt index 2620b96c9bd..f4d33d34472 100644 --- a/build-logic/plugins/src/main/kotlin/AndroidApplicationConventionPlugin.kt +++ b/build-logic/plugins/src/main/kotlin/AndroidApplicationConventionPlugin.kt @@ -2,7 +2,6 @@ import com.android.build.api.dsl.ApplicationExtension import com.wire.android.gradle.configureAndroidKotlinTests import com.wire.android.gradle.configureCompose import com.wire.android.gradle.configureKotlinAndroid -import com.wire.android.gradle.version.Versionizer import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.kotlin.dsl.configure @@ -45,7 +44,7 @@ class AndroidApplicationConventionPlugin : Plugin { configureCompose(this) - packagingOptions { + packaging { resources { pickFirsts.add("META-INF/AL2.0") pickFirsts.add("META-INF/LGPL2.1") diff --git a/build-logic/plugins/src/main/kotlin/com/wire/android/gradle/ComposeConfiguration.kt b/build-logic/plugins/src/main/kotlin/com/wire/android/gradle/ComposeConfiguration.kt index a3133c7c39f..8ff5a5d3bc5 100644 --- a/build-logic/plugins/src/main/kotlin/com/wire/android/gradle/ComposeConfiguration.kt +++ b/build-logic/plugins/src/main/kotlin/com/wire/android/gradle/ComposeConfiguration.kt @@ -22,7 +22,7 @@ import findVersion import org.gradle.api.Project internal fun Project.configureCompose( - commonExtension: CommonExtension<*, *, *, *>, + commonExtension: CommonExtension<*, *, *, *, *>, ): Unit = with(commonExtension) { buildFeatures { compose = true diff --git a/build-logic/plugins/src/main/kotlin/com/wire/android/gradle/KotlinAndroidConfiguration.kt b/build-logic/plugins/src/main/kotlin/com/wire/android/gradle/KotlinAndroidConfiguration.kt index d5e030798d4..3c6183ae568 100644 --- a/build-logic/plugins/src/main/kotlin/com/wire/android/gradle/KotlinAndroidConfiguration.kt +++ b/build-logic/plugins/src/main/kotlin/com/wire/android/gradle/KotlinAndroidConfiguration.kt @@ -30,7 +30,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile import versionCatalog internal fun Project.configureKotlinAndroid( - commonExtension: CommonExtension<*, *, *, *>, + commonExtension: CommonExtension<*, *, *, *, *>, ): Unit = with(commonExtension) { compileSdk = AndroidSdk.compile @@ -85,7 +85,7 @@ private fun Project.configureKotlin() { } } -internal fun CommonExtension<*, *, *, *>.configureAndroidKotlinTests() { +internal fun CommonExtension<*, *, *, *, *>.configureAndroidKotlinTests() { defaultConfig { testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunnerArguments.putAll( diff --git a/buildSrc/src/main/kotlin/scripts/variants.gradle.kts b/buildSrc/src/main/kotlin/scripts/variants.gradle.kts index 79dffb708d3..7300f7e1a1d 100644 --- a/buildSrc/src/main/kotlin/scripts/variants.gradle.kts +++ b/buildSrc/src/main/kotlin/scripts/variants.gradle.kts @@ -23,7 +23,6 @@ package scripts import com.android.build.api.dsl.ApplicationProductFlavor import com.android.build.api.dsl.ProductFlavor import customization.ConfigType -import customization.Customization import customization.Customization.getBuildtimeConfiguration import customization.FeatureConfigs import customization.FeatureFlags @@ -170,7 +169,7 @@ android { */ productFlavors.forEach { flavor -> Features.values().forEach { feature -> - val activated = FeatureFlags.activated[flavor.name].orEmpty().contains(feature) + val activated = FeatureFlags.activated.mapKeys { it.key.buildName }[flavor.name].orEmpty().contains(feature) flavor.buildConfigField("Boolean", feature.name, activated.toString()) } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 77bb20311b4..8327165fab1 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,6 +1,6 @@ [versions] # Gradle - Remind to change in `gradle-wrapper.properties` file as well! -gradle = "7.6.1" +gradle = "8.1" # Kotlin kotlin = "1.9.0" @@ -13,7 +13,7 @@ ktx-serialization = "1.5.1" # Android Core / Architecture google-gms = "4.3.15" -android-gradlePlugin = "7.4.1" +android-gradlePlugin = "8.1.0" desugaring = "1.1.5" firebaseBOM = "31.4.0" fragment = "1.5.6" @@ -92,6 +92,7 @@ ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" } wire-android-application = { id = "com.wire.android.application" } wire-android-library = { id = "com.wire.android.library" } wire-hilt = { id = "com.wire.android.hilt" } +androidTest = { id = "com.android.test", version.ref = "android-gradlePlugin" } [bundles] #android = ["appCompat", "activityCompose", "work", "composeMaterial", "coroutinesAndroid", "ktor", "ktor-okHttp"] diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 28d61505934..856ef66e32a 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -20,6 +20,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists