KT-52217 Rename 'use-fir' to 'use-k2', update message
This commit is contained in:
+4
-3
@@ -294,10 +294,11 @@ abstract class CommonCompilerArguments : CommonToolArguments() {
|
||||
|
||||
@GradleOption(DefaultValues.BooleanFalseDefault::class)
|
||||
@Argument(
|
||||
value = "-Xuse-fir",
|
||||
description = "Compile using Front-end IR. Warning: this feature is far from being production-ready"
|
||||
value = "-Xuse-k2",
|
||||
deprecatedName = "-Xuse-fir",
|
||||
description = "Compile using experimental K2. K2 is a new compiler pipeline, no compatibility guarantees are yet provided"
|
||||
)
|
||||
var useFir: Boolean by FreezableVar(false)
|
||||
var useK2: Boolean by FreezableVar(false)
|
||||
|
||||
@Argument(
|
||||
value = "-Xuse-fir-extended-checkers",
|
||||
|
||||
+1
-1
@@ -528,7 +528,7 @@ Also sets `-jvm-target` value equal to the selected JDK version"""
|
||||
result[JvmAnalysisFlags.sanitizeParentheses] = sanitizeParentheses
|
||||
result[JvmAnalysisFlags.suppressMissingBuiltinsError] = suppressMissingBuiltinsError
|
||||
result[JvmAnalysisFlags.enableJvmPreview] = enableJvmPreview
|
||||
result[AnalysisFlags.allowUnstableDependencies] = allowUnstableDependencies || useFir
|
||||
result[AnalysisFlags.allowUnstableDependencies] = allowUnstableDependencies || useK2
|
||||
result[JvmAnalysisFlags.disableUltraLightClasses] = disableUltraLightClasses
|
||||
result[JvmAnalysisFlags.useIR] = !useOldBackend
|
||||
return result
|
||||
|
||||
@@ -22,7 +22,7 @@ fun <A : CommonCompilerArguments> CompilerConfiguration.setupCommonArguments(
|
||||
createMetadataVersion: ((IntArray) -> BinaryVersion)? = null
|
||||
) {
|
||||
put(CommonConfigurationKeys.DISABLE_INLINE, arguments.noInline)
|
||||
put(CommonConfigurationKeys.USE_FIR, arguments.useFir)
|
||||
put(CommonConfigurationKeys.USE_FIR, arguments.useK2)
|
||||
put(CommonConfigurationKeys.USE_FIR_EXTENDED_CHECKERS, arguments.useFirExtendedCheckers)
|
||||
put(CommonConfigurationKeys.EXPECT_ACTUAL_LINKER, arguments.expectActualLinker)
|
||||
putIfNotNull(CLIConfigurationKeys.INTELLIJ_PLUGIN_ROOT, arguments.intellijPluginRoot)
|
||||
|
||||
+1
-1
@@ -82,7 +82,7 @@ object FirKotlinToJvmBytecodeCompiler {
|
||||
|
||||
messageCollector.report(
|
||||
STRONG_WARNING,
|
||||
"ATTENTION!\n This build uses in-dev FIR: \n -Xuse-fir"
|
||||
"ATTENTION!\n This build uses experimental K2 compiler: \n -Xuse-k2"
|
||||
)
|
||||
|
||||
projectConfiguration.get(ComponentRegistrar.PLUGIN_COMPONENT_REGISTRARS)?.let { pluginComponentRegistrars ->
|
||||
|
||||
@@ -97,7 +97,7 @@ fun compileModulesUsingFrontendIrAndLightTree(
|
||||
|
||||
messageCollector.report(
|
||||
CompilerMessageSeverity.STRONG_WARNING,
|
||||
"ATTENTION!\n This build uses in-dev FIR: \n -Xuse-fir"
|
||||
"ATTENTION!\n This build uses experimental K2 compiler: \n -Xuse-k2"
|
||||
)
|
||||
|
||||
val outputs = mutableListOf<GenerationState>()
|
||||
|
||||
@@ -230,7 +230,7 @@ fun CompilerConfiguration.configureAdvancedJvmOptions(arguments: K2JVMCompilerAr
|
||||
|
||||
// TODO: ignore previous configuration value when we do not need old backend in scripting by default
|
||||
val useOldBackend = arguments.useOldBackend || (!arguments.useIR && get(JVMConfigurationKeys.IR) == false)
|
||||
val useIR = arguments.useFir ||
|
||||
val useIR = arguments.useK2 ||
|
||||
if (languageVersionSettings.supportsFeature(LanguageFeature.JvmIrEnabledByDefault)) {
|
||||
!useOldBackend
|
||||
} else {
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ class FE1FullPipelineModularizedTest : AbstractFullPipelineModularizedTest() {
|
||||
override fun configureArguments(args: K2JVMCompilerArguments, moduleData: ModuleData) {
|
||||
args.useIR = USE_BE_IR
|
||||
args.useOldBackend = !USE_BE_IR
|
||||
args.useFir = false
|
||||
args.useK2 = false
|
||||
args.jvmDefault = "compatibility"
|
||||
args.apiVersion = "1.4"
|
||||
args.optIn = arrayOf(
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ private val LANGUAGE_VERSION: String = System.getProperty("fir.bench.language.ve
|
||||
class FullPipelineModularizedTest : AbstractFullPipelineModularizedTest() {
|
||||
|
||||
override fun configureArguments(args: K2JVMCompilerArguments, moduleData: ModuleData) {
|
||||
args.useFir = true
|
||||
args.useK2 = true
|
||||
args.useIR = true
|
||||
args.apiVersion = LANGUAGE_VERSION
|
||||
args.jvmDefault = "compatibility"
|
||||
|
||||
+2
-2
@@ -88,7 +88,7 @@ fun makeIncrementally(
|
||||
|
||||
withIC(args) {
|
||||
val compiler =
|
||||
if (args.useFir && args.useFirIC && args.useFirLT /* TODO: move LT check into runner */ )
|
||||
if (args.useK2 && args.useFirIC && args.useFirLT /* TODO: move LT check into runner */ )
|
||||
IncrementalFirJvmCompilerRunner(
|
||||
cachesDir, buildReporter, buildHistoryFile, emptyList(), EmptyModulesApiHistory, kotlinExtensions, ClasspathSnapshotDisabled
|
||||
)
|
||||
@@ -97,7 +97,7 @@ fun makeIncrementally(
|
||||
cachesDir,
|
||||
buildReporter,
|
||||
// Use precise setting in case of non-Gradle build
|
||||
usePreciseJavaTracking = !args.useFir, // TODO: add fir-based java classes tracker when available and set this to true
|
||||
usePreciseJavaTracking = !args.useK2, // TODO: add fir-based java classes tracker when available and set this to true
|
||||
outputFiles = emptyList(),
|
||||
buildHistoryFile = buildHistoryFile,
|
||||
modulesApiHistory = EmptyModulesApiHistory,
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ import java.io.File
|
||||
abstract class AbstractIncrementalFirICLightTreeJvmCompilerRunnerTest : AbstractIncrementalJvmCompilerRunnerTest() {
|
||||
override fun createCompilerArguments(destinationDir: File, testDir: File): K2JVMCompilerArguments =
|
||||
super.createCompilerArguments(destinationDir, testDir).apply {
|
||||
useFir = true
|
||||
useK2 = true
|
||||
useIR = true
|
||||
useFirIC = true
|
||||
useFirLT = true
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ import java.io.File
|
||||
abstract class AbstractIncrementalFirJvmCompilerRunnerTest : AbstractIncrementalJvmCompilerRunnerTest() {
|
||||
override fun createCompilerArguments(destinationDir: File, testDir: File): K2JVMCompilerArguments =
|
||||
super.createCompilerArguments(destinationDir, testDir).apply {
|
||||
useFir = true
|
||||
useK2 = true
|
||||
useIR = true
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ import java.io.File
|
||||
abstract class AbstractIncrementalFirLightTreeJvmCompilerRunnerTest : AbstractIncrementalJvmCompilerRunnerTest() {
|
||||
override fun createCompilerArguments(destinationDir: File, testDir: File): K2JVMCompilerArguments =
|
||||
super.createCompilerArguments(destinationDir, testDir).apply {
|
||||
useFir = true
|
||||
useK2 = true
|
||||
useIR = true
|
||||
useFirIC = false
|
||||
useFirLT = true
|
||||
|
||||
+1
-1
@@ -104,10 +104,10 @@ where advanced options include:
|
||||
-Xsuppress-version-warnings Suppress warnings about outdated, inconsistent or experimental language or API versions
|
||||
-Xunrestricted-builder-inference
|
||||
Eliminate builder inference restrictions like allowance of returning type variables of a builder inference call
|
||||
-Xuse-fir Compile using Front-end IR. Warning: this feature is far from being production-ready
|
||||
-Xuse-fir-extended-checkers Use extended analysis mode based on Front-end IR. Warning: this feature is far from being production-ready
|
||||
-Xuse-fir-ic Compile using Front-end IR internal incremental compilation cycle. Warning: this feature is far from being production-ready
|
||||
-Xuse-fir-lt Compile using LightTree parser with Front-end IR. Warning: this feature is far from being production-ready
|
||||
-Xuse-k2 Compile using experimental K2. K2 is a new compiler pipeline, no compatibility guarantees are yet provided
|
||||
-Xuse-mixed-named-arguments Enable Support named arguments in their own position even if the result appears as mixed
|
||||
-Xverbose-phases Be verbose while performing these backend phases
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
$TESTDATA_DIR$/conflictingProjection.kt
|
||||
-Xuse-fir
|
||||
-Xuse-k2
|
||||
-d
|
||||
$TEMP_DIR$
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
warning: ATTENTION!
|
||||
This build uses in-dev FIR:
|
||||
-Xuse-fir
|
||||
This build uses experimental K2 compiler:
|
||||
-Xuse-k2
|
||||
compiler/testData/cli/jvm/conflictingProjection.kt:10:19: error: projection is conflicting with variance of the corresponding type parameter of Out<in kotlin/Int>. Remove the projection or replace it with '*'
|
||||
fun a8(value: Out<in Int>) {}
|
||||
^
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
$TESTDATA_DIR$/extendedCheckers.kt
|
||||
-Xuse-fir
|
||||
-Xuse-k2
|
||||
-Xuse-fir-extended-checkers
|
||||
-d
|
||||
$TEMP_DIR$
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
warning: ATTENTION!
|
||||
This build uses in-dev FIR:
|
||||
-Xuse-fir
|
||||
This build uses experimental K2 compiler:
|
||||
-Xuse-k2
|
||||
compiler/testData/cli/jvm/extendedCheckers.kt:2:12: warning: redundant explicit type
|
||||
val i: Int = 1
|
||||
^
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
$TESTDATA_DIR$/extendedCheckersNoWarning.kt
|
||||
-Xuse-fir
|
||||
-Xuse-k2
|
||||
-Xuse-fir-extended-checkers
|
||||
-d
|
||||
$TEMP_DIR$
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
warning: ATTENTION!
|
||||
This build uses in-dev FIR:
|
||||
-Xuse-fir
|
||||
This build uses experimental K2 compiler:
|
||||
-Xuse-k2
|
||||
OK
|
||||
|
||||
+1
-1
@@ -210,10 +210,10 @@ where advanced options include:
|
||||
-Xsuppress-version-warnings Suppress warnings about outdated, inconsistent or experimental language or API versions
|
||||
-Xunrestricted-builder-inference
|
||||
Eliminate builder inference restrictions like allowance of returning type variables of a builder inference call
|
||||
-Xuse-fir Compile using Front-end IR. Warning: this feature is far from being production-ready
|
||||
-Xuse-fir-extended-checkers Use extended analysis mode based on Front-end IR. Warning: this feature is far from being production-ready
|
||||
-Xuse-fir-ic Compile using Front-end IR internal incremental compilation cycle. Warning: this feature is far from being production-ready
|
||||
-Xuse-fir-lt Compile using LightTree parser with Front-end IR. Warning: this feature is far from being production-ready
|
||||
-Xuse-k2 Compile using experimental K2. K2 is a new compiler pipeline, no compatibility guarantees are yet provided
|
||||
-Xuse-mixed-named-arguments Enable Support named arguments in their own position even if the result appears as mixed
|
||||
-Xverbose-phases Be verbose while performing these backend phases
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
$TESTDATA_DIR$/firError.kt
|
||||
-Xuse-fir
|
||||
-Xuse-k2
|
||||
-d
|
||||
$TEMP_DIR$
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
warning: ATTENTION!
|
||||
This build uses in-dev FIR:
|
||||
-Xuse-fir
|
||||
This build uses experimental K2 compiler:
|
||||
-Xuse-k2
|
||||
compiler/testData/cli/jvm/firError.kt:5:13: error: variable 'x' must be initialized
|
||||
println(x)
|
||||
^
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
$TESTDATA_DIR$/firHello.kt
|
||||
-Xuse-fir
|
||||
-Xuse-k2
|
||||
-d
|
||||
$TEMP_DIR$
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
warning: ATTENTION!
|
||||
This build uses in-dev FIR:
|
||||
-Xuse-fir
|
||||
This build uses experimental K2 compiler:
|
||||
-Xuse-k2
|
||||
OK
|
||||
|
||||
@@ -2,7 +2,7 @@ $TESTDATA_DIR$/firMultiplatformCompilationWithError/common.kt
|
||||
$TESTDATA_DIR$/firMultiplatformCompilationWithError/jvm.kt
|
||||
-Xcommon-sources
|
||||
$TESTDATA_DIR$/firMultiplatformCompilationWithError/common.kt
|
||||
-Xuse-fir
|
||||
-Xuse-k2
|
||||
-cp
|
||||
.
|
||||
-d
|
||||
|
||||
@@ -9,8 +9,8 @@ as no stability/compatibility guarantees are given on
|
||||
compiler or generated code. Use it at your own risk!
|
||||
|
||||
warning: ATTENTION!
|
||||
This build uses in-dev FIR:
|
||||
-Xuse-fir
|
||||
This build uses experimental K2 compiler:
|
||||
-Xuse-k2
|
||||
compiler/testData/cli/jvm/firMultiplatformCompilationWithError/jvm.kt:1:18: error: actual class 'public abstract actual interface A : R|kotlin/Any|' has no corresponding members for expected class members:
|
||||
|
||||
public abstract expect fun foo(): R|kotlin/Unit|
|
||||
|
||||
@@ -2,7 +2,7 @@ $TESTDATA_DIR$/firMultiplatformCompilationWithoutErrors/common.kt
|
||||
$TESTDATA_DIR$/firMultiplatformCompilationWithoutErrors/jvm.kt
|
||||
-Xcommon-sources
|
||||
$TESTDATA_DIR$/firMultiplatformCompilationWithoutErrors/common.kt
|
||||
-Xuse-fir
|
||||
-Xuse-k2
|
||||
-cp
|
||||
.
|
||||
-d
|
||||
|
||||
@@ -9,6 +9,6 @@ as no stability/compatibility guarantees are given on
|
||||
compiler or generated code. Use it at your own risk!
|
||||
|
||||
warning: ATTENTION!
|
||||
This build uses in-dev FIR:
|
||||
-Xuse-fir
|
||||
This build uses experimental K2 compiler:
|
||||
-Xuse-k2
|
||||
OK
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
$TESTDATA_DIR$/firStdlibDependency.kt
|
||||
-Xuse-fir
|
||||
-Xuse-k2
|
||||
-cp
|
||||
.
|
||||
-d
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
warning: ATTENTION!
|
||||
This build uses in-dev FIR:
|
||||
-Xuse-fir
|
||||
This build uses experimental K2 compiler:
|
||||
-Xuse-k2
|
||||
OK
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
$TESTDATA_DIR$/firVsClassicAnnotation.kt
|
||||
-classpath
|
||||
$TESTDATA_DIR$/firVsClassicAnnotation
|
||||
-Xuse-fir
|
||||
-Xuse-k2
|
||||
-d
|
||||
$TEMP_DIR$
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
warning: ATTENTION!
|
||||
This build uses in-dev FIR:
|
||||
-Xuse-fir
|
||||
This build uses experimental K2 compiler:
|
||||
-Xuse-k2
|
||||
OK
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
$TESTDATA_DIR$/inapplicableLateinitModifier.kt
|
||||
-Xuse-fir
|
||||
-Xuse-k2
|
||||
-d
|
||||
$TEMP_DIR$
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
warning: ATTENTION!
|
||||
This build uses in-dev FIR:
|
||||
-Xuse-fir
|
||||
This build uses experimental K2 compiler:
|
||||
-Xuse-k2
|
||||
compiler/testData/cli/jvm/inapplicableLateinitModifier.kt:6:1: error: 'lateinit' modifier is not allowed on delegated properties
|
||||
lateinit var kest by Delegate
|
||||
^
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
$TESTDATA_DIR$/instanceAccessBeforeSuperCall.kt
|
||||
-Xuse-fir
|
||||
-Xuse-k2
|
||||
-d
|
||||
$TEMP_DIR$
|
||||
@@ -1,6 +1,6 @@
|
||||
warning: ATTENTION!
|
||||
This build uses in-dev FIR:
|
||||
-Xuse-fir
|
||||
This build uses experimental K2 compiler:
|
||||
-Xuse-k2
|
||||
compiler/testData/cli/jvm/instanceAccessBeforeSuperCall.kt:2:26: error: unresolved reference: getSomeInt
|
||||
constructor(x: Int = getSomeInt(), other: A = this, header: String = keker) {}
|
||||
^
|
||||
|
||||
+1
-1
@@ -2,5 +2,5 @@ $TESTDATA_DIR$/optInEmptyMessageFir.kt
|
||||
-d
|
||||
$TEMP_DIR$
|
||||
-opt-in=kotlin.RequiresOptIn
|
||||
-Xuse-fir
|
||||
-Xuse-k2
|
||||
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
warning: ATTENTION!
|
||||
This build uses in-dev FIR:
|
||||
-Xuse-fir
|
||||
This build uses experimental K2 compiler:
|
||||
-Xuse-k2
|
||||
compiler/testData/cli/jvm/optInEmptyMessageFir.kt:8:5: error: this declaration needs opt-in. Its usage must be marked with '@EmptyMarker' or '@OptIn(EmptyMarker::class)'
|
||||
foo()
|
||||
^
|
||||
|
||||
+1
-1
@@ -2,4 +2,4 @@ $TESTDATA_DIR$/optInOverrideMessageFir.kt
|
||||
-d
|
||||
$TEMP_DIR$
|
||||
-opt-in=kotlin.RequiresOptIn
|
||||
-Xuse-fir
|
||||
-Xuse-k2
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
warning: ATTENTION!
|
||||
This build uses in-dev FIR:
|
||||
-Xuse-fir
|
||||
This build uses experimental K2 compiler:
|
||||
-Xuse-k2
|
||||
compiler/testData/cli/jvm/optInOverrideMessageFir.kt:16:18: error: base declaration of supertype 'Base' needs opt-in. This API is experimental and can change at any time, please use with care. The declaration override must be annotated with '@Marker' or '@OptIn(Marker::class)'
|
||||
override fun foo() {}
|
||||
^
|
||||
|
||||
+1
-4
@@ -137,10 +137,7 @@ abstract class AbstractKotlinCompilerIntegrationTest : TestCaseWithTmpdir() {
|
||||
|
||||
private fun String.removeFirWarning(): String {
|
||||
return this.replace(
|
||||
"""warning: ATTENTION!
|
||||
This build uses in-dev FIR:
|
||||
-Xuse-fir
|
||||
""", ""
|
||||
"warning: ATTENTION!\n This build uses experimental K2 compiler: \n -Xuse-k2\n", ""
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
+9
-9
@@ -546,7 +546,7 @@ class CompileKotlinAgainstCustomBinariesTest : AbstractKotlinCompilerIntegration
|
||||
|
||||
fun testInternalFromFriendModuleFir() {
|
||||
val library = compileLibrary("library")
|
||||
compileKotlin("source.kt", tmpdir, listOf(library), additionalOptions = listOf("-Xfriend-paths=${library.path}", "-Xuse-fir"))
|
||||
compileKotlin("source.kt", tmpdir, listOf(library), additionalOptions = listOf("-Xfriend-paths=${library.path}", "-Xuse-k2"))
|
||||
}
|
||||
|
||||
fun testJvmDefaultClashWithOld() {
|
||||
@@ -620,20 +620,20 @@ class CompileKotlinAgainstCustomBinariesTest : AbstractKotlinCompilerIntegration
|
||||
}
|
||||
|
||||
fun testFirAgainstFir() {
|
||||
val library = compileLibrary("library", additionalOptions = listOf("-Xuse-fir"))
|
||||
compileKotlin("source.kt", tmpdir, listOf(library), additionalOptions = listOf("-Xuse-fir"))
|
||||
val library = compileLibrary("library", additionalOptions = listOf("-Xuse-k2"))
|
||||
compileKotlin("source.kt", tmpdir, listOf(library), additionalOptions = listOf("-Xuse-k2"))
|
||||
}
|
||||
|
||||
fun testFirAgainstOldJvm() {
|
||||
val library = compileLibrary("library")
|
||||
compileKotlin("source.kt", tmpdir, listOf(library), additionalOptions = listOf("-Xuse-fir"))
|
||||
compileKotlin("source.kt", tmpdir, listOf(library), additionalOptions = listOf("-Xuse-k2"))
|
||||
}
|
||||
|
||||
fun testFirIncorrectJavaSignature() {
|
||||
compileKotlin(
|
||||
"source.kt", tmpdir,
|
||||
listOf(),
|
||||
additionalOptions = listOf("-Xuse-fir"),
|
||||
additionalOptions = listOf("-Xuse-k2"),
|
||||
additionalSources = listOf("A.java", "B.java"),
|
||||
)
|
||||
}
|
||||
@@ -647,10 +647,10 @@ class CompileKotlinAgainstCustomBinariesTest : AbstractKotlinCompilerIntegration
|
||||
}
|
||||
|
||||
fun testOldJvmAgainstFir() {
|
||||
val library = compileLibrary("library", additionalOptions = listOf("-Xuse-fir"))
|
||||
val library = compileLibrary("library", additionalOptions = listOf("-Xuse-k2"))
|
||||
compileKotlin("source.kt", tmpdir, listOf(library))
|
||||
|
||||
val library2 = compileLibrary("library", additionalOptions = listOf("-Xuse-fir", "-Xabi-stability=unstable"))
|
||||
val library2 = compileLibrary("library", additionalOptions = listOf("-Xuse-k2", "-Xabi-stability=unstable"))
|
||||
compileKotlin("source.kt", tmpdir, listOf(library2))
|
||||
}
|
||||
|
||||
@@ -660,12 +660,12 @@ class CompileKotlinAgainstCustomBinariesTest : AbstractKotlinCompilerIntegration
|
||||
}
|
||||
|
||||
fun testOldJvmAgainstFirWithStableAbi() {
|
||||
val library = compileLibrary("library", additionalOptions = listOf("-Xuse-fir", "-Xabi-stability=stable"))
|
||||
val library = compileLibrary("library", additionalOptions = listOf("-Xuse-k2", "-Xabi-stability=stable"))
|
||||
compileKotlin("source.kt", tmpdir, listOf(library))
|
||||
}
|
||||
|
||||
fun testOldJvmAgainstFirWithAllowUnstableDependencies() {
|
||||
val library = compileLibrary("library", additionalOptions = listOf("-Xuse-fir"))
|
||||
val library = compileLibrary("library", additionalOptions = listOf("-Xuse-k2"))
|
||||
compileKotlin("source.kt", tmpdir, listOf(library), additionalOptions = listOf("-Xallow-unstable-dependencies"))
|
||||
}
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ class CompilerArgumentsContentProspectorTest {
|
||||
CommonCompilerArguments::profilePhases,
|
||||
CommonCompilerArguments::checkPhaseConditions,
|
||||
CommonCompilerArguments::checkStickyPhaseConditions,
|
||||
CommonCompilerArguments::useFir,
|
||||
CommonCompilerArguments::useK2,
|
||||
CommonCompilerArguments::useFirExtendedCheckers,
|
||||
CommonCompilerArguments::disableUltraLightClasses,
|
||||
CommonCompilerArguments::useMixedNamedArguments,
|
||||
|
||||
+2
-2
@@ -20,8 +20,8 @@ interface KotlinCommonOptions : org.jetbrains.kotlin.gradle.dsl.KotlinCommonToo
|
||||
var languageVersion: kotlin.String?
|
||||
|
||||
/**
|
||||
* Compile using Front-end IR. Warning: this feature is far from being production-ready
|
||||
* Compile using experimental K2. K2 is a new compiler pipeline, no compatibility guarantees are yet provided
|
||||
* Default value: false
|
||||
*/
|
||||
var useFir: kotlin.Boolean
|
||||
var useK2: kotlin.Boolean
|
||||
}
|
||||
|
||||
+1
-1
@@ -152,7 +152,7 @@ internal open class GradleCompilerRunner(
|
||||
report(BooleanMetrics.JVM_COMPILER_IR_MODE, args.useIR)
|
||||
report(StringMetrics.JVM_DEFAULTS, args.jvmDefault)
|
||||
report(StringMetrics.USE_OLD_BACKEND, args.useOldBackend.toString())
|
||||
report(StringMetrics.USE_FIR, args.useFir.toString())
|
||||
report(StringMetrics.USE_FIR, args.useK2.toString())
|
||||
}
|
||||
}
|
||||
is K2JSCompilerArguments -> {
|
||||
|
||||
+6
-6
@@ -30,11 +30,11 @@ internal abstract class KotlinJsOptionsBase : org.jetbrains.kotlin.gradle.dsl.Ko
|
||||
|
||||
override var languageVersion: kotlin.String? = null
|
||||
|
||||
private var useFirField: kotlin.Boolean? = null
|
||||
override var useFir: kotlin.Boolean
|
||||
get() = useFirField ?: false
|
||||
private var useK2Field: kotlin.Boolean? = null
|
||||
override var useK2: kotlin.Boolean
|
||||
get() = useK2Field ?: false
|
||||
set(value) {
|
||||
useFirField = value
|
||||
useK2Field = value
|
||||
}
|
||||
|
||||
private var friendModulesDisabledField: kotlin.Boolean? = null
|
||||
@@ -105,7 +105,7 @@ internal abstract class KotlinJsOptionsBase : org.jetbrains.kotlin.gradle.dsl.Ko
|
||||
verboseField?.let { args.verbose = it }
|
||||
apiVersion?.let { args.apiVersion = it }
|
||||
languageVersion?.let { args.languageVersion = it }
|
||||
useFirField?.let { args.useFir = it }
|
||||
useK2Field?.let { args.useK2 = it }
|
||||
friendModulesDisabledField?.let { args.friendModulesDisabled = it }
|
||||
mainField?.let { args.main = it }
|
||||
metaInfoField?.let { args.metaInfo = it }
|
||||
@@ -126,7 +126,7 @@ internal fun org.jetbrains.kotlin.cli.common.arguments.K2JSCompilerArguments.fil
|
||||
verbose = false
|
||||
apiVersion = null
|
||||
languageVersion = null
|
||||
useFir = false
|
||||
useK2 = false
|
||||
friendModulesDisabled = false
|
||||
main = "call"
|
||||
metaInfo = true
|
||||
|
||||
+6
-6
@@ -30,11 +30,11 @@ internal abstract class KotlinJvmOptionsBase : org.jetbrains.kotlin.gradle.dsl.K
|
||||
|
||||
override var languageVersion: kotlin.String? = null
|
||||
|
||||
private var useFirField: kotlin.Boolean? = null
|
||||
override var useFir: kotlin.Boolean
|
||||
get() = useFirField ?: false
|
||||
private var useK2Field: kotlin.Boolean? = null
|
||||
override var useK2: kotlin.Boolean
|
||||
get() = useK2Field ?: false
|
||||
set(value) {
|
||||
useFirField = value
|
||||
useK2Field = value
|
||||
}
|
||||
|
||||
private var javaParametersField: kotlin.Boolean? = null
|
||||
@@ -68,7 +68,7 @@ internal abstract class KotlinJvmOptionsBase : org.jetbrains.kotlin.gradle.dsl.K
|
||||
verboseField?.let { args.verbose = it }
|
||||
apiVersion?.let { args.apiVersion = it }
|
||||
languageVersion?.let { args.languageVersion = it }
|
||||
useFirField?.let { args.useFir = it }
|
||||
useK2Field?.let { args.useK2 = it }
|
||||
javaParametersField?.let { args.javaParameters = it }
|
||||
jvmTarget?.let { args.jvmTarget = it }
|
||||
moduleName?.let { args.moduleName = it }
|
||||
@@ -83,7 +83,7 @@ internal fun org.jetbrains.kotlin.cli.common.arguments.K2JVMCompilerArguments.fi
|
||||
verbose = false
|
||||
apiVersion = null
|
||||
languageVersion = null
|
||||
useFir = false
|
||||
useK2 = false
|
||||
javaParameters = false
|
||||
jvmTarget = null
|
||||
moduleName = null
|
||||
|
||||
+6
-6
@@ -30,11 +30,11 @@ internal abstract class KotlinMultiplatformCommonOptionsBase : org.jetbrains.kot
|
||||
|
||||
override var languageVersion: kotlin.String? = null
|
||||
|
||||
private var useFirField: kotlin.Boolean? = null
|
||||
override var useFir: kotlin.Boolean
|
||||
get() = useFirField ?: false
|
||||
private var useK2Field: kotlin.Boolean? = null
|
||||
override var useK2: kotlin.Boolean
|
||||
get() = useK2Field ?: false
|
||||
set(value) {
|
||||
useFirField = value
|
||||
useK2Field = value
|
||||
}
|
||||
|
||||
internal open fun updateArguments(args: org.jetbrains.kotlin.cli.common.arguments.K2MetadataCompilerArguments) {
|
||||
@@ -43,7 +43,7 @@ internal abstract class KotlinMultiplatformCommonOptionsBase : org.jetbrains.kot
|
||||
verboseField?.let { args.verbose = it }
|
||||
apiVersion?.let { args.apiVersion = it }
|
||||
languageVersion?.let { args.languageVersion = it }
|
||||
useFirField?.let { args.useFir = it }
|
||||
useK2Field?.let { args.useK2 = it }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,5 +53,5 @@ internal fun org.jetbrains.kotlin.cli.common.arguments.K2MetadataCompilerArgumen
|
||||
verbose = false
|
||||
apiVersion = null
|
||||
languageVersion = null
|
||||
useFir = false
|
||||
useK2 = false
|
||||
}
|
||||
|
||||
+2
-2
@@ -132,8 +132,8 @@ internal class PropertiesProvider private constructor(private val project: Proje
|
||||
val useKotlinAbiSnapshot: Boolean
|
||||
get() = booleanProperty(KOTLIN_ABI_SNAPSHOT) ?: false
|
||||
|
||||
val useFir: Boolean?
|
||||
get() = booleanProperty("kotlin.useFir")
|
||||
val useK2: Boolean?
|
||||
get() = booleanProperty("kotlin.useK2")
|
||||
|
||||
val keepMppDependenciesIntactInPoms: Boolean?
|
||||
get() = booleanProperty("kotlin.mpp.keepMppDependenciesIntactInPoms")
|
||||
|
||||
+2
-2
@@ -36,8 +36,8 @@ internal class NativeCompileOptions(languageSettingsProvider: () -> LanguageSett
|
||||
set(value) {
|
||||
languageSettings.languageVersion = value
|
||||
}
|
||||
|
||||
override var useFir: Boolean
|
||||
|
||||
override var useK2: Boolean
|
||||
get() = false
|
||||
set(@Suppress("UNUSED_PARAMETER") value) {}
|
||||
|
||||
|
||||
+2
-2
@@ -39,8 +39,8 @@ internal open class BaseKotlinCompileConfig<TASK : KotlinCompile> : AbstractKotl
|
||||
taskProvider.configure { task ->
|
||||
task.incremental = propertiesProvider.incrementalJvm ?: true
|
||||
|
||||
if (propertiesProvider.useFir == true) {
|
||||
task.kotlinOptions.useFir = true
|
||||
if (propertiesProvider.useK2 == true) {
|
||||
task.kotlinOptions.useK2 = true
|
||||
}
|
||||
task.usePreciseJavaTracking = propertiesProvider.usePreciseJavaTracking ?: true
|
||||
task.jvmTargetValidationMode.set(propertiesProvider.jvmTargetValidationMode)
|
||||
|
||||
+1
-1
@@ -129,7 +129,7 @@ internal fun reportArgumentsNotAllowed(
|
||||
K2JVMCompilerArguments::useJavac,
|
||||
K2JVMCompilerArguments::useIR,
|
||||
K2JVMCompilerArguments::useOldBackend,
|
||||
K2JVMCompilerArguments::useFir
|
||||
K2JVMCompilerArguments::useK2
|
||||
)
|
||||
|
||||
internal fun reportArgumentsIgnoredGenerally(
|
||||
|
||||
Reference in New Issue
Block a user