Add using -Xinline-classes by default in IDE intentions
^KT-34209 Fixed
This commit is contained in:
+15
@@ -594,6 +594,21 @@ class GradleConfiguratorTest : GradleImportingTestCase() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun testEnableFeatureSupportGSKWithoutFoundKotlinVersion() {
|
||||||
|
val files = importProjectFromTestData()
|
||||||
|
|
||||||
|
runInEdtAndWait {
|
||||||
|
myTestFixture.project.executeWriteCommand("") {
|
||||||
|
KotlinWithGradleConfigurator.changeFeatureConfiguration(
|
||||||
|
myTestFixture.module, LanguageFeature.InlineClasses, LanguageFeature.State.ENABLED, false
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
checkFiles(files)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@TargetVersions("4.7+")
|
@TargetVersions("4.7+")
|
||||||
@Test
|
@Test
|
||||||
fun testEnableFeatureSupportToExistentArgumentsWithXFlag() = testEnableFeatureSupportToExistentArguments()
|
fun testEnableFeatureSupportToExistentArgumentsWithXFlag() = testEnableFeatureSupportToExistentArguments()
|
||||||
|
|||||||
+4
-4
@@ -41,12 +41,12 @@ object CliArgumentStringBuilder {
|
|||||||
val dedicatedFlag = dedicatedFlagInfo?.run {
|
val dedicatedFlag = dedicatedFlagInfo?.run {
|
||||||
val (xFlag, xFlagSinceVersion) = this
|
val (xFlag, xFlagSinceVersion) = this
|
||||||
|
|
||||||
// TODO: replace to returning xFlag in 1.4 (behaviour for fallback)
|
if (kotlinVersion == null) return@run xFlag
|
||||||
if (kotlinVersion == null) return@run null
|
|
||||||
|
|
||||||
val isAtLeastSpecifiedVersion = versionRegex.find(kotlinVersion)?.destructured?.let { (major, minor, patch) ->
|
val parsedVersion = versionRegex.find(kotlinVersion) ?: return@run xFlag
|
||||||
|
val isAtLeastSpecifiedVersion = parsedVersion.destructured.let { (major, minor, patch) ->
|
||||||
KotlinVersion(major.toInt(), minor.toInt(), patch.toInt()) >= xFlagSinceVersion
|
KotlinVersion(major.toInt(), minor.toInt(), patch.toInt()) >= xFlagSinceVersion
|
||||||
} == true
|
}
|
||||||
if (isAtLeastSpecifiedVersion) xFlag else null
|
if (isAtLeastSpecifiedVersion) xFlag else null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -50,7 +50,7 @@
|
|||||||
</executions>
|
</executions>
|
||||||
<configuration>
|
<configuration>
|
||||||
<args>
|
<args>
|
||||||
<arg>-XXLanguage:+InlineClasses</arg>
|
<arg>-Xinline-classes</arg>
|
||||||
</args>
|
</args>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|||||||
Vendored
+8
@@ -0,0 +1,8 @@
|
|||||||
|
buildscript {
|
||||||
|
repositories {
|
||||||
|
jcenter()
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
apply(plugin ="kotlin")
|
||||||
+14
@@ -0,0 +1,14 @@
|
|||||||
|
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||||
|
|
||||||
|
buildscript {
|
||||||
|
repositories {
|
||||||
|
jcenter()
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
apply(plugin ="kotlin")
|
||||||
|
val compileKotlin: KotlinCompile by tasks
|
||||||
|
compileKotlin.kotlinOptions {
|
||||||
|
freeCompilerArgs = listOf("-Xinline-classes")
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user