diff --git a/AGENTS.md b/AGENTS.md index 47cb0ed51..fd652b55f 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -3,7 +3,7 @@ ## Package Identity Modular Android library consumed via Gradle composite builds. Provides shared authentication, networking, UI components, and -utilities across Infomaniak apps. Designed for JDK 17+, minSdk 27, compiled SDK 35. +utilities across Infomaniak apps. Designed for JDK 17+, minSdk 27, compiled SDK 37. ## Setup & Development diff --git a/BugTracker/build.gradle.kts b/BugTracker/build.gradle.kts index c9d7add02..9f08b35cd 100644 --- a/BugTracker/build.gradle.kts +++ b/BugTracker/build.gradle.kts @@ -40,6 +40,7 @@ dependencies { implementation(core.androidx.core.ktx) implementation(core.androidx.lifecycle.viewmodel.ktx) implementation(core.androidx.recyclerview) + implementation(core.material) implementation(core.navigation.fragment.ktx) implementation(core.navigation.ui.ktx) diff --git a/Coil/build.gradle.kts b/Coil/build.gradle.kts index e72121fde..3ab9c5333 100644 --- a/Coil/build.gradle.kts +++ b/Coil/build.gradle.kts @@ -28,6 +28,7 @@ dependencies { implementation(project(":Network")) implementation(project(":Sentry")) + implementation(platform(core.compose.bom)) implementation(core.compose.material3) implementation(core.androidx.core.ktx) implementation(core.androidx.core) diff --git a/build-logic/composeLint/src/main/kotlin/com/infomaniak/core/compose/lint/ComposeLintPlugin.kt b/build-logic/composeLint/src/main/kotlin/com/infomaniak/core/compose/lint/ComposeLintPlugin.kt index b7231bc40..08c7ac34c 100644 --- a/build-logic/composeLint/src/main/kotlin/com/infomaniak/core/compose/lint/ComposeLintPlugin.kt +++ b/build-logic/composeLint/src/main/kotlin/com/infomaniak/core/compose/lint/ComposeLintPlugin.kt @@ -18,6 +18,7 @@ package com.infomaniak.core.compose.lint import com.android.build.api.dsl.CommonExtension +import org.gradle.api.Action import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.api.artifacts.VersionCatalogsExtension @@ -35,15 +36,20 @@ class ComposeLintPlugin : Plugin { target.subprojects { plugins.withId("com.android.base") { - extensions.configure>("android") { - lint { - lintConfig = rootProject.file("Core/lint.xml") + extensions.configure( + "android", + object : Action { + override fun execute(android: CommonExtension) { + android.lint.apply { + lintConfig = rootProject.file("Core/lint.xml") - // To updateLintBaseline correctly, temporarily uncomment this line to only include errors and not - // warnings in the generated baseline - // ignoreWarnings = true - } - } + // To updateLintBaseline correctly, temporarily uncomment this line to only include errors and not + // warnings in the generated baseline + // ignoreWarnings = true + } + } + }, + ) dependencies { add("lintChecks", lintLibrary) diff --git a/build-logic/convention/src/main/kotlin/AndroidLibraryConventionPlugin.kt b/build-logic/convention/src/main/kotlin/AndroidLibraryConventionPlugin.kt index bbe883c51..5fc12c6cd 100644 --- a/build-logic/convention/src/main/kotlin/AndroidLibraryConventionPlugin.kt +++ b/build-logic/convention/src/main/kotlin/AndroidLibraryConventionPlugin.kt @@ -33,15 +33,22 @@ class AndroidLibraryConventionPlugin : Plugin { apply(plugin = "com.android.library") apply(plugin = "org.jetbrains.kotlin.android") + val proguardRules = file("proguard-rules.pro") + android { applyCommonConfiguration() defaultConfig { - consumerProguardFile("proguard-rules.pro") + if (proguardRules.exists()) { + consumerProguardFile(proguardRules) + } } buildTypes { release { isMinifyEnabled = false - proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") + proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt")) + if (proguardRules.exists()) { + proguardFiles(proguardRules) + } } } } diff --git a/build-logic/convention/src/main/kotlin/AndroidModuleConfig.kt b/build-logic/convention/src/main/kotlin/AndroidModuleConfig.kt index 34c60c503..2326766e9 100644 --- a/build-logic/convention/src/main/kotlin/AndroidModuleConfig.kt +++ b/build-logic/convention/src/main/kotlin/AndroidModuleConfig.kt @@ -19,13 +19,13 @@ import com.android.build.api.dsl.CommonExtension import org.gradle.api.JavaVersion -fun CommonExtension<*, *, *, *, *, *>.applyCommonConfiguration() { - compileSdk = 36 - defaultConfig { +fun CommonExtension.applyCommonConfiguration() { + compileSdk = 37 + defaultConfig.apply { minSdk = 27 testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } - compileOptions { + compileOptions.apply { val javaVersion = JavaVersion.VERSION_11 targetCompatibility = javaVersion // Generated JVM bytecode sourceCompatibility = javaVersion // Java language features. We are not writing Java, so we just keep it matching. diff --git a/gradle.properties b/gradle.properties index 132244e5b..bcc914dda 100644 --- a/gradle.properties +++ b/gradle.properties @@ -21,3 +21,6 @@ kotlin.code.style=official # resources declared in the library itself and none from the library's dependencies, # thereby reducing the size of the R class for that library android.nonTransitiveRClass=true +# Retain the existing Kotlin Gradle Plugin integration while migrating the build to AGP 9. +android.newDsl=false +android.builtInKotlin=false diff --git a/gradle/core.versions.toml b/gradle/core.versions.toml index f39b4f6c6..289cad047 100644 --- a/gradle/core.versions.toml +++ b/gradle/core.versions.toml @@ -2,7 +2,7 @@ accompanistPermissions = "0.37.3" activityCompose = "1.10.1" # TODO: Update to 1.11.0 or later after we bump compileSdk to 36 adaptive = "1.2.0" -agp = "8.13.2" # Delete this to-do on agp 9+ after searching and checking the project for the following: TODO[AGP9] +agp = "9.1.1" androidLogin = "3.1.14" androidxCollection = "1.5.0" androidxCore = "1.16.0" # TODO: Update to 1.17.0 or later after we bump compileSdk to 36 @@ -25,7 +25,7 @@ espressoCore = "3.7.0" firebaseMessaging = "24.1.2" googleServices = "4.4.4" gson = "2.13.2" -hiltAndroid = "2.58" +hiltAndroid = "2.60.1" hiltAndroidx = "1.3.0" integrity = "1.6.0" #noinspection NewerVersionAvailable diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 980502d16..61285a659 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 37f853b1c..37f78a6af 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index faf93008b..adff685a0 100755 --- a/gradlew +++ b/gradlew @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright © 2015-2021 the original authors. +# Copyright © 2015 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -114,7 +114,6 @@ case "$( uname )" in #( NONSTOP* ) nonstop=true ;; esac -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. @@ -172,7 +171,6 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) JAVACMD=$( cygpath --unix "$JAVACMD" ) @@ -212,8 +210,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ "$@" # Stop when "xargs" is not available. diff --git a/gradlew.bat b/gradlew.bat index 9b42019c7..e509b2dd8 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -70,11 +70,10 @@ goto fail :execute @rem Setup the command line -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* :end @rem End local scope for the variables with windows NT shell