Skip to content

Commit

Permalink
Upgrade to Kotlin 1.7 (#35)
Browse files Browse the repository at this point in the history
* Upgrade to Anvil 2.4.1 and Kotlin 1.7.0

* Remove unused kapt.use.worker.api flag

* Resolve Xopt-in deprecation

* Remove unused opt-ins

* Upgrade to Dagger 2.42 to fix a problem with Dagger and KT 1.7 metadata compatibility
  • Loading branch information
kingsleyadio authored Aug 3, 2022
1 parent c0bc1b1 commit 4458749
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 11 deletions.
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ fun KotlinCompile.configureTask() {

val compilerArgs = mutableListOf(
"-Xassertions=jvm",
"-Xopt-in=kotlin.RequiresOptIn",
"-Xopt-in=com.squareup.anvil.annotations.ExperimentalAnvilApi",
"-opt-in=kotlin.RequiresOptIn",
"-opt-in=com.squareup.anvil.annotations.ExperimentalAnvilApi",
)
if (project.name != "sample") compilerArgs += "-Xexplicit-api=strict"
freeCompilerArgs = freeCompilerArgs + compilerArgs
Expand Down
1 change: 0 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ android.useAndroidX=true
# android.enableJetifier=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
kapt.use.worker.api=true
kapt.incremental.apt=true
kapt.include.compile.classpath=false
# Enables namespacing of each library's R class so that its R class includes only the
Expand Down
8 changes: 4 additions & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[versions]
androidGradle = "7.1.2"
androidGradle = "7.2.1"
androidxActivity = "1.4.0"
androidxAppCompat = "1.3.1"
androidxCore = "1.7.0"
androidxFragment = "1.3.6"
androidxLifecycle = "2.4.0"
anvil = "2.4.0"
dagger = "2.39.1"
kotlin = "1.6.10"
anvil = "2.4.1"
dagger = "2.42"
kotlin = "1.7.0"
kotlinxCoroutines = "1.6.0"
truth = "1.1.3"
autoService = "1.0"
Expand Down
3 changes: 3 additions & 0 deletions whetstone/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ dependencies {
testImplementation(kotlin("test-junit"))
testImplementation(kotlin("reflect"))
testImplementation(testFixtures(libs.anvilCompilerUtils))
// Force stable version of transitive dependency from anvil/compiler-utils
// TODO(Kingsley): Remove this once Anvil switches to the stable version
testImplementation("com.github.tschuchortdev:kotlin-compile-testing:1.4.9")
testImplementation(projects.whetstoneCompiler)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.deliveryhero.whetstone.fragment

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentFactory
import com.deliveryhero.whetstone.InternalInjectApi
import com.deliveryhero.whetstone.component.FragmentComponent
import com.deliveryhero.whetstone.scope.ActivityScope
import com.squareup.anvil.annotations.ContributesBinding
Expand All @@ -12,7 +11,6 @@ import javax.inject.Provider
/**
* A [FragmentFactory] that can hold onto multiple other FragmentFactory [Provider]'s.
*/
@OptIn(InternalInjectApi::class)
@ContributesBinding(ActivityScope::class)
public class MultibindingFragmentFactory @Inject constructor(
private val fragmentComponentFactory: FragmentComponent.Factory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@ import androidx.lifecycle.SavedStateHandle
import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider
import androidx.savedstate.SavedStateRegistryOwner
import com.deliveryhero.whetstone.InternalInjectApi
import com.deliveryhero.whetstone.component.ViewModelComponent
import com.deliveryhero.whetstone.scope.ApplicationScope
import com.squareup.anvil.annotations.ContributesBinding
import javax.inject.Inject

@OptIn(InternalInjectApi::class)
@ContributesBinding(ApplicationScope::class)
public class MultibindingViewModelFactoryProducer @Inject constructor(
private val viewModelComponentFactory: ViewModelComponent.Factory,
Expand Down

0 comments on commit 4458749

Please sign in to comment.