Skip to content

Commit cc06a22

Browse files
authored
Merge pull request #1148 from square/joel/kotlin-2.2
Upgrade to Kotlin 2.2.0
2 parents 442b67c + 512d5f3 commit cc06a22

File tree

14 files changed

+60
-53
lines changed

14 files changed

+60
-53
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
strategy:
1717
fail-fast: false
1818
matrix:
19-
kotlin-version: [ 2.1.21 ]
19+
kotlin-version: [ 2.2.0 ]
2020

2121
steps:
2222
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
@@ -36,7 +36,7 @@ jobs:
3636
strategy:
3737
fail-fast: false
3838
matrix:
39-
kotlin-version: [ 2.1.21 ]
39+
kotlin-version: [ 2.2.0 ]
4040

4141
steps:
4242
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
@@ -172,7 +172,7 @@ jobs:
172172
# solution.
173173
fail-fast: false
174174
matrix:
175-
kotlin-version: [ 2.1.21 ]
175+
kotlin-version: [ 2.2.0 ]
176176
agp-version: [ 7.2.0, 7.3.1 ]
177177

178178
steps:
@@ -204,7 +204,7 @@ jobs:
204204
# solution.
205205
fail-fast: false
206206
matrix:
207-
kotlin-version: [ 2.1.21 ]
207+
kotlin-version: [ 2.2.0 ]
208208

209209
steps:
210210
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### Added
66

77
### Changed
8+
- Upgrade Kotlin to `2.2.0`
89

910
### Deprecated
1011

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
javax.inject:javax.inject:1
2-
org.jetbrains.kotlin:kotlin-stdlib:2.1.21
2+
org.jetbrains.kotlin:kotlin-stdlib:2.2.0
33
org.jetbrains:annotations:13.0
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
org.jetbrains.kotlin:kotlin-stdlib:2.1.21
1+
org.jetbrains.kotlin:kotlin-stdlib:2.2.0
22
org.jetbrains:annotations:13.0

