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/Auth/build.gradle.kts b/Auth/build.gradle.kts index 308fa1e22..dd82b6076 100644 --- a/Auth/build.gradle.kts +++ b/Auth/build.gradle.kts @@ -19,7 +19,7 @@ plugins { alias(core.plugins.infomaniak.android.library.flavor.aware) alias(core.plugins.compose.compiler) - kotlin("plugin.parcelize") + alias(core.plugins.kotlin.parcelize) alias(core.plugins.ksp) alias(core.plugins.kotlin.serialization) } 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/Common/build.gradle.kts b/Common/build.gradle.kts index c659080bb..4a0099e72 100644 --- a/Common/build.gradle.kts +++ b/Common/build.gradle.kts @@ -44,7 +44,7 @@ dependencies { implementation(core.androidx.lifecycle.process) implementation(core.kotlinx.datetime) - testImplementation(kotlin("test")) + testImplementation(kotlin("test-junit")) testImplementation(core.kotest.assertions) testImplementation(core.kotlinx.coroutines.test) testImplementation(core.androidx.junit) diff --git a/CrossAppLogin/Front/build.gradle.kts b/CrossAppLogin/Front/build.gradle.kts index f830a2003..fcfdae708 100644 --- a/CrossAppLogin/Front/build.gradle.kts +++ b/CrossAppLogin/Front/build.gradle.kts @@ -19,7 +19,7 @@ plugins { alias(core.plugins.infomaniak.android.library.flavor.aware) alias(core.plugins.compose.compiler) - kotlin("plugin.parcelize") + alias(core.plugins.kotlin.parcelize) alias(core.plugins.navigation.safeargs) alias(core.plugins.kotlin.serialization) } diff --git a/KSuite/KSuitePro/build.gradle.kts b/KSuite/KSuitePro/build.gradle.kts index 6148e8ddb..3db76b3ff 100644 --- a/KSuite/KSuitePro/build.gradle.kts +++ b/KSuite/KSuitePro/build.gradle.kts @@ -19,7 +19,7 @@ plugins { alias(core.plugins.infomaniak.android.library.flavor.aware) alias(core.plugins.compose.compiler) - kotlin("plugin.parcelize") + alias(core.plugins.kotlin.parcelize) alias(core.plugins.kotlin.serialization) alias(core.plugins.navigation.safeargs) } diff --git a/KSuite/MyKSuite/build.gradle.kts b/KSuite/MyKSuite/build.gradle.kts index 6df0508d2..c4ecdbdab 100644 --- a/KSuite/MyKSuite/build.gradle.kts +++ b/KSuite/MyKSuite/build.gradle.kts @@ -20,7 +20,7 @@ plugins { alias(core.plugins.infomaniak.android.library.flavor.aware) alias(core.plugins.compose.compiler) alias(core.plugins.ksp) - kotlin("plugin.parcelize") + alias(core.plugins.kotlin.parcelize) alias(core.plugins.kotlin.serialization) alias(core.plugins.navigation.safeargs) } diff --git a/Legacy/Confetti/build.gradle b/Legacy/Confetti/build.gradle index 963d1293c..75713a848 100644 --- a/Legacy/Confetti/build.gradle +++ b/Legacy/Confetti/build.gradle @@ -1,6 +1,5 @@ plugins { id 'com.android.library' - id 'kotlin-android' } def legacyCompileSdk = rootProject.ext["legacyCompileSdk"] @@ -20,8 +19,6 @@ android { targetCompatibility javaVersion } - kotlinOptions { jvmTarget = javaVersion } - dependencies { implementation project(':Core:Legacy') } diff --git a/Legacy/build.gradle b/Legacy/build.gradle index 0d315022e..c92bf42db 100644 --- a/Legacy/build.gradle +++ b/Legacy/build.gradle @@ -1,6 +1,5 @@ plugins { id 'com.android.library' - id 'kotlin-android' id 'kotlin-parcelize' id 'kotlinx-serialization' id 'com.google.devtools.ksp' @@ -8,7 +7,7 @@ plugins { } rootProject.ext { - legacyCompileSdk = 35 + legacyCompileSdk = 37 legacyMinSdk = 27 } @@ -38,8 +37,6 @@ android { viewBinding true buildConfig true } - - kotlinOptions { jvmTarget = javaVersion } } dependencies { diff --git a/Login/build.gradle.kts b/Login/build.gradle.kts index bdfe511b9..5f558562a 100644 --- a/Login/build.gradle.kts +++ b/Login/build.gradle.kts @@ -19,7 +19,7 @@ plugins { alias(core.plugins.infomaniak.android.library) alias(core.plugins.kotlin.serialization) - kotlin("plugin.parcelize") + alias(core.plugins.kotlin.parcelize) } android { diff --git a/Network/Models/build.gradle.kts b/Network/Models/build.gradle.kts index 2f37c12e4..19f1025e0 100644 --- a/Network/Models/build.gradle.kts +++ b/Network/Models/build.gradle.kts @@ -18,7 +18,7 @@ plugins { alias(core.plugins.infomaniak.android.library) - kotlin("plugin.parcelize") + alias(core.plugins.kotlin.parcelize) alias(core.plugins.kotlin.serialization) } diff --git a/Sentry/build.gradle.kts b/Sentry/build.gradle.kts index af33232ec..e506ce73d 100644 --- a/Sentry/build.gradle.kts +++ b/Sentry/build.gradle.kts @@ -31,5 +31,5 @@ dependencies { api(core.sentry.okhttp) implementation(core.sentry.android.fragment) - testImplementation(kotlin("test")) + testImplementation(kotlin("test-junit")) } 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..ea10be705 100644 --- a/build-logic/convention/src/main/kotlin/AndroidLibraryConventionPlugin.kt +++ b/build-logic/convention/src/main/kotlin/AndroidLibraryConventionPlugin.kt @@ -31,17 +31,23 @@ class AndroidLibraryConventionPlugin : Plugin { override fun apply(target: Project): Unit = with(target) { 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/build.gradle.kts b/build.gradle.kts index e126083c3..e355964c1 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -18,9 +18,14 @@ import org.jlleitschuh.gradle.ktlint.reporter.ReporterType +buildscript { + dependencies { + classpath(core.kotlin.gradle.plugin) + } +} + plugins { alias(core.plugins.android.library) apply false - alias(core.plugins.kotlin.android) apply false alias(core.plugins.ktlint) alias(core.plugins.compose.lint) } diff --git a/gradle/core.versions.toml b/gradle/core.versions.toml index 8b14629e0..92a1ff002 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.3.2" 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,18 +25,18 @@ espressoCore = "3.7.0" firebaseMessaging = "24.1.2" googleServices = "4.4.4" gson = "2.13.2" -hiltAndroid = "2.58" -hiltAndroidx = "1.3.0" +hiltAndroid = "2.60.1" +hiltAndroidx = "1.4.0" integrity = "1.6.0" #noinspection NewerVersionAvailable junit = "4.13" # Don't update this because it breaks tests junitAndroidx = "1.3.0" kotest = "6.0.7" kotlinxCollectionsImmutable = "0.4.0" -kotlinxCoroutines = "1.10.2" +kotlinxCoroutines = "1.11.0" kotlinxSerialization = "1.9.0" -kotlin = "2.3.21" -ksp = "2.3.9" +kotlin = "2.4.10" +ksp = "2.3.11" ktlintPlugin = "14.0.1" ktor = "3.5.0" lifecycleRuntimeKtx = "2.10.0" @@ -55,8 +55,8 @@ recyclerView = "1.4.0" #noinspection NewerVersionAvailable robolectric = "4.13" # Don't update this because it breaks tests room = "2.8.4" -sentry = "8.27.1" -sentryPlugin = "5.12.2" +sentry = "8.53.0" +sentryPlugin = "6.19.0" splitties = "3.0.0" swipeRefreshLayout = "1.2.0" workManager = "2.11.0" @@ -194,6 +194,7 @@ ktor-client-encoding = { module = "io.ktor:ktor-client-encoding", version.ref = ktor-client-json = { module = "io.ktor:ktor-serialization-kotlinx-json", version.ref = "ktor" } ktor-client-mock = { module = "io.ktor:ktor-client-mock", version.ref = "ktor" } ktor-client-okhttp = { module = "io.ktor:ktor-client-okhttp", version.ref = "ktor" } +kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" } lottie = { module = "com.airbnb.android:lottie", version.ref = "lottie" } lottie-compose = { module = "com.airbnb.android:lottie-compose", version.ref = "lottie" } dotlottie = { module = "com.github.lottiefiles:dotlottie-android", version.ref = "dotlottie" } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 980502d16..b1b8ef56b 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..ad7845be3 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,7 +1,9 @@ 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.7.1-bin.zip networkTimeout=10000 +retries=0 +retryBackOffMs=500 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index faf93008b..b9bb139f7 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. @@ -57,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -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..aa5f10b06 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -23,8 +23,8 @@ @rem @rem ########################################################################## -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +@rem Set local scope for the variables, and ensure extensions are enabled +setlocal EnableExtensions set DIRNAME=%~dp0 if "%DIRNAME%"=="" set DIRNAME=. @@ -51,7 +51,7 @@ echo. 1>&2 echo Please set the JAVA_HOME variable in your environment to match the 1>&2 echo location of your Java installation. 1>&2 -goto fail +"%COMSPEC%" /c exit 1 :findJavaFromJavaHome set JAVA_HOME=%JAVA_HOME:"=% @@ -65,30 +65,18 @@ echo. 1>&2 echo Please set the JAVA_HOME variable in your environment to match the 1>&2 echo location of your Java installation. 1>&2 -goto fail +"%COMSPEC%" /c exit 1 :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 %* +@rem endlocal doesn't take effect until after the line is parsed and variables are expanded +@rem which allows us to clear the local environment before executing the java command +endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +:exitWithErrorLevel +@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts +"%COMSPEC%" /c exit %ERRORLEVEL%