@@ -15,7 +15,7 @@ import kotlin.test.assertEquals
15
15
class LanguageVersionTests {
16
16
@Test
17
17
fun `compiling with 1_5 features with Kotlin 1_5 is working` () {
18
- withProject(kotlinLanguageVersion = " 1.5 " , apolloLanguageVersion = " 1.5" ) { dir ->
18
+ withProject(kotlinLanguageVersion = " org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_5 " , apolloLanguageVersion = " 1.5" ) { dir ->
19
19
dir.disableIsolatedProjects() // old KGP versions do not support isolated projects
20
20
TestUtils .executeGradleWithVersion(dir, " 8.10" , " :assemble" ).apply {
21
21
assertEquals(TaskOutcome .SUCCESS , task(" :assemble" )!! .outcome)
@@ -25,7 +25,7 @@ class LanguageVersionTests {
25
25
26
26
@Test
27
27
fun `compiling with 1_5 features with Kotlin 1_4 is not working` () {
28
- withProject(kotlinLanguageVersion = " 1.4 " , apolloLanguageVersion = " 1.5" ) { dir ->
28
+ withProject(kotlinLanguageVersion = " org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_4 " , apolloLanguageVersion = " 1.5" ) { dir ->
29
29
try {
30
30
TestUtils .executeGradleWithVersion(dir, " 8.10" , " :assemble" )
31
31
Assert .fail(" Compiling with incompatible languageVersion should fail" )
@@ -37,7 +37,7 @@ class LanguageVersionTests {
37
37
38
38
@Test
39
39
fun `using bogus languageVersion fails` () {
40
- withProject(kotlinLanguageVersion = " 1.5 " , apolloLanguageVersion = " 3.14" ) { dir ->
40
+ withProject(kotlinLanguageVersion = " org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_5 " , apolloLanguageVersion = " 3.14" ) { dir ->
41
41
try {
42
42
TestUtils .executeGradleWithVersion(dir, " 8.10" , " :assemble" )
43
43
Assert .fail(" Compiling with incompatible languageVersion should fail" )
@@ -98,9 +98,9 @@ class LanguageVersionTests {
98
98
): String {
99
99
val kotlinConfiguration = """
100
100
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
101
- kotlinOptions {
102
- ${if (kotlinLanguageVersion == null ) " " else " languageVersion = \" $kotlinLanguageVersion \" " }
103
- ${if (kotlinApiVersion == null ) " " else " apiVersion = \" $kotlinApiVersion \" " }
101
+ compilerOptions {
102
+ ${if (kotlinLanguageVersion == null ) " " else " languageVersion.set( $kotlinLanguageVersion ) " }
103
+ ${if (kotlinApiVersion == null ) " " else " apiVersion.set( \" $kotlinApiVersion \" ) " }
104
104
}
105
105
}
106
106
""" .trimIndent()
0 commit comments