From ffcae27f3e3fe44d655f91362ad068a63cc5175e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 10 Dec 2024 12:49:55 +0000 Subject: [PATCH 1/7] build(deps): Bump the kotlin-ksp group with 11 updates Bumps the kotlin-ksp group with 11 updates: | Package | From | To | | --- | --- | --- | | [org.jetbrains.kotlin:kotlin-reflect](https://github.com/JetBrains/kotlin) | `2.0.21` | `2.1.0` | | [org.jetbrains.kotlin:kotlin-test-junit](https://github.com/JetBrains/kotlin) | `2.0.21` | `2.1.0` | | [org.jetbrains.kotlin.kapt](https://github.com/JetBrains/kotlin) | `2.0.21` | `2.1.0` | | [org.jetbrains.kotlin.plugin.allopen](https://github.com/JetBrains/kotlin) | `2.0.21` | `2.1.0` | | [org.jetbrains.kotlin.android](https://github.com/JetBrains/kotlin) | `2.0.21` | `2.1.0` | | [org.jetbrains.kotlin.plugin.compose](https://github.com/JetBrains/kotlin) | `2.0.21` | `2.1.0` | | [org.jetbrains.kotlin.jvm](https://github.com/JetBrains/kotlin) | `2.0.21` | `2.1.0` | | [org.jetbrains.kotlin.plugin.parcelize](https://github.com/JetBrains/kotlin) | `2.0.21` | `2.1.0` | | [org.jetbrains.kotlin.plugin.serialization](https://github.com/JetBrains/kotlin) | `2.0.21` | `2.1.0` | | [com.google.devtools.ksp:symbol-processing-api](https://github.com/google/ksp) | `2.0.21-1.0.28` | `2.1.0-1.0.29` | | [com.google.devtools.ksp](https://github.com/google/ksp) | `2.0.21-1.0.28` | `2.1.0-1.0.29` | Updates `org.jetbrains.kotlin:kotlin-reflect` from 2.0.21 to 2.1.0 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v2.0.21...v2.1.0) Updates `org.jetbrains.kotlin:kotlin-test-junit` from 2.0.21 to 2.1.0 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v2.0.21...v2.1.0) Updates `org.jetbrains.kotlin.kapt` from 2.0.21 to 2.1.0 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v2.0.21...v2.1.0) Updates `org.jetbrains.kotlin.plugin.allopen` from 2.0.21 to 2.1.0 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v2.0.21...v2.1.0) Updates `org.jetbrains.kotlin.android` from 2.0.21 to 2.1.0 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v2.0.21...v2.1.0) Updates `org.jetbrains.kotlin.plugin.compose` from 2.0.21 to 2.1.0 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v2.0.21...v2.1.0) Updates `org.jetbrains.kotlin.jvm` from 2.0.21 to 2.1.0 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v2.0.21...v2.1.0) Updates `org.jetbrains.kotlin.plugin.parcelize` from 2.0.21 to 2.1.0 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v2.0.21...v2.1.0) Updates `org.jetbrains.kotlin.plugin.serialization` from 2.0.21 to 2.1.0 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v2.0.21...v2.1.0) Updates `org.jetbrains.kotlin:kotlin-test-junit` from 2.0.21 to 2.1.0 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v2.0.21...v2.1.0) Updates `com.google.devtools.ksp:symbol-processing-api` from 2.0.21-1.0.28 to 2.1.0-1.0.29 - [Release notes](https://github.com/google/ksp/releases) - [Commits](https://github.com/google/ksp/compare/2.0.21-1.0.28...2.1.0-1.0.29) Updates `com.google.devtools.ksp` from 2.0.21-1.0.28 to 2.1.0-1.0.29 - [Release notes](https://github.com/google/ksp/releases) - [Commits](https://github.com/google/ksp/compare/2.0.21-1.0.28...2.1.0-1.0.29) Updates `org.jetbrains.kotlin.kapt` from 2.0.21 to 2.1.0 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v2.0.21...v2.1.0) Updates `org.jetbrains.kotlin.plugin.allopen` from 2.0.21 to 2.1.0 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v2.0.21...v2.1.0) Updates `org.jetbrains.kotlin.android` from 2.0.21 to 2.1.0 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v2.0.21...v2.1.0) Updates `org.jetbrains.kotlin.plugin.compose` from 2.0.21 to 2.1.0 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v2.0.21...v2.1.0) Updates `org.jetbrains.kotlin.jvm` from 2.0.21 to 2.1.0 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v2.0.21...v2.1.0) Updates `org.jetbrains.kotlin.plugin.parcelize` from 2.0.21 to 2.1.0 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v2.0.21...v2.1.0) Updates `org.jetbrains.kotlin.plugin.serialization` from 2.0.21 to 2.1.0 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v2.0.21...v2.1.0) Updates `com.google.devtools.ksp` from 2.0.21-1.0.28 to 2.1.0-1.0.29 - [Release notes](https://github.com/google/ksp/releases) - [Commits](https://github.com/google/ksp/compare/2.0.21-1.0.28...2.1.0-1.0.29) --- updated-dependencies: - dependency-name: org.jetbrains.kotlin:kotlin-reflect dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kotlin-ksp - dependency-name: org.jetbrains.kotlin:kotlin-test-junit dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kotlin-ksp - dependency-name: org.jetbrains.kotlin.kapt dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kotlin-ksp - dependency-name: org.jetbrains.kotlin.plugin.allopen dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kotlin-ksp - dependency-name: org.jetbrains.kotlin.android dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kotlin-ksp - dependency-name: org.jetbrains.kotlin.plugin.compose dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kotlin-ksp - dependency-name: org.jetbrains.kotlin.jvm dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kotlin-ksp - dependency-name: org.jetbrains.kotlin.plugin.parcelize dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kotlin-ksp - dependency-name: org.jetbrains.kotlin.plugin.serialization dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kotlin-ksp - dependency-name: org.jetbrains.kotlin:kotlin-test-junit dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kotlin-ksp - dependency-name: com.google.devtools.ksp:symbol-processing-api dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kotlin-ksp - dependency-name: com.google.devtools.ksp dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kotlin-ksp - dependency-name: org.jetbrains.kotlin.kapt dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kotlin-ksp - dependency-name: org.jetbrains.kotlin.plugin.allopen dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kotlin-ksp - dependency-name: org.jetbrains.kotlin.android dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kotlin-ksp - dependency-name: org.jetbrains.kotlin.plugin.compose dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kotlin-ksp - dependency-name: org.jetbrains.kotlin.jvm dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kotlin-ksp - dependency-name: org.jetbrains.kotlin.plugin.parcelize dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kotlin-ksp - dependency-name: org.jetbrains.kotlin.plugin.serialization dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kotlin-ksp - dependency-name: com.google.devtools.ksp dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kotlin-ksp ... Signed-off-by: dependabot[bot] --- gradle/libs.versions.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index dc32c978a2ef..425e7e65aec7 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -82,10 +82,10 @@ json-path = '2.9.0' jsoup = '1.18.3' junit = '4.13.2' kotlin-compile-testing = '1.6.0' -kotlin-main = '2.0.21' +kotlin-main = '2.1.0' kotlinx-coroutines = '1.8.1' kotlinx-kover = '0.7.6' -ksp = '2.0.21-1.0.28' +ksp = '2.1.0-1.0.29' mockito-android = '5.14.2' mockito-kotlin = '4.1.0' mpandroidchart = 'v3.1.0' From e41ac16b51d47e07584992f74f2bf26e7291ef93 Mon Sep 17 00:00:00 2001 From: Nick Bradbury Date: Tue, 10 Dec 2024 12:37:31 -0500 Subject: [PATCH 2/7] Use uppercase and lowercase --- .../org/wordpress/android/fluxc/model/list/ListOrder.kt | 2 +- .../android/fluxc/model/list/PostListDescriptor.kt | 2 +- .../android/fluxc/model/notification/NotificationModel.kt | 2 +- .../fluxc/network/rest/wpcom/site/BooleanTypeAdapter.kt | 8 +++++--- .../wordpress/android/fluxc/store/NotificationStore.kt | 4 ++-- .../java/org/wordpress/android/fluxc/store/PageStore.kt | 4 ++-- .../java/org/wordpress/android/fluxc/store/SiteStore.kt | 2 +- 7 files changed, 13 insertions(+), 11 deletions(-) diff --git a/libs/fluxc/src/main/java/org/wordpress/android/fluxc/model/list/ListOrder.kt b/libs/fluxc/src/main/java/org/wordpress/android/fluxc/model/list/ListOrder.kt index ec8061f6b9c0..77b70276d50d 100644 --- a/libs/fluxc/src/main/java/org/wordpress/android/fluxc/model/list/ListOrder.kt +++ b/libs/fluxc/src/main/java/org/wordpress/android/fluxc/model/list/ListOrder.kt @@ -7,7 +7,7 @@ enum class ListOrder(val value: String) { DESC("DESC"); companion object { fun fromValue(value: String): ListOrder? { - return values().firstOrNull { it.value.toLowerCase(Locale.ROOT) == value.toLowerCase(Locale.ROOT) } + return values().firstOrNull { it.value.lowercase(Locale.ROOT) == value.lowercase(Locale.ROOT) } } } } diff --git a/libs/fluxc/src/main/java/org/wordpress/android/fluxc/model/list/PostListDescriptor.kt b/libs/fluxc/src/main/java/org/wordpress/android/fluxc/model/list/PostListDescriptor.kt index 5f8296f62f2a..03ab6dd36f46 100644 --- a/libs/fluxc/src/main/java/org/wordpress/android/fluxc/model/list/PostListDescriptor.kt +++ b/libs/fluxc/src/main/java/org/wordpress/android/fluxc/model/list/PostListDescriptor.kt @@ -105,7 +105,7 @@ enum class PostListOrderBy(val value: String) { companion object { fun fromValue(value: String): PostListOrderBy? { - return values().firstOrNull { it.value.toLowerCase(Locale.ROOT) == value.toLowerCase(Locale.ROOT) } + return values().firstOrNull { it.value.lowercase(Locale.ROOT) == value.lowercase(Locale.ROOT) } } } } diff --git a/libs/fluxc/src/main/java/org/wordpress/android/fluxc/model/notification/NotificationModel.kt b/libs/fluxc/src/main/java/org/wordpress/android/fluxc/model/notification/NotificationModel.kt index 210d9d3bd39d..610c7c8480c5 100644 --- a/libs/fluxc/src/main/java/org/wordpress/android/fluxc/model/notification/NotificationModel.kt +++ b/libs/fluxc/src/main/java/org/wordpress/android/fluxc/model/notification/NotificationModel.kt @@ -62,7 +62,7 @@ data class NotificationModel( return if (type.isEmpty()) { NONE } else { - reverseMap[type.toUpperCase(Locale.US)] ?: UNKNOWN + reverseMap[type.uppercase(Locale.US)] ?: UNKNOWN } } } diff --git a/libs/fluxc/src/main/java/org/wordpress/android/fluxc/network/rest/wpcom/site/BooleanTypeAdapter.kt b/libs/fluxc/src/main/java/org/wordpress/android/fluxc/network/rest/wpcom/site/BooleanTypeAdapter.kt index 4a71d07772e6..4adce128166e 100644 --- a/libs/fluxc/src/main/java/org/wordpress/android/fluxc/network/rest/wpcom/site/BooleanTypeAdapter.kt +++ b/libs/fluxc/src/main/java/org/wordpress/android/fluxc/network/rest/wpcom/site/BooleanTypeAdapter.kt @@ -16,9 +16,11 @@ internal class BooleanTypeAdapter : JsonDeserializer { return when { jsonPrimitive.isBoolean -> jsonPrimitive.asBoolean jsonPrimitive.isNumber -> jsonPrimitive.asNumber.toInt() == 1 - jsonPrimitive.isString -> TRUE_STRINGS.contains(jsonPrimitive.asString.toLowerCase( - Locale.getDefault() - )) + jsonPrimitive.isString -> TRUE_STRINGS.contains( + jsonPrimitive.asString.lowercase( + Locale.getDefault() + ) + ) else -> false } } diff --git a/libs/fluxc/src/main/java/org/wordpress/android/fluxc/store/NotificationStore.kt b/libs/fluxc/src/main/java/org/wordpress/android/fluxc/store/NotificationStore.kt index b80f4cda65d8..cbbcab67c155 100644 --- a/libs/fluxc/src/main/java/org/wordpress/android/fluxc/store/NotificationStore.kt +++ b/libs/fluxc/src/main/java/org/wordpress/android/fluxc/store/NotificationStore.kt @@ -74,7 +74,7 @@ class NotificationStore @Inject constructor( companion object { private val reverseMap = values().associateBy(DeviceRegistrationErrorType::name) - fun fromString(type: String) = reverseMap[type.toUpperCase(Locale.US)] ?: GENERIC_ERROR + fun fromString(type: String) = reverseMap[type.uppercase(Locale.US)] ?: GENERIC_ERROR } } @@ -147,7 +147,7 @@ class NotificationStore @Inject constructor( companion object { private val reverseMap = values().associateBy(NotificationErrorType::name) - fun fromString(type: String) = reverseMap[type.toUpperCase(Locale.US)] ?: GENERIC_ERROR + fun fromString(type: String) = reverseMap[type.uppercase(Locale.US)] ?: GENERIC_ERROR } } diff --git a/libs/fluxc/src/main/java/org/wordpress/android/fluxc/store/PageStore.kt b/libs/fluxc/src/main/java/org/wordpress/android/fluxc/store/PageStore.kt index 2e1e8b51277b..4242074a3062 100644 --- a/libs/fluxc/src/main/java/org/wordpress/android/fluxc/store/PageStore.kt +++ b/libs/fluxc/src/main/java/org/wordpress/android/fluxc/store/PageStore.kt @@ -83,8 +83,8 @@ class PageStore @Inject constructor( suspend fun search(site: SiteModel, searchQuery: String): List = coroutineEngine.withDefaultContext(AppLog.T.POSTS, this, "search") { getPagesFromDb(site).filter { - it.title.toLowerCase(Locale.ROOT) - .contains(searchQuery.toLowerCase(Locale.ROOT)) + it.title.lowercase(Locale.ROOT) + .contains(searchQuery.lowercase(Locale.ROOT)) } } diff --git a/libs/fluxc/src/main/java/org/wordpress/android/fluxc/store/SiteStore.kt b/libs/fluxc/src/main/java/org/wordpress/android/fluxc/store/SiteStore.kt index a96a980bbec0..0f18dad7f163 100644 --- a/libs/fluxc/src/main/java/org/wordpress/android/fluxc/store/SiteStore.kt +++ b/libs/fluxc/src/main/java/org/wordpress/android/fluxc/store/SiteStore.kt @@ -1012,7 +1012,7 @@ open class SiteStore @Inject constructor( private const val SITE = "SITE" @JvmStatic fun fromString(string: String): NewSiteErrorType { if (!TextUtils.isEmpty(string)) { - val siteString = string.toUpperCase(Locale.US).replace(BLOG, SITE) + val siteString = string.uppercase(Locale.US).replace(BLOG, SITE) for (v in values()) { if (siteString.equals(v.name, ignoreCase = true)) { return v From 81024b189869dded5c98f0b16ffcb33c49384735 Mon Sep 17 00:00:00 2001 From: Nick Bradbury Date: Tue, 10 Dec 2024 12:54:26 -0500 Subject: [PATCH 3/7] Fixed getSerializableCompat warning --- .../java/org/wordpress/android/ui/mysite/MySiteFragment.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/mysite/MySiteFragment.kt b/WordPress/src/main/java/org/wordpress/android/ui/mysite/MySiteFragment.kt index ef8c9647d3ef..4e638ac503b0 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/mysite/MySiteFragment.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/mysite/MySiteFragment.kt @@ -86,6 +86,7 @@ import org.wordpress.android.viewmodel.main.WPMainActivityViewModel import org.wordpress.android.viewmodel.observeEvent import org.wordpress.android.viewmodel.pages.PageListViewModel import java.io.File +import java.io.Serializable import javax.inject.Inject @Suppress("LargeClass") @@ -211,8 +212,8 @@ class MySiteFragment : Fragment(R.layout.my_site_fragment), override fun onConfirm(result: Bundle?) { val task = result?.getSerializableCompat( QuickStartFullScreenDialogFragment.RESULT_TASK - ) as? QuickStartStore.QuickStartTask - task?.let { viewModel.onQuickStartTaskCardClick(it) } + ) as? Serializable + (task as? QuickStartStore.QuickStartTask)?.let { viewModel.onQuickStartTaskCardClick(it) } } override fun onDismiss() { From 0b943183ed11be89a57aeea6d635d927ee2c29a4 Mon Sep 17 00:00:00 2001 From: Nick Bradbury Date: Tue, 10 Dec 2024 13:21:41 -0500 Subject: [PATCH 4/7] Fixed "Specific imports should be used for FluxC Store inner classes" error --- .../java/org/wordpress/android/ui/mysite/MySiteFragment.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/mysite/MySiteFragment.kt b/WordPress/src/main/java/org/wordpress/android/ui/mysite/MySiteFragment.kt index 4e638ac503b0..fc4771fad629 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/mysite/MySiteFragment.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/mysite/MySiteFragment.kt @@ -22,7 +22,7 @@ import org.wordpress.android.WordPress import org.wordpress.android.analytics.AnalyticsTracker import org.wordpress.android.databinding.MySiteFragmentBinding import org.wordpress.android.fluxc.store.AccountStore -import org.wordpress.android.fluxc.store.QuickStartStore +import org.wordpress.android.fluxc.store.QuickStartStore.QuickStartTask import org.wordpress.android.ui.ActivityLauncher import org.wordpress.android.ui.ActivityNavigator import org.wordpress.android.ui.FullScreenDialogFragment @@ -213,7 +213,7 @@ class MySiteFragment : Fragment(R.layout.my_site_fragment), val task = result?.getSerializableCompat( QuickStartFullScreenDialogFragment.RESULT_TASK ) as? Serializable - (task as? QuickStartStore.QuickStartTask)?.let { viewModel.onQuickStartTaskCardClick(it) } + (task as? QuickStartTask)?.let { viewModel.onQuickStartTaskCardClick(it) } } override fun onDismiss() { From cc33adcdc4321ca14ae30024e9800a52e735ebb0 Mon Sep 17 00:00:00 2001 From: Wojtek Zieba Date: Wed, 11 Dec 2024 17:09:00 +0100 Subject: [PATCH 5/7] Explicitly don't use KSP2 KSP2 was meant to replace KSP1 with Kotlin 2.1 (source: https://github.com/google/ksp/blob/13592a7600b6da335242cc98608daadddd036c3d/docs/ksp2.md?plain=1#L39 ) but it ended up not to be. This is fortunate, as KSP2 for now seems to not be an option for us (no support from Dagger) and have performance bottlenecks (source: https://kotlinlang.slack.com/archives/C013BA8EQSE/p1731534615273809) I propose setting this flag to `false` to explicitly describe which KSP version we use, as I haven't found any way to log this. --- gradle.properties | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gradle.properties b/gradle.properties index d3977db0301c..965f64f351d6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,5 +10,7 @@ android.nonTransitiveRClass=true android.nonFinalResIds=false android.enableR8.fullMode=false +ksp.useKSP2=false + # Dependency Analysis Plugin dependency.analysis.android.ignored.variants=release,wordpressVanillaDebug,wordpressVanillaRelease,wordpressWasabiDebug,wordpressWasabiRelease,wordpressJalapenoRelease,jetpackVanillaDebug,jetpackVanillaRelease,jetpackWasabiDebug,jetpackWasabiRelease,jetpackJalapenoRelease From 631549d5a488ad3ba3e2ff6e5abb713f25743a8f Mon Sep 17 00:00:00 2001 From: Wojtek Zieba Date: Wed, 11 Dec 2024 17:29:13 +0100 Subject: [PATCH 6/7] Replace kotlin compile testing with a fork That follows Kotlin updates more frequently. This addresses `incompatible version of Kotlin` error. Specify `-language-version` to `1.9` as higher version seems to influence which KSP is executed. Inspired by: https://github.com/square/moshi/blob/d88d91d8394f418fd47b182c841b9a3e3a3e0a0b/moshi-kotlin-codegen/src/test/java/com/squareup/moshi/kotlin/codegen/ksp/JsonClassSymbolProcessorTest.kt#L856 --- gradle/libs.versions.toml | 6 +++--- .../android/processor/RemoteConfigProcessorTest.kt | 11 +++++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 8cf88de1e022..68a96789c147 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -81,7 +81,7 @@ jna = '5.15.0@aar' json-path = '2.9.0' jsoup = '1.18.3' junit = '4.13.2' -kotlin-compile-testing = '1.6.0' +kotlin-compile-testing = '0.7.0' kotlin-main = '2.1.0' kotlinx-coroutines = '1.8.1' kotlinx-kover = '0.7.6' @@ -232,8 +232,8 @@ jna = { module = "net.java.dev.jna:jna", version.ref = "jna" } json-path = { group = "com.jayway.jsonpath", name = "json-path", version.ref = "json-path" } jsoup = { group = "org.jsoup", name = "jsoup", version.ref = "jsoup" } junit = { group = "junit", name = "junit", version.ref = "junit" } -kotlin-compile-testing-ksp = { group = "com.github.tschuchortdev", name = "kotlin-compile-testing-ksp", version.ref = "kotlin-compile-testing" } -kotlin-compile-testing-main = { group = "com.github.tschuchortdev", name = "kotlin-compile-testing", version.ref = "kotlin-compile-testing" } +kotlin-compile-testing-ksp = { group = "dev.zacsweers.kctfork", name = "ksp", version.ref = "kotlin-compile-testing" } +kotlin-compile-testing-main = { group = "dev.zacsweers.kctfork", name = "core", version.ref = "kotlin-compile-testing" } kotlin-reflect = { group = "org.jetbrains.kotlin", name = "kotlin-reflect", version.ref = "kotlin-main" } kotlin-test-junit = { group = "org.jetbrains.kotlin", name = "kotlin-test-junit", version.ref = "kotlin-main" } kotlinx-coroutines-android = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-android", version.ref = "kotlinx-coroutines" } diff --git a/libs/processors/src/test/kotlin/org/wordpress/android/processor/RemoteConfigProcessorTest.kt b/libs/processors/src/test/kotlin/org/wordpress/android/processor/RemoteConfigProcessorTest.kt index 2fc0431afa3c..a03ae54620aa 100644 --- a/libs/processors/src/test/kotlin/org/wordpress/android/processor/RemoteConfigProcessorTest.kt +++ b/libs/processors/src/test/kotlin/org/wordpress/android/processor/RemoteConfigProcessorTest.kt @@ -2,8 +2,7 @@ package org.wordpress.android.processor import com.tschuchort.compiletesting.KotlinCompilation import com.tschuchort.compiletesting.SourceFile -import com.tschuchort.compiletesting.kspWithCompilation -import com.tschuchort.compiletesting.symbolProcessorProviders +import com.tschuchort.compiletesting.configureKsp import org.assertj.core.api.Assertions.assertThat import org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi import org.jetbrains.kotlin.utils.addToStdlib.UnsafeCastFunction @@ -119,10 +118,14 @@ class RemoteConfigProcessorTest { private fun compile(src: List) = KotlinCompilation().apply { sources = src + fakeAppConfig - symbolProcessorProviders = listOf(RemoteConfigProcessorProvider()) - kspWithCompilation = true inheritClassPath = true + verbose = true messageOutputStream = System.out + configureKsp(useKsp2 = false) { + symbolProcessorProviders += RemoteConfigProcessorProvider() + withCompilation = true + languageVersion = "1.9" + } }.compile() // Fake AppConfig is needed, as it's a class that is expected to be present in the classpath. Originally, this class From ca1d0617d07b424ba85be12564bac57f70878258 Mon Sep 17 00:00:00 2001 From: Nick Bradbury Date: Thu, 12 Dec 2024 08:55:10 -0500 Subject: [PATCH 7/7] Removed locale --- .../java/org/wordpress/android/fluxc/model/list/ListOrder.kt | 4 +--- .../wordpress/android/fluxc/model/list/PostListDescriptor.kt | 3 +-- .../android/fluxc/model/notification/NotificationModel.kt | 5 ++--- .../fluxc/network/rest/wpcom/site/BooleanTypeAdapter.kt | 5 +---- .../org/wordpress/android/fluxc/store/NotificationStore.kt | 5 ++--- .../main/java/org/wordpress/android/fluxc/store/PageStore.kt | 4 +--- .../main/java/org/wordpress/android/fluxc/store/SiteStore.kt | 2 +- 7 files changed, 9 insertions(+), 19 deletions(-) diff --git a/libs/fluxc/src/main/java/org/wordpress/android/fluxc/model/list/ListOrder.kt b/libs/fluxc/src/main/java/org/wordpress/android/fluxc/model/list/ListOrder.kt index 77b70276d50d..5650cb8bdcf3 100644 --- a/libs/fluxc/src/main/java/org/wordpress/android/fluxc/model/list/ListOrder.kt +++ b/libs/fluxc/src/main/java/org/wordpress/android/fluxc/model/list/ListOrder.kt @@ -1,13 +1,11 @@ package org.wordpress.android.fluxc.model.list -import java.util.Locale - enum class ListOrder(val value: String) { ASC("ASC"), DESC("DESC"); companion object { fun fromValue(value: String): ListOrder? { - return values().firstOrNull { it.value.lowercase(Locale.ROOT) == value.lowercase(Locale.ROOT) } + return values().firstOrNull { it.value.lowercase() == value.lowercase() } } } } diff --git a/libs/fluxc/src/main/java/org/wordpress/android/fluxc/model/list/PostListDescriptor.kt b/libs/fluxc/src/main/java/org/wordpress/android/fluxc/model/list/PostListDescriptor.kt index 03ab6dd36f46..10ee78ed7731 100644 --- a/libs/fluxc/src/main/java/org/wordpress/android/fluxc/model/list/PostListDescriptor.kt +++ b/libs/fluxc/src/main/java/org/wordpress/android/fluxc/model/list/PostListDescriptor.kt @@ -7,7 +7,6 @@ import org.wordpress.android.fluxc.model.list.ListOrder.DESC import org.wordpress.android.fluxc.model.list.PostListOrderBy.DATE import org.wordpress.android.fluxc.model.post.PostStatus import org.wordpress.android.fluxc.store.PostStore.DEFAULT_POST_STATUS_LIST -import java.util.Locale sealed class PostListDescriptor( val site: SiteModel, @@ -105,7 +104,7 @@ enum class PostListOrderBy(val value: String) { companion object { fun fromValue(value: String): PostListOrderBy? { - return values().firstOrNull { it.value.lowercase(Locale.ROOT) == value.lowercase(Locale.ROOT) } + return values().firstOrNull { it.value.lowercase() == value.lowercase() } } } } diff --git a/libs/fluxc/src/main/java/org/wordpress/android/fluxc/model/notification/NotificationModel.kt b/libs/fluxc/src/main/java/org/wordpress/android/fluxc/model/notification/NotificationModel.kt index 610c7c8480c5..62cf385ed56e 100644 --- a/libs/fluxc/src/main/java/org/wordpress/android/fluxc/model/notification/NotificationModel.kt +++ b/libs/fluxc/src/main/java/org/wordpress/android/fluxc/model/notification/NotificationModel.kt @@ -2,7 +2,6 @@ package org.wordpress.android.fluxc.model.notification import org.wordpress.android.fluxc.tools.FormattableContent import org.wordpress.android.fluxc.tools.FormattableMeta -import java.util.Locale data class NotificationModel( val noteId: Int = 0, @@ -45,7 +44,7 @@ data class NotificationModel( companion object { private val reverseMap = values().associateBy( Kind::name) - fun fromString(type: String) = reverseMap[type.uppercase(Locale.US)] ?: UNKNOWN + fun fromString(type: String) = reverseMap[type.uppercase()] ?: UNKNOWN } } @@ -62,7 +61,7 @@ data class NotificationModel( return if (type.isEmpty()) { NONE } else { - reverseMap[type.uppercase(Locale.US)] ?: UNKNOWN + reverseMap[type.uppercase()] ?: UNKNOWN } } } diff --git a/libs/fluxc/src/main/java/org/wordpress/android/fluxc/network/rest/wpcom/site/BooleanTypeAdapter.kt b/libs/fluxc/src/main/java/org/wordpress/android/fluxc/network/rest/wpcom/site/BooleanTypeAdapter.kt index 4adce128166e..160675dbf0c0 100644 --- a/libs/fluxc/src/main/java/org/wordpress/android/fluxc/network/rest/wpcom/site/BooleanTypeAdapter.kt +++ b/libs/fluxc/src/main/java/org/wordpress/android/fluxc/network/rest/wpcom/site/BooleanTypeAdapter.kt @@ -5,7 +5,6 @@ import com.google.gson.JsonDeserializer import com.google.gson.JsonElement import com.google.gson.JsonParseException import java.lang.reflect.Type -import java.util.Locale internal class BooleanTypeAdapter : JsonDeserializer { @Suppress("VariableNaming") private val TRUE_STRINGS: Set = HashSet(listOf("true", "1", "yes")) @@ -17,9 +16,7 @@ internal class BooleanTypeAdapter : JsonDeserializer { jsonPrimitive.isBoolean -> jsonPrimitive.asBoolean jsonPrimitive.isNumber -> jsonPrimitive.asNumber.toInt() == 1 jsonPrimitive.isString -> TRUE_STRINGS.contains( - jsonPrimitive.asString.lowercase( - Locale.getDefault() - ) + jsonPrimitive.asString.lowercase() ) else -> false } diff --git a/libs/fluxc/src/main/java/org/wordpress/android/fluxc/store/NotificationStore.kt b/libs/fluxc/src/main/java/org/wordpress/android/fluxc/store/NotificationStore.kt index cbbcab67c155..3898a33dcfcb 100644 --- a/libs/fluxc/src/main/java/org/wordpress/android/fluxc/store/NotificationStore.kt +++ b/libs/fluxc/src/main/java/org/wordpress/android/fluxc/store/NotificationStore.kt @@ -21,7 +21,6 @@ import org.wordpress.android.fluxc.utils.PreferenceUtils import org.wordpress.android.util.AppLog import org.wordpress.android.util.AppLog.T import java.util.Date -import java.util.Locale import java.util.UUID import javax.inject.Inject import javax.inject.Singleton @@ -74,7 +73,7 @@ class NotificationStore @Inject constructor( companion object { private val reverseMap = values().associateBy(DeviceRegistrationErrorType::name) - fun fromString(type: String) = reverseMap[type.uppercase(Locale.US)] ?: GENERIC_ERROR + fun fromString(type: String) = reverseMap[type.uppercase()] ?: GENERIC_ERROR } } @@ -147,7 +146,7 @@ class NotificationStore @Inject constructor( companion object { private val reverseMap = values().associateBy(NotificationErrorType::name) - fun fromString(type: String) = reverseMap[type.uppercase(Locale.US)] ?: GENERIC_ERROR + fun fromString(type: String) = reverseMap[type.uppercase()] ?: GENERIC_ERROR } } diff --git a/libs/fluxc/src/main/java/org/wordpress/android/fluxc/store/PageStore.kt b/libs/fluxc/src/main/java/org/wordpress/android/fluxc/store/PageStore.kt index 4242074a3062..cd63552066f2 100644 --- a/libs/fluxc/src/main/java/org/wordpress/android/fluxc/store/PageStore.kt +++ b/libs/fluxc/src/main/java/org/wordpress/android/fluxc/store/PageStore.kt @@ -24,7 +24,6 @@ import org.wordpress.android.fluxc.tools.CoroutineEngine import org.wordpress.android.util.AppLog import org.wordpress.android.util.DateTimeUtils import java.util.Calendar -import java.util.Locale import javax.inject.Inject import javax.inject.Singleton import kotlin.coroutines.Continuation @@ -83,8 +82,7 @@ class PageStore @Inject constructor( suspend fun search(site: SiteModel, searchQuery: String): List = coroutineEngine.withDefaultContext(AppLog.T.POSTS, this, "search") { getPagesFromDb(site).filter { - it.title.lowercase(Locale.ROOT) - .contains(searchQuery.lowercase(Locale.ROOT)) + it.title.lowercase().contains(searchQuery.lowercase()) } } diff --git a/libs/fluxc/src/main/java/org/wordpress/android/fluxc/store/SiteStore.kt b/libs/fluxc/src/main/java/org/wordpress/android/fluxc/store/SiteStore.kt index 0f18dad7f163..2ca8be053e9d 100644 --- a/libs/fluxc/src/main/java/org/wordpress/android/fluxc/store/SiteStore.kt +++ b/libs/fluxc/src/main/java/org/wordpress/android/fluxc/store/SiteStore.kt @@ -1012,7 +1012,7 @@ open class SiteStore @Inject constructor( private const val SITE = "SITE" @JvmStatic fun fromString(string: String): NewSiteErrorType { if (!TextUtils.isEmpty(string)) { - val siteString = string.uppercase(Locale.US).replace(BLOG, SITE) + val siteString = string.uppercase().replace(BLOG, SITE) for (v in values()) { if (siteString.equals(v.name, ignoreCase = true)) { return v