diff options
-rw-r--r-- | gradle-plugin/src/main/kotlin/com/google/devtools/ksp/gradle/KspSubplugin.kt | 3 | ||||
-rw-r--r-- | integration-tests/src/test/kotlin/com/google/devtools/ksp/test/PlaygroundIT.kt | 13 |
2 files changed, 16 insertions, 0 deletions
diff --git a/gradle-plugin/src/main/kotlin/com/google/devtools/ksp/gradle/KspSubplugin.kt b/gradle-plugin/src/main/kotlin/com/google/devtools/ksp/gradle/KspSubplugin.kt index 73eb242a..1e664f3c 100644 --- a/gradle-plugin/src/main/kotlin/com/google/devtools/ksp/gradle/KspSubplugin.kt +++ b/gradle-plugin/src/main/kotlin/com/google/devtools/ksp/gradle/KspSubplugin.kt @@ -577,6 +577,7 @@ abstract class KspTaskJvm @Inject constructor( args.addPluginOptions(options.get()) args.destinationAsFile = destination args.allowNoSourceFiles = true + args.useFir = false } // Overrding an internal function is hacky. @@ -671,6 +672,7 @@ abstract class KspTaskJS @Inject constructor( args.addPluginOptions(options.get()) args.outputFile = File(destination, "dummyOutput.js").canonicalPath kotlinOptions.copyFreeCompilerArgsToArgs(args) + args.useFir = false } // Overrding an internal function is hacky. @@ -750,6 +752,7 @@ abstract class KspTaskMetadata @Inject constructor( args.friendPaths = friendPaths.files.map { it.absolutePath }.toTypedArray() args.refinesPaths = refinesMetadataPaths.map { it.absolutePath }.toTypedArray() args.expectActualLinker = true + args.useFir = false } // Overrding an internal function is hacky. diff --git a/integration-tests/src/test/kotlin/com/google/devtools/ksp/test/PlaygroundIT.kt b/integration-tests/src/test/kotlin/com/google/devtools/ksp/test/PlaygroundIT.kt index 2e746a21..c5f56898 100644 --- a/integration-tests/src/test/kotlin/com/google/devtools/ksp/test/PlaygroundIT.kt +++ b/integration-tests/src/test/kotlin/com/google/devtools/ksp/test/PlaygroundIT.kt @@ -131,4 +131,17 @@ class PlaygroundIT { Assert.assertTrue(result.output.contains("kotlin.io.FileAlreadyExistsException")) } } + + // Test -Xuse-fir for compilation; KSP still uses FE1.0 + @Test + fun testFirPreview() { + val gradleProperties = File(project.root, "gradle.properties") + gradleProperties.appendText("\nkotlin.useFir=true") + val gradleRunner = GradleRunner.create().withProjectDir(project.root) + gradleRunner.buildAndCheck("clean", "build") { result -> + Assert.assertTrue(result.output.contains("This build uses in-dev FIR")) + Assert.assertTrue(result.output.contains("-Xuse-fir")) + } + project.restore(gradleProperties.path) + } } |