Skip to content

Commit

Permalink
UPDATE_KOTLIN_VERSION: 2.0.0-dev-4562
Browse files Browse the repository at this point in the history
(cherry picked from commit 4e40883)
  • Loading branch information
ting-yuan authored and neetopia committed Jan 18, 2024
1 parent ebb2333 commit 6fb3ea5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ package com.google.devtools.ksp.symbol.impl.binary
import com.google.devtools.ksp.memoized
import com.google.devtools.ksp.processing.impl.KSNameImpl
import com.google.devtools.ksp.symbol.*
import org.jetbrains.kotlin.backend.common.serialization.findPackage
import org.jetbrains.kotlin.descriptors.ClassDescriptor
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
import org.jetbrains.kotlin.descriptors.FunctionDescriptor
import org.jetbrains.kotlin.descriptors.findPackage
import org.jetbrains.kotlin.load.java.descriptors.JavaClassDescriptor
import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameSafe
import org.jetbrains.kotlin.resolve.descriptorUtil.parents
Expand All @@ -50,7 +50,7 @@ abstract class KSDeclarationDescriptorImpl(private val descriptor: DeclarationDe
is ClassDescriptor -> KSClassDeclarationDescriptorImpl.getCached(containingDescriptor)
is FunctionDescriptor -> KSFunctionDeclarationDescriptorImpl.getCached(containingDescriptor)
else -> null
} as KSDeclaration?
}
}

override val parent: KSNode? by lazy {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copied from kotlinc
org.gradle.jvmargs=-Duser.country=US -Dkotlin.daemon.jvm.options=-Xmx2200m -Dfile.encoding=UTF-8

kotlinBaseVersion=1.9.30-dev-2548
kotlinBaseVersion=2.0.0-dev-4562
agpBaseVersion=7.0.0
intellijVersion=213.7172.25
junitVersion=4.13.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class KSPCmdLineOptionsIT(val useKSP2: Boolean) {
}.maxByOrNull { it.lastModified() }!!
val compilerArgs = mutableListOf(
"-no-stdlib",
"-language-version", "1.9",
"-Xplugin=${kspPluginJar.absolutePath}",
"-Xplugin=${kspApiJar.absolutePath}",
"-P", "plugin:$kspPluginId:apclasspath=${processorJar.absolutePath}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,6 @@ class PlaygroundIT(val useKSP2: Boolean) {
Assert.assertTrue(jarFile.getEntry("hello/HELLO.class").size > 0)
Assert.assertTrue(jarFile.getEntry("com/example/AClassBuilder.class").size > 0)
}
Assert.assertTrue(result.output.contains("w: Language version 2.0 is experimental"))
project.restore(buildFile.path)
}

Expand Down Expand Up @@ -263,7 +262,6 @@ class PlaygroundIT(val useKSP2: Boolean) {
Assert.assertTrue(jarFile.getEntry("hello/HELLO.class").size > 0)
Assert.assertTrue(jarFile.getEntry("com/example/AClassBuilder.class").size > 0)
}
Assert.assertTrue(result.output.contains("w: Language version 2.0 is experimental"))
project.restore(buildFile.path)
project.restore(gradleProperties.path)
}
Expand All @@ -283,7 +281,10 @@ class PlaygroundIT(val useKSP2: Boolean) {
gradleRunner.buildAndCheck("clean", "build") { result ->
Assert.assertTrue(result.output.contains("language version: 1.5"))
Assert.assertTrue(result.output.contains("api version: 1.5"))
Assert.assertTrue(result.output.contains("compiler version: $kotlinVersion"))
if (!useKSP2) {
// In case KSP 1 and KSP 2 uses different compiler versions, ignore this test for KSP 2 for now.
Assert.assertTrue(result.output.contains("compiler version: $kotlinVersion"))
}
}
project.restore(buildFile.path)
}
Expand All @@ -299,12 +300,12 @@ class PlaygroundIT(val useKSP2: Boolean) {
gradleRunner.withArguments("build").buildAndFail().let {
Assert.assertEquals(TaskOutcome.SUCCESS, it.task(":workload:kspKotlin")?.outcome)
Assert.assertEquals(TaskOutcome.FAILED, it.task(":workload:compileKotlin")?.outcome)
Assert.assertTrue("Unresolved reference: AClassBuilder" in it.output)
Assert.assertTrue("Unresolved reference 'AClassBuilder'" in it.output)
}
gradleRunner.withArguments("build").buildAndFail().let {
Assert.assertEquals(TaskOutcome.UP_TO_DATE, it.task(":workload:kspKotlin")?.outcome)
Assert.assertEquals(TaskOutcome.FAILED, it.task(":workload:compileKotlin")?.outcome)
Assert.assertTrue("Unresolved reference: AClassBuilder" in it.output)
Assert.assertTrue("Unresolved reference 'AClassBuilder'" in it.output)
}

project.restore("workload/build.gradle.kts")
Expand Down

0 comments on commit 6fb3ea5

Please sign in to comment.