Skip to content

Commit

Permalink
UPDATE_KOTLIN_VERSION: 1.7.0-RC
Browse files Browse the repository at this point in the history
  • Loading branch information
neetopia committed May 20, 2022
1 parent 9cb7b30 commit 1b0fd83
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ internal class Configurator : AbstractKotlinCompileConfig<AbstractKotlinCompile<
constructor(compilation: KotlinCompilationData<*>, kotlinCompile: AbstractKotlinCompile<*>) : super(compilation) {
configureTask { task ->
if (task is KspTaskJvm) {
// Assign moduleName different from kotlin compilation to
// Assign ownModuleName different from kotlin compilation to
// work around https://github.com/google/ksp/issues/647
// This will not be necessary once https://youtrack.jetbrains.com/issue/KT-45777 lands
task.moduleName.value(kotlinCompile.moduleName.map { "$it-ksp" })
task.ownModuleName.value(kotlinCompile.ownModuleName.map { "$it-ksp" })
}
if (task is KspTaskJS) {
val libraryCacheService = project.rootProject.gradle.sharedServices.registerIfAbsent(
Expand Down Expand Up @@ -624,7 +624,7 @@ abstract class KspTaskJvm @Inject constructor(
args.addPluginOptions(options.get())
args.destinationAsFile = destination
args.allowNoSourceFiles = true
args.useFir = false
args.useK2 = false
}

// Overrding an internal function is hacky.
Expand Down Expand Up @@ -743,7 +743,7 @@ abstract class KspTaskJS @Inject constructor(
args.addPluginOptions(options.get())
args.outputFile = File(destination, "dummyOutput.js").canonicalPath
kotlinOptions.copyFreeCompilerArgsToArgs(args)
args.useFir = false
args.useK2 = false
}

// Overrding an internal function is hacky.
Expand Down Expand Up @@ -832,7 +832,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
args.useK2 = false
}

// Overrding an internal function is hacky.
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.7.0-Beta
kotlinBaseVersion=1.7.0-RC
agpBaseVersion=7.0.0
intellijVersion=203.8084.24
junitVersion=4.12
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import org.gradle.testkit.runner.GradleRunner
import org.gradle.testkit.runner.TaskOutcome
import org.junit.Assert
import org.junit.Assume
import org.junit.Ignore
import org.junit.Rule
import org.junit.Test
import java.io.File
Expand Down Expand Up @@ -147,15 +148,17 @@ class PlaygroundIT {
}
}

// Disabled for now: ERROR: K2 does not support plugins yet, so please remove -Xuse-k2 flag
// Test -Xuse-fir for compilation; KSP still uses FE1.0
@Ignore
@Test
fun testFirPreview() {
val gradleProperties = File(project.root, "gradle.properties")
gradleProperties.appendText("\nkotlin.useFir=true")
gradleProperties.appendText("\nkotlin.useK2=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"))
Assert.assertTrue(result.output.contains("This build uses experimental K2 compiler"))
Assert.assertTrue(result.output.contains("-Xuse-k2"))
}
project.restore(gradleProperties.path)
}
Expand Down

0 comments on commit 1b0fd83

Please sign in to comment.