build-logic/conventions/src/main/kotlin/com/squareup/anvil/conventions/BasePlugin.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,13 @@ abstract class BasePlugin : Plugin<Project> {
5959

6060
target.tasks.withType(KotlinCompile::class.java).configureEach { task ->
6161
task.compilerOptions {
62+
// Disabled for now because of a languageVersion 1.9 warning that cannot be suppressed and
63+
// causes nearly all tests to fail. See the following links for context + tracking the fix:
64+
// https://kotlinlang.slack.com/archives/C7L3JB43G/p1750705742065189?thread_ts=1750704310.270049&cid=C7L3JB43G
65+
// https://youtrack.jetbrains.com/issue/KT-78277/Dont-use-MessageCollector-for-reporting-diagnostics-across-the-compiler
66+
// TODO: Re-enable warnings as errors once KT-78277 is resolved
6267
allWarningsAsErrors.set(
63-
target.libs.versions.config.warningsAsErrors.get().toBoolean() ||
64-
extension.warningsAsErrors.get(),
68+
false
6569
)
6670

6771
val sourceSetName = task.sourceSetName.getOrElse(

compiler-api/api/compiler-api.api

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,10 @@ public final class com/squareup/anvil/compiler/api/ComponentMergingBackend : jav
6565
}
6666

6767
public abstract interface class com/squareup/anvil/compiler/api/FileWithContent : java/lang/Comparable {
68-
public abstract fun compareTo (Lcom/squareup/anvil/compiler/api/FileWithContent;)I
69-
public abstract fun component1 ()Ljava/io/File;
70-
public abstract fun component2 ()Ljava/lang/String;
68+
public fun compareTo (Lcom/squareup/anvil/compiler/api/FileWithContent;)I
69+
public synthetic fun compareTo (Ljava/lang/Object;)I
70+
public fun component1 ()Ljava/io/File;
71+
public fun component2 ()Ljava/lang/String;
7172
public abstract fun getContent ()Ljava/lang/String;
7273
public abstract fun getFile ()Ljava/io/File;
7374
}
Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
org.jetbrains.intellij.deps:trove4j:1.0.20200330
2-
org.jetbrains.kotlin:kotlin-bom:2.1.21
3-
org.jetbrains.kotlin:kotlin-compiler-embeddable:2.1.21
4-
org.jetbrains.kotlin:kotlin-daemon-embeddable:2.1.21
5-
org.jetbrains.kotlin:kotlin-reflect:2.1.21
6-
org.jetbrains.kotlin:kotlin-script-runtime:2.1.21
7-
org.jetbrains.kotlin:kotlin-stdlib:2.1.21
1+
org.jetbrains.kotlin:kotlin-bom:2.2.0
2+
org.jetbrains.kotlin:kotlin-compiler-embeddable:2.2.0
3+
org.jetbrains.kotlin:kotlin-daemon-embeddable:2.2.0
4+
org.jetbrains.kotlin:kotlin-reflect:2.2.0
5+
org.jetbrains.kotlin:kotlin-script-runtime:2.2.0
6+
org.jetbrains.kotlin:kotlin-stdlib:2.2.0
87
org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.8.0
98
org.jetbrains:annotations:13.0

compiler-utils/api/compiler-utils.api

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public final class com/squareup/anvil/compiler/internal/UtilsKt {
5858

5959
public abstract interface class com/squareup/anvil/compiler/internal/reference/AnnotatedReference {
6060
public abstract fun getAnnotations ()Ljava/util/List;
61-
public abstract fun isAnnotatedWith (Lorg/jetbrains/kotlin/name/FqName;)Z
61+
public fun isAnnotatedWith (Lorg/jetbrains/kotlin/name/FqName;)Z
6262
}
6363

6464
public final class com/squareup/anvil/compiler/internal/reference/AnnotatedReference$DefaultImpls {
@@ -164,6 +164,7 @@ public abstract interface class com/squareup/anvil/compiler/internal/reference/A
164164
public abstract fun getTopLevelPropertyReferences (Lorg/jetbrains/kotlin/psi/KtFile;)Ljava/util/List;
165165
public abstract fun resolveClassIdOrNull (Lorg/jetbrains/kotlin/name/ClassId;)Lorg/jetbrains/kotlin/name/FqName;
166166
public abstract fun resolveFqNameOrNull (Lorg/jetbrains/kotlin/name/FqName;Lorg/jetbrains/kotlin/incremental/components/LookupLocation;)Lorg/jetbrains/kotlin/descriptors/ClassDescriptor;
167+
public static synthetic fun resolveFqNameOrNull$default (Lcom/squareup/anvil/compiler/internal/reference/AnvilModuleDescriptor;Lorg/jetbrains/kotlin/name/FqName;Lorg/jetbrains/kotlin/incremental/components/LookupLocation;ILjava/lang/Object;)Lorg/jetbrains/kotlin/descriptors/ClassDescriptor;
167168
public abstract fun resolvePropertyReferenceOrNull (Lorg/jetbrains/kotlin/name/FqName;)Lcom/squareup/anvil/compiler/internal/reference/PropertyReference;
168169
public abstract fun resolveTypeAliasFqNameOrNull (Lorg/jetbrains/kotlin/name/FqName;)Lorg/jetbrains/kotlin/descriptors/TypeAliasDescriptor;
169170
}
@@ -297,9 +298,9 @@ public final class com/squareup/anvil/compiler/internal/reference/ClassReference
297298
public abstract interface class com/squareup/anvil/compiler/internal/reference/FunctionReference {
298299
public abstract fun getFqName ()Lorg/jetbrains/kotlin/name/FqName;
299300
public abstract fun getModule ()Lcom/squareup/anvil/compiler/internal/reference/AnvilModuleDescriptor;
300-
public abstract fun getName ()Ljava/lang/String;
301+
public fun getName ()Ljava/lang/String;
301302
public abstract fun getParameters ()Ljava/util/List;
302-
public abstract fun returnType ()Lcom/squareup/anvil/compiler/internal/reference/TypeReference;
303+
public fun returnType ()Lcom/squareup/anvil/compiler/internal/reference/TypeReference;
303304
public abstract fun returnTypeOrNull ()Lcom/squareup/anvil/compiler/internal/reference/TypeReference;
304305
public abstract fun visibility ()Lcom/squareup/anvil/compiler/internal/reference/Visibility;
305306
}
@@ -481,7 +482,7 @@ public abstract interface class com/squareup/anvil/compiler/internal/reference/P
481482
public abstract fun getName ()Ljava/lang/String;
482483
public abstract fun getSetterAnnotations ()Ljava/util/List;
483484
public abstract fun isLateinit ()Z
484-
public abstract fun type ()Lcom/squareup/anvil/compiler/internal/reference/TypeReference;
485+
public fun type ()Lcom/squareup/anvil/compiler/internal/reference/TypeReference;
485486
public abstract fun typeOrNull ()Lcom/squareup/anvil/compiler/internal/reference/TypeReference;
486487
public abstract fun visibility ()Lcom/squareup/anvil/compiler/internal/reference/Visibility;
487488
}

compiler-utils/dependencies/runtimeClasspath.txt

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@ com.squareup:kotlinpoet-jvm:2.2.0
33
com.squareup:kotlinpoet:2.2.0
44
jakarta.inject:jakarta.inject-api:2.0.1
55
javax.inject:javax.inject:1
6-
org.jetbrains.intellij.deps:trove4j:1.0.20200330
7-
org.jetbrains.kotlin:kotlin-bom:2.1.21
8-
org.jetbrains.kotlin:kotlin-compiler-embeddable:2.1.21
9-
org.jetbrains.kotlin:kotlin-daemon-embeddable:2.1.21
10-
org.jetbrains.kotlin:kotlin-reflect:2.1.21
11-
org.jetbrains.kotlin:kotlin-script-runtime:2.1.21
12-
org.jetbrains.kotlin:kotlin-stdlib:2.1.21
6+
org.jetbrains.kotlin:kotlin-bom:2.2.0
7+
org.jetbrains.kotlin:kotlin-compiler-embeddable:2.2.0
8+
org.jetbrains.kotlin:kotlin-daemon-embeddable:2.2.0
9+
org.jetbrains.kotlin:kotlin-reflect:2.2.0
10+
org.jetbrains.kotlin:kotlin-script-runtime:2.2.0
11+
org.jetbrains.kotlin:kotlin-stdlib:2.2.0
1312
org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.8.0
1413
org.jetbrains:annotations:13.0
1514
org.jspecify:jspecify:1.0.0

compiler-utils/dependencies/testFixturesRuntimeClasspath.txt

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ com.google.guava:failureaccess:1.0.2
1313
com.google.guava:guava:33.2.1-android
1414
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
1515
com.google.truth:truth:1.4.4
16-
com.squareup.okio:okio-jvm:3.11.0
17-
com.squareup.okio:okio:3.11.0
16+
com.squareup.okio:okio-jvm:3.15.0
17+
com.squareup.okio:okio:3.15.0
1818
com.squareup:javapoet:1.13.0
1919
com.squareup:kotlinpoet-jvm:2.2.0
2020
com.squareup:kotlinpoet:2.2.0
21-
dev.zacsweers.kctfork:core:0.7.1
22-
io.github.classgraph:classgraph:4.8.179
21+
dev.zacsweers.kctfork:core:0.8.0
22+
io.github.classgraph:classgraph:4.8.180
2323
jakarta.inject:jakarta.inject-api:2.0.1
2424
javax.annotation:jsr250-api:1.0
2525
javax.inject:javax.inject:1
@@ -28,15 +28,13 @@ net.ltgt.gradle.incap:incap:0.2
2828
org.checkerframework:checker-compat-qual:2.5.3
2929
org.checkerframework:checker-qual:3.42.0
3030
org.hamcrest:hamcrest-core:1.3
31-
org.jetbrains.intellij.deps:trove4j:1.0.20200330
32-
org.jetbrains.kotlin:kotlin-annotation-processing-compiler:2.1.10
33-
org.jetbrains.kotlin:kotlin-annotation-processing-embeddable:2.1.10
34-
org.jetbrains.kotlin:kotlin-bom:2.1.21
35-
org.jetbrains.kotlin:kotlin-compiler-embeddable:2.1.21
36-
org.jetbrains.kotlin:kotlin-daemon-embeddable:2.1.21
37-
org.jetbrains.kotlin:kotlin-reflect:2.1.21
38-
org.jetbrains.kotlin:kotlin-script-runtime:2.1.21
39-
org.jetbrains.kotlin:kotlin-stdlib:2.1.21
31+
org.jetbrains.kotlin:kotlin-annotation-processing-embeddable:2.2.0
32+
org.jetbrains.kotlin:kotlin-bom:2.2.0
33+
org.jetbrains.kotlin:kotlin-compiler-embeddable:2.2.0
34+
org.jetbrains.kotlin:kotlin-daemon-embeddable:2.2.0
35+
org.jetbrains.kotlin:kotlin-reflect:2.2.0
36+
org.jetbrains.kotlin:kotlin-script-runtime:2.2.0
37+
org.jetbrains.kotlin:kotlin-stdlib:2.2.0
4038
org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.8.0
4139
org.jetbrains:annotations:13.0
4240
org.jspecify:jspecify:1.0.0

0 commit comments

Comments
 (0)