Skip to content

Commit 6fb3ea5

Browse files
ting-yuanneetopia
authored andcommitted
UPDATE_KOTLIN_VERSION: 2.0.0-dev-4562
(cherry picked from commit 4e40883)
1 parent ebb2333 commit 6fb3ea5

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

compiler-plugin/src/main/kotlin/com/google/devtools/ksp/symbol/impl/binary/KSDeclarationDescriptorImpl.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ package com.google.devtools.ksp.symbol.impl.binary
2020
import com.google.devtools.ksp.memoized
2121
import com.google.devtools.ksp.processing.impl.KSNameImpl
2222
import com.google.devtools.ksp.symbol.*
23-
import org.jetbrains.kotlin.backend.common.serialization.findPackage
2423
import org.jetbrains.kotlin.descriptors.ClassDescriptor
2524
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
2625
import org.jetbrains.kotlin.descriptors.FunctionDescriptor
26+
import org.jetbrains.kotlin.descriptors.findPackage
2727
import org.jetbrains.kotlin.load.java.descriptors.JavaClassDescriptor
2828
import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameSafe
2929
import org.jetbrains.kotlin.resolve.descriptorUtil.parents
@@ -50,7 +50,7 @@ abstract class KSDeclarationDescriptorImpl(private val descriptor: DeclarationDe
5050
is ClassDescriptor -> KSClassDeclarationDescriptorImpl.getCached(containingDescriptor)
5151
is FunctionDescriptor -> KSFunctionDeclarationDescriptorImpl.getCached(containingDescriptor)
5252
else -> null
53-
} as KSDeclaration?
53+
}
5454
}
5555

5656
override val parent: KSNode? by lazy {

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copied from kotlinc
22
org.gradle.jvmargs=-Duser.country=US -Dkotlin.daemon.jvm.options=-Xmx2200m -Dfile.encoding=UTF-8
33

4-
kotlinBaseVersion=1.9.30-dev-2548
4+
kotlinBaseVersion=2.0.0-dev-4562
55
agpBaseVersion=7.0.0
66
intellijVersion=213.7172.25
77
junitVersion=4.13.1

integration-tests/src/test/kotlin/com/google/devtools/ksp/test/KSPCmdLineOptionsIT.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ class KSPCmdLineOptionsIT(val useKSP2: Boolean) {
3838
}.maxByOrNull { it.lastModified() }!!
3939
val compilerArgs = mutableListOf(
4040
"-no-stdlib",
41+
"-language-version", "1.9",
4142
"-Xplugin=${kspPluginJar.absolutePath}",
4243
"-Xplugin=${kspApiJar.absolutePath}",
4344
"-P", "plugin:$kspPluginId:apclasspath=${processorJar.absolutePath}",

integration-tests/src/test/kotlin/com/google/devtools/ksp/test/PlaygroundIT.kt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,6 @@ class PlaygroundIT(val useKSP2: Boolean) {
223223
Assert.assertTrue(jarFile.getEntry("hello/HELLO.class").size > 0)
224224
Assert.assertTrue(jarFile.getEntry("com/example/AClassBuilder.class").size > 0)
225225
}
226-
Assert.assertTrue(result.output.contains("w: Language version 2.0 is experimental"))
227226
project.restore(buildFile.path)
228227
}
229228

@@ -263,7 +262,6 @@ class PlaygroundIT(val useKSP2: Boolean) {
263262
Assert.assertTrue(jarFile.getEntry("hello/HELLO.class").size > 0)
264263
Assert.assertTrue(jarFile.getEntry("com/example/AClassBuilder.class").size > 0)
265264
}
266-
Assert.assertTrue(result.output.contains("w: Language version 2.0 is experimental"))
267265
project.restore(buildFile.path)
268266
project.restore(gradleProperties.path)
269267
}
@@ -283,7 +281,10 @@ class PlaygroundIT(val useKSP2: Boolean) {
283281
gradleRunner.buildAndCheck("clean", "build") { result ->
284282
Assert.assertTrue(result.output.contains("language version: 1.5"))
285283
Assert.assertTrue(result.output.contains("api version: 1.5"))
286-
Assert.assertTrue(result.output.contains("compiler version: $kotlinVersion"))
284+
if (!useKSP2) {
285+
// In case KSP 1 and KSP 2 uses different compiler versions, ignore this test for KSP 2 for now.
286+
Assert.assertTrue(result.output.contains("compiler version: $kotlinVersion"))
287+
}
287288
}
288289
project.restore(buildFile.path)
289290
}
@@ -299,12 +300,12 @@ class PlaygroundIT(val useKSP2: Boolean) {
299300
gradleRunner.withArguments("build").buildAndFail().let {
300301
Assert.assertEquals(TaskOutcome.SUCCESS, it.task(":workload:kspKotlin")?.outcome)
301302
Assert.assertEquals(TaskOutcome.FAILED, it.task(":workload:compileKotlin")?.outcome)
302-
Assert.assertTrue("Unresolved reference: AClassBuilder" in it.output)
303+
Assert.assertTrue("Unresolved reference 'AClassBuilder'" in it.output)
303304
}
304305
gradleRunner.withArguments("build").buildAndFail().let {
305306
Assert.assertEquals(TaskOutcome.UP_TO_DATE, it.task(":workload:kspKotlin")?.outcome)
306307
Assert.assertEquals(TaskOutcome.FAILED, it.task(":workload:compileKotlin")?.outcome)
307-
Assert.assertTrue("Unresolved reference: AClassBuilder" in it.output)
308+
Assert.assertTrue("Unresolved reference 'AClassBuilder'" in it.output)
308309
}
309310

310311
project.restore("workload/build.gradle.kts")

0 commit comments

Comments
 (0)