Skip to content

Commit

Permalink
Kotlin & KSP 2.1.10 (#2029)
Browse files Browse the repository at this point in the history
* Kotlin & KSP 2.1.10

KSP 2.1.0-1.0.29

kct 0.7.0

* Skip TestProcessorTest on JDK 8
  • Loading branch information
Egorand authored Feb 14, 2025
1 parent 527e851 commit 60a89a1
Show file tree
Hide file tree
Showing 6 changed files with 136 additions and 117 deletions.
6 changes: 3 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
# limitations under the License.

[versions]
kotlin = "2.0.10"
kct = "0.5.1"
ksp = "2.0.0-1.0.22"
kotlin = "2.1.10"
kct = "0.7.0"
ksp = "2.1.10-1.0.30"
ktlint = "0.48.2"

[plugins]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import com.tschuchort.compiletesting.configureKsp
import com.tschuchort.compiletesting.kspProcessorOptions
import com.tschuchort.compiletesting.kspSourcesDir
import java.io.File
import org.junit.Assume.assumeFalse
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.rules.TemporaryFolder
Expand All @@ -47,6 +49,15 @@ class TestProcessorTest(private val useKsp2: Boolean) {
@JvmField
val temporaryFolder: TemporaryFolder = TemporaryFolder()

@Before
fun skipOnJdk8() {
val javaVersion = System.getProperty("java.version") ?: return // Don't skip if version unknown.
assumeFalse(
"These tests currently fail on JDK 8 when useKsp2 == false",
javaVersion.startsWith("1.8") && !useKsp2,
)
}

@Test
fun smokeTest() {
val compilation = prepareCompilation(
Expand Down Expand Up @@ -577,19 +588,35 @@ class TestProcessorTest(private val useKsp2: Boolean) {
assertThat(result.exitCode).isEqualTo(KotlinCompilation.ExitCode.OK)
val generatedFileText = File(compilation.kspSourcesDir, "kotlin/test/TestTransitiveAliases.kt")
.readText()
assertThat(generatedFileText).isEqualTo(
"""
package test
if (useKsp2) {
assertThat(generatedFileText).isEqualTo(
"""
package test
import kotlin.Int
import kotlin.Unit
import kotlin.Int
import kotlin.Unit
public class TestTransitiveAliases {
public fun <T : Alias41<Alias23, out Alias77<Alias73<Int>>>> bar(vararg arg1: T): Unit = TODO()
}
public class TestTransitiveAliases {
public fun <T : Alias41<Alias43<Alias23>, Alias47<out Alias77<Alias73<Int>>>>> bar(vararg arg1: T): Unit = TODO()
}
""".trimIndent(),
)
""".trimIndent(),
)
} else {
assertThat(generatedFileText).isEqualTo(
"""
package test
import kotlin.Int
import kotlin.Unit
public class TestTransitiveAliases {
public fun <T : Alias41<Alias23, out Alias77<Alias73<Int>>>> bar(vararg arg1: T): Unit = TODO()
}
""".trimIndent(),
)
}
}

@Test
Expand Down
Loading

0 comments on commit 60a89a1

Please sign in to comment.