From 0b309293f4107416f5581b5fa7c48e3fb1d7ccea Mon Sep 17 00:00:00 2001 From: Manel Martos Date: Mon, 22 Jan 2024 10:09:47 +0100 Subject: [PATCH 01/12] Upgrade Kotlin + Compose Plugin + fix iOS configs --- demos/appyx-interactions/ios/build.gradle.kts | 7 ------- demos/appyx-interactions/ios/ios.podspec | 11 +++++++++++ .../iosApp/Configuration/Config.xcconfig | 4 ++-- demos/appyx-navigation/ios/build.gradle.kts | 7 ------- demos/appyx-navigation/ios/ios.podspec | 11 +++++++++++ .../iosApp/Configuration/Config.xcconfig | 4 ++-- demos/sandbox-appyx-navigation/ios/build.gradle.kts | 7 ------- demos/sandbox-appyx-navigation/ios/ios.podspec | 11 +++++++++++ .../iosApp/Configuration/Config.xcconfig | 4 ++-- gradle/libs.versions.toml | 6 +++--- 10 files changed, 42 insertions(+), 30 deletions(-) diff --git a/demos/appyx-interactions/ios/build.gradle.kts b/demos/appyx-interactions/ios/build.gradle.kts index 875ec295d..613555cb8 100644 --- a/demos/appyx-interactions/ios/build.gradle.kts +++ b/demos/appyx-interactions/ios/build.gradle.kts @@ -46,13 +46,6 @@ kotlin { } } -compose.experimental { - uikit.application { - projectName = "Appyx" - bundleIdPrefix = "com.bumble.appyx" - } -} - dependencies { add("kspIosArm64", project(":ksp:appyx-processor")) add("kspIosX64", project(":ksp:appyx-processor")) diff --git a/demos/appyx-interactions/ios/ios.podspec b/demos/appyx-interactions/ios/ios.podspec index 2e9af6c20..fd91cb885 100644 --- a/demos/appyx-interactions/ios/ios.podspec +++ b/demos/appyx-interactions/ios/ios.podspec @@ -11,6 +11,17 @@ Pod::Spec.new do |spec| spec.ios.deployment_target = '16.4' + if !Dir.exist?('build/cocoapods/framework/ios.framework') || Dir.empty?('build/cocoapods/framework/ios.framework') + raise " + + Kotlin framework 'ios' doesn't exist yet, so a proper Xcode project can't be generated. + 'pod install' should be executed after running ':generateDummyFramework' Gradle task: + + ./gradlew :demos:appyx-interactions:ios:generateDummyFramework + + Alternatively, proper pod installation is performed during Gradle sync in the IDE (if Podfile location is set)" + end + spec.pod_target_xcconfig = { 'KOTLIN_PROJECT_PATH' => ':demos:appyx-interactions:ios', 'PRODUCT_MODULE_NAME' => 'ios', diff --git a/demos/appyx-interactions/iosApp/Configuration/Config.xcconfig b/demos/appyx-interactions/iosApp/Configuration/Config.xcconfig index 59e262bd6..27d0274ee 100644 --- a/demos/appyx-interactions/iosApp/Configuration/Config.xcconfig +++ b/demos/appyx-interactions/iosApp/Configuration/Config.xcconfig @@ -1,3 +1,3 @@ TEAM_ID= -BUNDLE_ID=com.bumble.appyx.Appyx -APP_NAME=Appyx +BUNDLE_ID=com.bumble.appyx.interactions +APP_NAME=Appyx Interactions diff --git a/demos/appyx-navigation/ios/build.gradle.kts b/demos/appyx-navigation/ios/build.gradle.kts index 63d859c17..09b3f3212 100644 --- a/demos/appyx-navigation/ios/build.gradle.kts +++ b/demos/appyx-navigation/ios/build.gradle.kts @@ -45,13 +45,6 @@ kotlin { } } -compose.experimental { - uikit.application { - projectName = "Appyx" - bundleIdPrefix = "com.bumble.appyx" - } -} - tasks.register("copyResources") { // Dirs containing files we want to copy from("../common/src/commonMain/resources") diff --git a/demos/appyx-navigation/ios/ios.podspec b/demos/appyx-navigation/ios/ios.podspec index 34ceebefc..e4571c19a 100644 --- a/demos/appyx-navigation/ios/ios.podspec +++ b/demos/appyx-navigation/ios/ios.podspec @@ -11,6 +11,17 @@ Pod::Spec.new do |spec| spec.ios.deployment_target = '17.0' + if !Dir.exist?('build/cocoapods/framework/ios.framework') || Dir.empty?('build/cocoapods/framework/ios.framework') + raise " + + Kotlin framework 'ios' doesn't exist yet, so a proper Xcode project can't be generated. + 'pod install' should be executed after running ':generateDummyFramework' Gradle task: + + ./gradlew :demos:appyx-navigation:ios:generateDummyFramework + + Alternatively, proper pod installation is performed during Gradle sync in the IDE (if Podfile location is set)" + end + spec.pod_target_xcconfig = { 'KOTLIN_PROJECT_PATH' => ':demos:appyx-navigation:ios', 'PRODUCT_MODULE_NAME' => 'ios', diff --git a/demos/appyx-navigation/iosApp/Configuration/Config.xcconfig b/demos/appyx-navigation/iosApp/Configuration/Config.xcconfig index 59e262bd6..1b0573c0f 100644 --- a/demos/appyx-navigation/iosApp/Configuration/Config.xcconfig +++ b/demos/appyx-navigation/iosApp/Configuration/Config.xcconfig @@ -1,3 +1,3 @@ TEAM_ID= -BUNDLE_ID=com.bumble.appyx.Appyx -APP_NAME=Appyx +BUNDLE_ID=com.bumble.appyx.navigation +APP_NAME=Appyx Navigation diff --git a/demos/sandbox-appyx-navigation/ios/build.gradle.kts b/demos/sandbox-appyx-navigation/ios/build.gradle.kts index 5d55d2fdf..5541981b3 100644 --- a/demos/sandbox-appyx-navigation/ios/build.gradle.kts +++ b/demos/sandbox-appyx-navigation/ios/build.gradle.kts @@ -43,13 +43,6 @@ kotlin { } } -compose.experimental { - uikit.application { - projectName = "Appyx" - bundleIdPrefix = "com.bumble.appyx" - } -} - dependencies { add("kspIosArm64", project(":ksp:appyx-processor")) add("kspIosX64", project(":ksp:appyx-processor")) diff --git a/demos/sandbox-appyx-navigation/ios/ios.podspec b/demos/sandbox-appyx-navigation/ios/ios.podspec index db2b79a74..b9fa1fe72 100644 --- a/demos/sandbox-appyx-navigation/ios/ios.podspec +++ b/demos/sandbox-appyx-navigation/ios/ios.podspec @@ -11,6 +11,17 @@ Pod::Spec.new do |spec| spec.ios.deployment_target = '16.4' + if !Dir.exist?('build/cocoapods/framework/ios.framework') || Dir.empty?('build/cocoapods/framework/ios.framework') + raise " + + Kotlin framework 'ios' doesn't exist yet, so a proper Xcode project can't be generated. + 'pod install' should be executed after running ':generateDummyFramework' Gradle task: + + ./gradlew :demos:sandbox-appyx-navigation:ios:generateDummyFramework + + Alternatively, proper pod installation is performed during Gradle sync in the IDE (if Podfile location is set)" + end + spec.pod_target_xcconfig = { 'KOTLIN_PROJECT_PATH' => ':demos:sandbox-appyx-navigation:ios', 'PRODUCT_MODULE_NAME' => 'ios', diff --git a/demos/sandbox-appyx-navigation/iosApp/Configuration/Config.xcconfig b/demos/sandbox-appyx-navigation/iosApp/Configuration/Config.xcconfig index 59e262bd6..6c0a4f609 100644 --- a/demos/sandbox-appyx-navigation/iosApp/Configuration/Config.xcconfig +++ b/demos/sandbox-appyx-navigation/iosApp/Configuration/Config.xcconfig @@ -1,3 +1,3 @@ TEAM_ID= -BUNDLE_ID=com.bumble.appyx.Appyx -APP_NAME=Appyx +BUNDLE_ID=com.bumble.appyx.sandbox +APP_NAME=Appyx Sandbox diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 460b6b22d..c56ff61ed 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -9,7 +9,7 @@ androidTargetSdk = "32" androidx-lifecycle = "2.6.1" androidx-navigation-compose = "2.5.1" coil = "2.2.1" -composePlugin = "1.5.3" +composePlugin = "1.5.10" composeBom = "2023.10.01" composeCompiler = "1.5.3" coroutines = "1.6.4" @@ -17,8 +17,8 @@ dependencyAnalysis = "1.13.1" detekt = "1.21.0" junit5 = "5.8.2" jvmTarget = "11" -kotlin = "1.9.10" -ksp = "1.9.10-1.0.13" +kotlin = "1.9.20" +ksp = "1.9.20-1.0.14" mvicore = "1.2.6" ribs = "0.39.0" serialization-json = "1.5.0" From 82d7803c081d82c24cca7f5dc887875717698cb2 Mon Sep 17 00:00:00 2001 From: Manel Martos Date: Mon, 22 Jan 2024 13:09:19 +0100 Subject: [PATCH 02/12] Upgrade Compose compiler --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index c56ff61ed..12156b7a3 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -11,7 +11,7 @@ androidx-navigation-compose = "2.5.1" coil = "2.2.1" composePlugin = "1.5.10" composeBom = "2023.10.01" -composeCompiler = "1.5.3" +composeCompiler = "1.5.5" coroutines = "1.6.4" dependencyAnalysis = "1.13.1" detekt = "1.21.0" From edb552f7f7515803ece6ce590b47354baae3a9d5 Mon Sep 17 00:00:00 2001 From: Manel Martos Date: Mon, 22 Jan 2024 13:41:25 +0100 Subject: [PATCH 03/12] Fix issue with dependency declaration --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 12156b7a3..795c1bc06 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -55,7 +55,7 @@ compose-material3 = { module = "androidx.compose.material3:material3" } compose-material-icons-extended = { module = "androidx.compose.material:material-icons-extended" } compose-runtime = { module = "androidx.compose.runtime:runtime" } compose-ui-test-junit4 = { module = "androidx.compose.ui:ui-test-junit4" } -compose-ui-test-junit4-android = { group = "androidx.compose.ui", name = "ui-test-junit4-android", version.ref = "composeCompiler" } +compose-ui-test-junit4-android = { module = "androidx.compose.ui:ui-test-junit4-android" } compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling" } compose-ui-ui = { module = "androidx.compose.ui:ui" } compose-ui-test-manifest = { module = "androidx.compose.ui:ui-test-manifest" } From 62052761c238c71866efa2f94c23092852004f17 Mon Sep 17 00:00:00 2001 From: Manel Martos Date: Mon, 22 Jan 2024 14:39:36 +0100 Subject: [PATCH 04/12] Upgrade to Kotlin 1.9.21 as KSP has some flows on prev version --- gradle/libs.versions.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 795c1bc06..6d0f2fc42 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -9,16 +9,16 @@ androidTargetSdk = "32" androidx-lifecycle = "2.6.1" androidx-navigation-compose = "2.5.1" coil = "2.2.1" -composePlugin = "1.5.10" +composePlugin = "1.5.11" composeBom = "2023.10.01" -composeCompiler = "1.5.5" +composeCompiler = "1.5.7" coroutines = "1.6.4" dependencyAnalysis = "1.13.1" detekt = "1.21.0" junit5 = "5.8.2" jvmTarget = "11" -kotlin = "1.9.20" -ksp = "1.9.20-1.0.14" +kotlin = "1.9.21" +ksp = "1.9.21-1.0.16" mvicore = "1.2.6" ribs = "0.39.0" serialization-json = "1.5.0" From cd12314acd06120a809f014327f4326b288078e6 Mon Sep 17 00:00:00 2001 From: Manel Martos Date: Mon, 22 Jan 2024 16:21:44 +0100 Subject: [PATCH 05/12] Add more exceptions into dependency-analysis --- appyx-navigation/android/build.gradle.kts | 4 +--- build.gradle.kts | 3 +++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/appyx-navigation/android/build.gradle.kts b/appyx-navigation/android/build.gradle.kts index 0d9d5d5e8..8975c0f95 100644 --- a/appyx-navigation/android/build.gradle.kts +++ b/appyx-navigation/android/build.gradle.kts @@ -15,9 +15,7 @@ appyx { dependencies { val composeBom = platform(libs.compose.bom) - api(composeBom) api(libs.kotlin.coroutines.android) - api(libs.compose.ui.tooling) implementation(composeBom) @@ -26,7 +24,7 @@ dependencies { androidTestImplementation(composeBom) androidTestImplementation(libs.androidx.test.espresso.core) androidTestImplementation(libs.androidx.test.junit) - androidTestImplementation(libs.compose.ui.test.junit4) androidTestImplementation(libs.compose.foundation) + androidTestImplementation(libs.compose.ui.test.junit4) androidTestImplementation(project(":utils:testing-ui")) } diff --git a/build.gradle.kts b/build.gradle.kts index c28ec7ce5..3399f2712 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -48,6 +48,9 @@ dependencyAnalysis { // This is used in:demos:appyx-interactions:android. But raised as unused. "androidx.compose.material:material-icons-extended", + + // Should be ignored as it's raised in many modules as unused. + "org.jetbrains.kotlin:kotlin-stdlib", ) } } From eeef2f03ceeda8966d77705c7c54888437f4b91f Mon Sep 17 00:00:00 2001 From: Manel Martos Date: Mon, 22 Jan 2024 16:21:44 +0100 Subject: [PATCH 06/12] Add more exceptions into dependency-analysis --- appyx-navigation/android/build.gradle.kts | 4 +--- build.gradle.kts | 7 +++++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/appyx-navigation/android/build.gradle.kts b/appyx-navigation/android/build.gradle.kts index 0d9d5d5e8..8975c0f95 100644 --- a/appyx-navigation/android/build.gradle.kts +++ b/appyx-navigation/android/build.gradle.kts @@ -15,9 +15,7 @@ appyx { dependencies { val composeBom = platform(libs.compose.bom) - api(composeBom) api(libs.kotlin.coroutines.android) - api(libs.compose.ui.tooling) implementation(composeBom) @@ -26,7 +24,7 @@ dependencies { androidTestImplementation(composeBom) androidTestImplementation(libs.androidx.test.espresso.core) androidTestImplementation(libs.androidx.test.junit) - androidTestImplementation(libs.compose.ui.test.junit4) androidTestImplementation(libs.compose.foundation) + androidTestImplementation(libs.compose.ui.test.junit4) androidTestImplementation(project(":utils:testing-ui")) } diff --git a/build.gradle.kts b/build.gradle.kts index c28ec7ce5..7117916d3 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -30,6 +30,10 @@ dependencyAnalysis { all { onIncorrectConfiguration { severity("fail") + exclude( + // Should be ignored as it's raised in many modules as misconfigured. + "org.jetbrains.kotlin:kotlin-stdlib", + ) } onUnusedDependencies { severity("fail") @@ -48,6 +52,9 @@ dependencyAnalysis { // This is used in:demos:appyx-interactions:android. But raised as unused. "androidx.compose.material:material-icons-extended", + + // Should be ignored as it's raised in many modules as unused. + "org.jetbrains.kotlin:kotlin-stdlib", ) } } From 970ca68f4a7cff4acc8cca34a239668d77137bf4 Mon Sep 17 00:00:00 2001 From: Manel Martos Date: Mon, 22 Jan 2024 18:04:12 +0100 Subject: [PATCH 07/12] Upgrade gradle version --- gradle/libs.versions.toml | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 6d0f2fc42..296d8f951 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,7 +2,7 @@ [versions] accompanist = "0.28.0" -agp = "8.1.2" +agp = "8.1.4" androidCompileSdk = "34" androidMinSdk = "21" androidTargetSdk = "32" diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 37aef8d3f..3499ded5c 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.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From b765510d89e92326047ff6e42a69b0f4e153b20f Mon Sep 17 00:00:00 2001 From: Manel Martos Date: Mon, 22 Jan 2024 21:44:44 +0100 Subject: [PATCH 08/12] Stop using dependency-analysis plugin as it is incompatible with latest gradle version --- build.gradle.kts | 100 +++++++++--------- demos/image-loader/common/build.gradle.kts | 2 +- .../common/build.gradle.kts | 2 +- gradle.properties | 1 + gradle/libs.versions.toml | 2 +- 5 files changed, 54 insertions(+), 53 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 7117916d3..a9af7a578 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -19,61 +19,61 @@ plugins { id("appyx-collect-sarif") id("com.android.application") version libs.versions.agp.get() apply false id("com.google.devtools.ksp") version libs.versions.ksp.get() apply false - id("com.autonomousapps.dependency-analysis") version libs.versions.dependencyAnalysis.get() +// id("com.autonomousapps.dependency-analysis") version libs.versions.dependencyAnalysis.get() id("org.jetbrains.compose") version libs.versions.composePlugin.get() apply false id("org.jetbrains.kotlin.android") version libs.versions.kotlin.get() apply false id("com.android.test") version libs.versions.agp.get() apply false } -dependencyAnalysis { - issues { - all { - onIncorrectConfiguration { - severity("fail") - exclude( - // Should be ignored as it's raised in many modules as misconfigured. - "org.jetbrains.kotlin:kotlin-stdlib", - ) - } - onUnusedDependencies { - severity("fail") - - exclude( - // Needed for compose '@Preview'. The annotation is actually within - // androidx.compose.ui:ui-tooling-preview, hence the need to exclude. - "androidx.compose.ui:ui-tooling", - - // This is used to add the testing activity to the debug manifest - // However since not code is referenced, it is raised as unused. - ":utils:testing-ui-activity", - - // Convenience for convention plugins to avoid needing to define this. - "org.junit.jupiter:junit-jupiter-api", - - // This is used in:demos:appyx-interactions:android. But raised as unused. - "androidx.compose.material:material-icons-extended", - - // Should be ignored as it's raised in many modules as unused. - "org.jetbrains.kotlin:kotlin-stdlib", - ) - } - } - project(":utils:testing-junit4") { - onUnusedDependencies { - severity("fail") - // Not used by the module, but exposed via api to avoid adding two dependencies. - exclude(":utils:testing-unit-common") - } - } - project(":utils:testing-junit5") { - onUnusedDependencies { - severity("fail") - // Not used by the module, but exposed via api to avoid adding two dependencies. - exclude(":utils:testing-unit-common") - } - } - } -} +//dependencyAnalysis { +// issues { +// all { +// onIncorrectConfiguration { +// severity("fail") +// exclude( +// // Should be ignored as it's raised in many modules as misconfigured. +// "org.jetbrains.kotlin:kotlin-stdlib", +// ) +// } +// onUnusedDependencies { +// severity("fail") +// +// exclude( +// // Needed for compose '@Preview'. The annotation is actually within +// // androidx.compose.ui:ui-tooling-preview, hence the need to exclude. +// "androidx.compose.ui:ui-tooling", +// +// // This is used to add the testing activity to the debug manifest +// // However since not code is referenced, it is raised as unused. +// ":utils:testing-ui-activity", +// +// // Convenience for convention plugins to avoid needing to define this. +// "org.junit.jupiter:junit-jupiter-api", +// +// // This is used in:demos:appyx-interactions:android. But raised as unused. +// "androidx.compose.material:material-icons-extended", +// +// // Should be ignored as it's raised in many modules as unused. +// "org.jetbrains.kotlin:kotlin-stdlib", +// ) +// } +// } +// project(":utils:testing-junit4") { +// onUnusedDependencies { +// severity("fail") +// // Not used by the module, but exposed via api to avoid adding two dependencies. +// exclude(":utils:testing-unit-common") +// } +// } +// project(":utils:testing-junit5") { +// onUnusedDependencies { +// severity("fail") +// // Not used by the module, but exposed via api to avoid adding two dependencies. +// exclude(":utils:testing-unit-common") +// } +// } +// } +//} allprojects { configurations.all { diff --git a/demos/image-loader/common/build.gradle.kts b/demos/image-loader/common/build.gradle.kts index cba41bc5e..b8d70eb27 100644 --- a/demos/image-loader/common/build.gradle.kts +++ b/demos/image-loader/common/build.gradle.kts @@ -9,7 +9,7 @@ appyx { } kotlin { - android { + androidTarget { publishLibraryVariants("release") } jvm("desktop") { diff --git a/demos/sandbox-appyx-navigation/common/build.gradle.kts b/demos/sandbox-appyx-navigation/common/build.gradle.kts index 63c711a52..ee8764d5f 100644 --- a/demos/sandbox-appyx-navigation/common/build.gradle.kts +++ b/demos/sandbox-appyx-navigation/common/build.gradle.kts @@ -11,7 +11,7 @@ appyx { } kotlin { - android { + androidTarget { publishLibraryVariants("release") } jvm("desktop") { diff --git a/gradle.properties b/gradle.properties index 3310eab5e..684ec4a74 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,6 +4,7 @@ android.nonTransitiveRClass=false android.useAndroidX=true kotlin.code.style=official kotlin.mpp.androidSourceSetLayoutVersion1.nowarn=true +kotlin.mpp.applyDefaultHierarchyTemplate=false kotlin.mpp.stability.nowarn=true kotlin.mpp.enableCInteropCommonization=true library.version=2.0.0-alpha09 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 296d8f951..69a4aa8ea 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,7 +2,7 @@ [versions] accompanist = "0.28.0" -agp = "8.1.4" +agp = "8.2.1" androidCompileSdk = "34" androidMinSdk = "21" androidTargetSdk = "32" From 88ef697d7f32191a7c15cc9898735e44dbc57092 Mon Sep 17 00:00:00 2001 From: Manel Martos Date: Mon, 22 Jan 2024 21:47:38 +0100 Subject: [PATCH 09/12] Upgrade dependency-analysis to latest version --- build.gradle.kts | 100 +++++++++++++++++++------------------- gradle/libs.versions.toml | 2 +- 2 files changed, 51 insertions(+), 51 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index a9af7a578..7117916d3 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -19,61 +19,61 @@ plugins { id("appyx-collect-sarif") id("com.android.application") version libs.versions.agp.get() apply false id("com.google.devtools.ksp") version libs.versions.ksp.get() apply false -// id("com.autonomousapps.dependency-analysis") version libs.versions.dependencyAnalysis.get() + id("com.autonomousapps.dependency-analysis") version libs.versions.dependencyAnalysis.get() id("org.jetbrains.compose") version libs.versions.composePlugin.get() apply false id("org.jetbrains.kotlin.android") version libs.versions.kotlin.get() apply false id("com.android.test") version libs.versions.agp.get() apply false } -//dependencyAnalysis { -// issues { -// all { -// onIncorrectConfiguration { -// severity("fail") -// exclude( -// // Should be ignored as it's raised in many modules as misconfigured. -// "org.jetbrains.kotlin:kotlin-stdlib", -// ) -// } -// onUnusedDependencies { -// severity("fail") -// -// exclude( -// // Needed for compose '@Preview'. The annotation is actually within -// // androidx.compose.ui:ui-tooling-preview, hence the need to exclude. -// "androidx.compose.ui:ui-tooling", -// -// // This is used to add the testing activity to the debug manifest -// // However since not code is referenced, it is raised as unused. -// ":utils:testing-ui-activity", -// -// // Convenience for convention plugins to avoid needing to define this. -// "org.junit.jupiter:junit-jupiter-api", -// -// // This is used in:demos:appyx-interactions:android. But raised as unused. -// "androidx.compose.material:material-icons-extended", -// -// // Should be ignored as it's raised in many modules as unused. -// "org.jetbrains.kotlin:kotlin-stdlib", -// ) -// } -// } -// project(":utils:testing-junit4") { -// onUnusedDependencies { -// severity("fail") -// // Not used by the module, but exposed via api to avoid adding two dependencies. -// exclude(":utils:testing-unit-common") -// } -// } -// project(":utils:testing-junit5") { -// onUnusedDependencies { -// severity("fail") -// // Not used by the module, but exposed via api to avoid adding two dependencies. -// exclude(":utils:testing-unit-common") -// } -// } -// } -//} +dependencyAnalysis { + issues { + all { + onIncorrectConfiguration { + severity("fail") + exclude( + // Should be ignored as it's raised in many modules as misconfigured. + "org.jetbrains.kotlin:kotlin-stdlib", + ) + } + onUnusedDependencies { + severity("fail") + + exclude( + // Needed for compose '@Preview'. The annotation is actually within + // androidx.compose.ui:ui-tooling-preview, hence the need to exclude. + "androidx.compose.ui:ui-tooling", + + // This is used to add the testing activity to the debug manifest + // However since not code is referenced, it is raised as unused. + ":utils:testing-ui-activity", + + // Convenience for convention plugins to avoid needing to define this. + "org.junit.jupiter:junit-jupiter-api", + + // This is used in:demos:appyx-interactions:android. But raised as unused. + "androidx.compose.material:material-icons-extended", + + // Should be ignored as it's raised in many modules as unused. + "org.jetbrains.kotlin:kotlin-stdlib", + ) + } + } + project(":utils:testing-junit4") { + onUnusedDependencies { + severity("fail") + // Not used by the module, but exposed via api to avoid adding two dependencies. + exclude(":utils:testing-unit-common") + } + } + project(":utils:testing-junit5") { + onUnusedDependencies { + severity("fail") + // Not used by the module, but exposed via api to avoid adding two dependencies. + exclude(":utils:testing-unit-common") + } + } + } +} allprojects { configurations.all { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 69a4aa8ea..ed1da2a99 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -13,7 +13,7 @@ composePlugin = "1.5.11" composeBom = "2023.10.01" composeCompiler = "1.5.7" coroutines = "1.6.4" -dependencyAnalysis = "1.13.1" +dependencyAnalysis = "1.29.0" detekt = "1.21.0" junit5 = "5.8.2" jvmTarget = "11" From 4d3b280184f37fcc15a52daca0039669baa67184 Mon Sep 17 00:00:00 2001 From: Manel Martos Date: Mon, 22 Jan 2024 22:48:59 +0100 Subject: [PATCH 10/12] Remove unused dependencies --- appyx-components/experimental/cards/android/build.gradle.kts | 1 - .../experimental/promoter/android/build.gradle.kts | 1 - appyx-navigation/android/build.gradle.kts | 3 --- appyx-navigation/common/build.gradle.kts | 5 ----- demos/navigation-compose/build.gradle.kts | 1 - utils/interop-ribs/build.gradle.kts | 1 - 6 files changed, 12 deletions(-) diff --git a/appyx-components/experimental/cards/android/build.gradle.kts b/appyx-components/experimental/cards/android/build.gradle.kts index 492c1b4b3..9308110ae 100644 --- a/appyx-components/experimental/cards/android/build.gradle.kts +++ b/appyx-components/experimental/cards/android/build.gradle.kts @@ -17,7 +17,6 @@ dependencies { implementation(project(":appyx-components:experimental:cards:cards")) implementation(composeBom) - androidTestImplementation(libs.compose.ui.test.junit4) androidTestImplementation(libs.junit.api) androidTestImplementation(libs.compose.ui.test.manifest) } diff --git a/appyx-components/experimental/promoter/android/build.gradle.kts b/appyx-components/experimental/promoter/android/build.gradle.kts index 5815e1091..3913e8c87 100644 --- a/appyx-components/experimental/promoter/android/build.gradle.kts +++ b/appyx-components/experimental/promoter/android/build.gradle.kts @@ -16,7 +16,6 @@ dependencies { implementation(project(":appyx-components:experimental:promoter:promoter")) implementation(composeBom) - androidTestImplementation(libs.compose.ui.test.junit4) androidTestImplementation(libs.junit.api) androidTestImplementation(libs.compose.ui.test.manifest) } diff --git a/appyx-navigation/android/build.gradle.kts b/appyx-navigation/android/build.gradle.kts index 8975c0f95..fc49d47a9 100644 --- a/appyx-navigation/android/build.gradle.kts +++ b/appyx-navigation/android/build.gradle.kts @@ -22,9 +22,6 @@ dependencies { implementation(libs.androidx.lifecycle.java8) androidTestImplementation(composeBom) - androidTestImplementation(libs.androidx.test.espresso.core) - androidTestImplementation(libs.androidx.test.junit) androidTestImplementation(libs.compose.foundation) androidTestImplementation(libs.compose.ui.test.junit4) - androidTestImplementation(project(":utils:testing-ui")) } diff --git a/appyx-navigation/common/build.gradle.kts b/appyx-navigation/common/build.gradle.kts index 11c5fadb6..214bb5356 100644 --- a/appyx-navigation/common/build.gradle.kts +++ b/appyx-navigation/common/build.gradle.kts @@ -92,10 +92,5 @@ android { api(composeBom) androidTestImplementation(composeBom) - androidTestImplementation(libs.androidx.test.espresso.core) - androidTestImplementation(libs.androidx.test.junit) - androidTestImplementation(libs.compose.ui.test.junit4) - androidTestImplementation(libs.compose.foundation) - androidTestImplementation(project(":utils:testing-ui")) } } diff --git a/demos/navigation-compose/build.gradle.kts b/demos/navigation-compose/build.gradle.kts index e74b6aa13..35eea2dc5 100644 --- a/demos/navigation-compose/build.gradle.kts +++ b/demos/navigation-compose/build.gradle.kts @@ -24,7 +24,6 @@ dependencies { androidTestImplementation(composeBom) androidTestImplementation(project(":utils:testing-ui-activity")) - androidTestImplementation(libs.androidx.test.espresso.core) androidTestImplementation(libs.androidx.test.junit) androidTestImplementation(libs.compose.ui.test.junit4) } diff --git a/utils/interop-ribs/build.gradle.kts b/utils/interop-ribs/build.gradle.kts index 0a31cfddc..9697b4a74 100644 --- a/utils/interop-ribs/build.gradle.kts +++ b/utils/interop-ribs/build.gradle.kts @@ -29,7 +29,6 @@ dependencies { implementation(libs.androidx.activity.compose) androidTestImplementation(composeBom) - androidTestImplementation(libs.androidx.activity.compose) androidTestImplementation(libs.androidx.test.espresso.core) androidTestImplementation(libs.androidx.test.junit) androidTestImplementation(libs.compose.foundation.layout) From 517016299425bc86af9411eb119742db95c9ff03 Mon Sep 17 00:00:00 2001 From: Manel Martos Date: Mon, 22 Jan 2024 23:08:33 +0100 Subject: [PATCH 11/12] Fix all dependecy-analysis issues --- .../cards/android/build.gradle.kts | 1 + .../promoter/android/build.gradle.kts | 1 + appyx-navigation/android/build.gradle.kts | 3 + appyx-navigation/common/build.gradle.kts | 5 ++ build.gradle.kts | 67 ++++++++++++++++++- demos/navigation-compose/build.gradle.kts | 6 +- utils/interop-ribs/build.gradle.kts | 1 + 7 files changed, 79 insertions(+), 5 deletions(-) diff --git a/appyx-components/experimental/cards/android/build.gradle.kts b/appyx-components/experimental/cards/android/build.gradle.kts index 9308110ae..492c1b4b3 100644 --- a/appyx-components/experimental/cards/android/build.gradle.kts +++ b/appyx-components/experimental/cards/android/build.gradle.kts @@ -17,6 +17,7 @@ dependencies { implementation(project(":appyx-components:experimental:cards:cards")) implementation(composeBom) + androidTestImplementation(libs.compose.ui.test.junit4) androidTestImplementation(libs.junit.api) androidTestImplementation(libs.compose.ui.test.manifest) } diff --git a/appyx-components/experimental/promoter/android/build.gradle.kts b/appyx-components/experimental/promoter/android/build.gradle.kts index 3913e8c87..5815e1091 100644 --- a/appyx-components/experimental/promoter/android/build.gradle.kts +++ b/appyx-components/experimental/promoter/android/build.gradle.kts @@ -16,6 +16,7 @@ dependencies { implementation(project(":appyx-components:experimental:promoter:promoter")) implementation(composeBom) + androidTestImplementation(libs.compose.ui.test.junit4) androidTestImplementation(libs.junit.api) androidTestImplementation(libs.compose.ui.test.manifest) } diff --git a/appyx-navigation/android/build.gradle.kts b/appyx-navigation/android/build.gradle.kts index fc49d47a9..8975c0f95 100644 --- a/appyx-navigation/android/build.gradle.kts +++ b/appyx-navigation/android/build.gradle.kts @@ -22,6 +22,9 @@ dependencies { implementation(libs.androidx.lifecycle.java8) androidTestImplementation(composeBom) + androidTestImplementation(libs.androidx.test.espresso.core) + androidTestImplementation(libs.androidx.test.junit) androidTestImplementation(libs.compose.foundation) androidTestImplementation(libs.compose.ui.test.junit4) + androidTestImplementation(project(":utils:testing-ui")) } diff --git a/appyx-navigation/common/build.gradle.kts b/appyx-navigation/common/build.gradle.kts index 214bb5356..11c5fadb6 100644 --- a/appyx-navigation/common/build.gradle.kts +++ b/appyx-navigation/common/build.gradle.kts @@ -92,5 +92,10 @@ android { api(composeBom) androidTestImplementation(composeBom) + androidTestImplementation(libs.androidx.test.espresso.core) + androidTestImplementation(libs.androidx.test.junit) + androidTestImplementation(libs.compose.ui.test.junit4) + androidTestImplementation(libs.compose.foundation) + androidTestImplementation(project(":utils:testing-ui")) } } diff --git a/build.gradle.kts b/build.gradle.kts index 7117916d3..3f076ffcc 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -32,11 +32,13 @@ dependencyAnalysis { severity("fail") exclude( // Should be ignored as it's raised in many modules as misconfigured. - "org.jetbrains.kotlin:kotlin-stdlib", + "androidx.test:runner", + "com.github.badoo.RIBs:rib-base-test-activity", + "org.jetbrains.kotlin:kotlin-stdlib" ) } onUnusedDependencies { - severity("fail") +// severity("fail") exclude( // Needed for compose '@Preview'. The annotation is actually within @@ -58,6 +60,52 @@ dependencyAnalysis { ) } } + project(":appyx-components:experimental:cards:android") { + onUnusedDependencies { + severity("fail") + exclude( + "androidx.compose.ui:ui-test-junit4", + ) + } + } + project(":appyx-components:experimental:promoter:android") { + onUnusedDependencies { + severity("fail") + exclude( + "androidx.compose.ui:ui-test-junit4", + ) + } + } + project(":appyx-navigation:android") { + onUnusedDependencies { + severity("fail") + exclude( + "androidx.test.espresso:espresso-core", + "androidx.test.ext:junit", + ":utils:testing-ui", + ) + } + } + project(":appyx-navigation:appyx-navigation") { + onUnusedDependencies { + severity("fail") + exclude( + "androidx.test.espresso:espresso-core", + "androidx.test.ext:junit", + "androidx.compose.foundation:foundation", + "androidx.compose.ui:ui-test-junit4", + ":utils:testing-ui", + ) + } + } + project(":demos:navigation-compose") { + onUnusedDependencies { + severity("fail") + exclude( + "androidx.test.espresso:espresso-core", + ) + } + } project(":utils:testing-junit4") { onUnusedDependencies { severity("fail") @@ -72,6 +120,21 @@ dependencyAnalysis { exclude(":utils:testing-unit-common") } } + project(":utils:interop-ribs") { + onIncorrectConfiguration { + severity("fail") + exclude( + // Should be ignored as it's raised in many modules as misconfigured. + "com.github.badoo.RIBs:rib-compose", + ) + } + onUnusedDependencies { + severity("fail") + exclude( + "androidx.activity:activity-compose", + ) + } + } } } diff --git a/demos/navigation-compose/build.gradle.kts b/demos/navigation-compose/build.gradle.kts index 35eea2dc5..bdd8b0452 100644 --- a/demos/navigation-compose/build.gradle.kts +++ b/demos/navigation-compose/build.gradle.kts @@ -14,9 +14,8 @@ appyx { dependencies { val composeBom = platform(libs.compose.bom) - api(composeBom) - api(project(":appyx-navigation:appyx-navigation")) - api(project(":appyx-components:stable:backstack:backstack")) + implementation(project(":appyx-navigation:appyx-navigation")) + implementation(project(":appyx-components:stable:backstack:backstack")) implementation(composeBom) implementation(libs.androidx.navigation.compose) @@ -24,6 +23,7 @@ dependencies { androidTestImplementation(composeBom) androidTestImplementation(project(":utils:testing-ui-activity")) + androidTestImplementation(libs.androidx.test.espresso.core) androidTestImplementation(libs.androidx.test.junit) androidTestImplementation(libs.compose.ui.test.junit4) } diff --git a/utils/interop-ribs/build.gradle.kts b/utils/interop-ribs/build.gradle.kts index 9697b4a74..0a31cfddc 100644 --- a/utils/interop-ribs/build.gradle.kts +++ b/utils/interop-ribs/build.gradle.kts @@ -29,6 +29,7 @@ dependencies { implementation(libs.androidx.activity.compose) androidTestImplementation(composeBom) + androidTestImplementation(libs.androidx.activity.compose) androidTestImplementation(libs.androidx.test.espresso.core) androidTestImplementation(libs.androidx.test.junit) androidTestImplementation(libs.compose.foundation.layout) From e190bc622a26a7186d930dfca9de841f4694e182 Mon Sep 17 00:00:00 2001 From: Manel Martos Date: Tue, 23 Jan 2024 09:21:24 +0100 Subject: [PATCH 12/12] Minimise dependecy analysis related changes --- appyx-navigation/common/build.gradle.kts | 1 - build.gradle.kts | 61 ++++-------------------- utils/interop-ribs/build.gradle.kts | 1 - 3 files changed, 9 insertions(+), 54 deletions(-) diff --git a/appyx-navigation/common/build.gradle.kts b/appyx-navigation/common/build.gradle.kts index 11c5fadb6..11c1cc48c 100644 --- a/appyx-navigation/common/build.gradle.kts +++ b/appyx-navigation/common/build.gradle.kts @@ -95,7 +95,6 @@ android { androidTestImplementation(libs.androidx.test.espresso.core) androidTestImplementation(libs.androidx.test.junit) androidTestImplementation(libs.compose.ui.test.junit4) - androidTestImplementation(libs.compose.foundation) androidTestImplementation(project(":utils:testing-ui")) } } diff --git a/build.gradle.kts b/build.gradle.kts index 3f076ffcc..2703ef78c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -30,15 +30,14 @@ dependencyAnalysis { all { onIncorrectConfiguration { severity("fail") + exclude( - // Should be ignored as it's raised in many modules as misconfigured. - "androidx.test:runner", - "com.github.badoo.RIBs:rib-base-test-activity", + // Should be ignored as it's raised in many modules due to misconfiguration. "org.jetbrains.kotlin:kotlin-stdlib" ) } onUnusedDependencies { -// severity("fail") + severity("fail") exclude( // Needed for compose '@Preview'. The annotation is actually within @@ -52,57 +51,14 @@ dependencyAnalysis { // Convenience for convention plugins to avoid needing to define this. "org.junit.jupiter:junit-jupiter-api", - // This is used in:demos:appyx-interactions:android. But raised as unused. - "androidx.compose.material:material-icons-extended", - - // Should be ignored as it's raised in many modules as unused. - "org.jetbrains.kotlin:kotlin-stdlib", - ) - } - } - project(":appyx-components:experimental:cards:android") { - onUnusedDependencies { - severity("fail") - exclude( + // Some modules declare these dependencies but have not used them yet. "androidx.compose.ui:ui-test-junit4", - ) - } - } - project(":appyx-components:experimental:promoter:android") { - onUnusedDependencies { - severity("fail") - exclude( - "androidx.compose.ui:ui-test-junit4", - ) - } - } - project(":appyx-navigation:android") { - onUnusedDependencies { - severity("fail") - exclude( - "androidx.test.espresso:espresso-core", - "androidx.test.ext:junit", - ":utils:testing-ui", - ) - } - } - project(":appyx-navigation:appyx-navigation") { - onUnusedDependencies { - severity("fail") - exclude( "androidx.test.espresso:espresso-core", "androidx.test.ext:junit", - "androidx.compose.foundation:foundation", - "androidx.compose.ui:ui-test-junit4", ":utils:testing-ui", - ) - } - } - project(":demos:navigation-compose") { - onUnusedDependencies { - severity("fail") - exclude( - "androidx.test.espresso:espresso-core", + + // This is used in:demos:appyx-interactions:android. But raised as unused. + "androidx.compose.material:material-icons-extended", ) } } @@ -124,7 +80,8 @@ dependencyAnalysis { onIncorrectConfiguration { severity("fail") exclude( - // Should be ignored as it's raised in many modules as misconfigured. + // Should be ignored, as they could potentially clash with dependencies + // from client code. "com.github.badoo.RIBs:rib-compose", ) } diff --git a/utils/interop-ribs/build.gradle.kts b/utils/interop-ribs/build.gradle.kts index 0a31cfddc..9697b4a74 100644 --- a/utils/interop-ribs/build.gradle.kts +++ b/utils/interop-ribs/build.gradle.kts @@ -29,7 +29,6 @@ dependencies { implementation(libs.androidx.activity.compose) androidTestImplementation(composeBom) - androidTestImplementation(libs.androidx.activity.compose) androidTestImplementation(libs.androidx.test.espresso.core) androidTestImplementation(libs.androidx.test.junit) androidTestImplementation(libs.compose.foundation.layout)