Skip to content

Commit

Permalink
Update library versions, and allow generic types without lint warning…
Browse files Browse the repository at this point in the history
…s for TypedNavigationHandles in Composables
  • Loading branch information
isaac-udy committed Nov 26, 2023
1 parent 896daca commit 6baff1d
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 34 deletions.
9 changes: 2 additions & 7 deletions enro-lint/src/main/java/dev/enro/lint/EnroIssueDetector.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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) {
Expand Down
54 changes: 27 additions & 27 deletions libs.versions.toml
Original file line number Diff line number Diff line change
@@ -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"

Expand All @@ -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"

Expand All @@ -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"
lint-checks = "com.android.tools.lint:lint-checks:31.1.4"
lint-api = "com.android.tools.lint:lint-api:31.1.4"

0 comments on commit 6baff1d

Please sign in to comment.