From 6baff1d80d3f03dbbd483dcd1b72b82180b3b372 Mon Sep 17 00:00:00 2001 From: Isaac Udy Date: Mon, 27 Nov 2023 08:19:51 +1300 Subject: [PATCH] Update library versions, and allow generic types without lint warnings for TypedNavigationHandles in Composables --- .../java/dev/enro/lint/EnroIssueDetector.kt | 9 +--- libs.versions.toml | 54 +++++++++---------- 2 files changed, 29 insertions(+), 34 deletions(-) diff --git a/enro-lint/src/main/java/dev/enro/lint/EnroIssueDetector.kt b/enro-lint/src/main/java/dev/enro/lint/EnroIssueDetector.kt index 6568d80f..6b7c469a 100644 --- a/enro-lint/src/main/java/dev/enro/lint/EnroIssueDetector.kt +++ b/enro-lint/src/main/java/dev/enro/lint/EnroIssueDetector.kt @@ -8,6 +8,7 @@ import com.intellij.psi.PsiJvmModifiersOwner import com.intellij.psi.PsiType import com.intellij.psi.search.GlobalSearchScope import com.intellij.psi.util.PsiUtil +import com.intellij.psi.util.TypeConversionUtil import org.jetbrains.uast.UCallExpression import org.jetbrains.uast.UClassLiteralExpression import org.jetbrains.uast.UElement @@ -79,12 +80,6 @@ class EnroIssueDetector : Detector(), Detector.UastScanner { } } - val viewModelNavigationHandlePropertyType = PsiType.getTypeByName( - "dev.enro.viewmodel.NavigationHandleProperty", - context.project.ideaProject, - GlobalSearchScope.allScope(context.project.ideaProject) - ) - val typedNavigationHandleType = PsiType.getTypeByName( "dev.enro.core.TypedNavigationHandle", context.project.ideaProject, @@ -114,7 +109,7 @@ class EnroIssueDetector : Detector(), Detector.UastScanner { val returnType = node.returnType as? PsiClassType ?: return if (!typedNavigationHandleType.isAssignableFrom(returnType)) return - val navigationHandleGenericType = returnType.parameters.first() + val navigationHandleGenericType = TypeConversionUtil.erasure(returnType.parameters.first()) val navigationDestinationType = composableParent.getNavigationDestinationType() if (navigationDestinationType == null) { diff --git a/libs.versions.toml b/libs.versions.toml index 43c7e2a4..e51d6ab9 100644 --- a/libs.versions.toml +++ b/libs.versions.toml @@ -1,50 +1,50 @@ [versions] [libraries] -android-gradle = "com.android.tools.build:gradle:8.1.2" +android-gradle = "com.android.tools.build:gradle:8.1.4" emulator-wtf-gradle = "wtf.emulator:gradle-plugin:0.0.11" androidx-core = "androidx.core:core-ktx:1.12.0" androidx-appcompat = "androidx.appcompat:appcompat:1.6.1" androidx-constraintlayout = "androidx.constraintlayout:constraintlayout:2.1.4" -androidx-fragment = "androidx.fragment:fragment-ktx:1.6.1" -androidx-recyclerview = "androidx.recyclerview:recyclerview:1.3.1" +androidx-fragment = "androidx.fragment:fragment-ktx:1.6.2" +androidx-recyclerview = "androidx.recyclerview:recyclerview:1.3.2" androidx-splashscreen = "androidx.core:core-splashscreen:1.0.1" # Used for interoperability testing in the main Enro test suite -androidx-navigation-fragment = "androidx.navigation:navigation-fragment-ktx:2.7.3" -androidx-navigation-ui = "androidx.navigation:navigation-ui-ktx:2.7.3" +androidx-navigation-fragment = "androidx.navigation:navigation-fragment-ktx:2.7.5" +androidx-navigation-ui = "androidx.navigation:navigation-ui-ktx:2.7.5" -androidx-activity = "androidx.activity:activity-ktx:1.8.0" -compose-activity = "androidx.activity:activity-compose:1.8.0" +androidx-activity = "androidx.activity:activity-ktx:1.8.1" +compose-activity = "androidx.activity:activity-compose:1.8.1" androidx-lifecycle = "androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2" androidx-lifecycle-process = "androidx.lifecycle:lifecycle-process:2.6.2" compose-viewmodel = "androidx.lifecycle:lifecycle-viewmodel-compose:2.6.2" -compose-compiler = "androidx.compose.compiler:compiler:1.5.3" -compose-foundation = "androidx.compose.foundation:foundation:1.5.3" -compose-foundationLayout = "androidx.compose.foundation:foundation-layout:1.5.3" -compose-ui = "androidx.compose.ui:ui:1.5.3" -compose-uiTooling = "androidx.compose.ui:ui-tooling:1.5.3" -compose-runtime = "androidx.compose.runtime:runtime:1.5.2" -compose-livedata = "androidx.compose.runtime:runtime-livedata:1.5.2" -compose-material = "androidx.compose.material:material:1.5.3" +compose-compiler = "androidx.compose.compiler:compiler:1.5.4" +compose-foundation = "androidx.compose.foundation:foundation:1.5.4" +compose-foundationLayout = "androidx.compose.foundation:foundation-layout:1.5.4" +compose-ui = "androidx.compose.ui:ui:1.5.4" +compose-uiTooling = "androidx.compose.ui:ui-tooling:1.5.4" +compose-runtime = "androidx.compose.runtime:runtime:1.5.4" +compose-livedata = "androidx.compose.runtime:runtime-livedata:1.5.4" +compose-material = "androidx.compose.material:material:1.5.4" compose-accompanist-systemUiController = "com.google.accompanist:accompanist-systemuicontroller:0.27.0" -compose-materialIcons = "androidx.compose.material:material-icons-core:1.5.3" -compose-materialIconsExtended = "androidx.compose.material:material-icons-extended:1.5.3" +compose-materialIcons = "androidx.compose.material:material-icons-core:1.5.4" +compose-materialIconsExtended = "androidx.compose.material:material-icons-extended:1.5.4" kotlin-gradle = "org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.10" kotlin-stdLib = "org.jetbrains.kotlin:kotlin-stdlib:1.9.10" kotlin-reflect = "org.jetbrains.kotlin:kotlin-reflect:1.9.10" -hilt-gradle = "com.google.dagger:hilt-android-gradle-plugin:2.48" -hilt-android = "com.google.dagger:hilt-android:2.48" -hilt-androidCompiler = "com.google.dagger:hilt-android-compiler:2.48" -hilt-testing = "com.google.dagger:hilt-android-testing:2.48" -hilt-compiler = "androidx.hilt:hilt-compiler:1.0.0" +hilt-gradle = "com.google.dagger:hilt-android-gradle-plugin:2.48.1" +hilt-android = "com.google.dagger:hilt-android:2.48.1" +hilt-androidCompiler = "com.google.dagger:hilt-android-compiler:2.48.1" +hilt-testing = "com.google.dagger:hilt-android-testing:2.48.1" +hilt-compiler = "androidx.hilt:hilt-compiler:1.1.0" leakcanary = "com.squareup.leakcanary:leakcanary-android:2.10" @@ -58,8 +58,8 @@ testing-androidx-orchestrator = "androidx.test:orchestrator:1.4.2" testing-androidx-espresso = "androidx.test.espresso:espresso-core:3.5.1" testing-androidx-espressoRecyclerView = "androidx.test.espresso:espresso-contrib:3.5.1" testing-androidx-espressoIntents = "androidx.test.espresso:espresso-intents:3.5.1" -testing-androidx-fragment = "androidx.fragment:fragment-testing:1.6.1" -testing-androidx-compose = "androidx.compose.ui:ui-test-junit4:1.5.3" +testing-androidx-fragment = "androidx.fragment:fragment-testing:1.6.2" +testing-androidx-compose = "androidx.compose.ui:ui-test-junit4:1.5.4" testing-leakcanary-instrumentation = "com.squareup.leakcanary:leakcanary-android-instrumentation:2.10" @@ -74,7 +74,7 @@ processing-javaPoet = "com.squareup:javapoet:1.13.0" processing-kotlinPoet = "com.squareup:kotlinpoet:1.13.2" processing-kotlinPoet-ksp = "com.squareup:kotlinpoet-ksp:1.13.2" -material = "com.google.android.material:material:1.9.0" +material = "com.google.android.material:material:1.10.0" -lint-checks = "com.android.tools.lint:lint-checks:31.1.2" -lint-api = "com.android.tools.lint:lint-api:31.1.2" \ No newline at end of file +lint-checks = "com.android.tools.lint:lint-checks:31.1.4" +lint-api = "com.android.tools.lint:lint-api:31.1.4" \ No newline at end of file