From a9cdca40c302a7a186566323ebd997ae202e0db9 Mon Sep 17 00:00:00 2001 From: Nikita Bobko Date: Tue, 30 Nov 2021 18:38:50 +0100 Subject: [PATCH] Compilation fixes --- .../kotlin/platform/IdePlatformKind.kt | 4 +-- .../CompilerArgumentsContentProspectorTest.kt | 8 ----- jps/jps-plugin/build.gradle.kts | 1 + .../AbstractIncrementalLazyCachesTest.kt | 1 + .../jps/build/AbstractLookupTrackerTest.kt | 5 ++-- .../jps/build/AsmVersionForJpsBuildTest.kt | 2 +- .../jps/build/BaseKotlinJpsBuildTestCase.kt | 3 +- .../jps/build/IncrementalCustomTests.kt | 5 ++-- .../kotlin/jps/build/KotlinJpsBuildTest.kt | 13 +-------- .../jps/build/KotlinJpsBuildTestBase.kt | 1 + .../kotlin/jps/build/KotlinLibraries.kt | 1 - .../jps/build/fixtures/EnableICFixture.kt | 4 +++ .../kotlin/jvm/compiler/ClasspathOrderTest.kt | 4 ++- .../modules/KotlinModuleXmlGeneratorTest.java | 29 ++++++++++--------- .../JpsCompilerServicesFacadeImpl.kt | 2 ++ .../compilerRunner/JpsKotlinCompilerRunner.kt | 1 + .../jps/targets/KotlinJvmModuleBuildTarget.kt | 3 +- 17 files changed, 39 insertions(+), 48 deletions(-) diff --git a/jps/jps-common/src/org/jetbrains/kotlin/platform/IdePlatformKind.kt b/jps/jps-common/src/org/jetbrains/kotlin/platform/IdePlatformKind.kt index 433d0a53eca..6dbad82f753 100644 --- a/jps/jps-common/src/org/jetbrains/kotlin/platform/IdePlatformKind.kt +++ b/jps/jps-common/src/org/jetbrains/kotlin/platform/IdePlatformKind.kt @@ -66,7 +66,7 @@ abstract class IdePlatformKind { fun platformByCompilerArguments(arguments: Args): TargetPlatform? = - ALL_KINDS.firstNotNullResult { it.platformByCompilerArguments(arguments) } + ALL_KINDS.firstNotNullOfOrNull { it.platformByCompilerArguments(arguments) } } } @@ -76,7 +76,7 @@ val TargetPlatform.idePlatformKind: IdePlatformKind when { list.size == 1 -> list.first() list.size > 1 -> list.first().also { - Logger.getInstance(IdePlatformKind.javaClass).warn("Found more than one IdePlatformKind [$list] for target [$this].") + Logger.getInstance(IdePlatformKind.Companion::class.java).warn("Found more than one IdePlatformKind [$list] for target [$this].") } else -> error("Unknown platform $this") } diff --git a/jps/jps-common/test/CompilerArgumentsContentProspectorTest.kt b/jps/jps-common/test/CompilerArgumentsContentProspectorTest.kt index 29283937dd8..b7d13dd4c15 100644 --- a/jps/jps-common/test/CompilerArgumentsContentProspectorTest.kt +++ b/jps/jps-common/test/CompilerArgumentsContentProspectorTest.kt @@ -76,7 +76,6 @@ class CompilerArgumentsContentProspectorTest { CommonCompilerArguments::noCheckActual, CommonCompilerArguments::newInference, CommonCompilerArguments::inlineClasses, - CommonCompilerArguments::polymorphicSignature, CommonCompilerArguments::legacySmartCastAfterTry, CommonCompilerArguments::effectSystem, CommonCompilerArguments::readDeserializedContracts, @@ -112,7 +111,6 @@ class CompilerArgumentsContentProspectorTest { private val commonCompilerArgumentsArrayProperties = listOf( CommonCompilerArguments::pluginOptions, CommonCompilerArguments::pluginClasspaths, - CommonCompilerArguments::experimental, CommonCompilerArguments::useExperimental, CommonCompilerArguments::optIn, CommonCompilerArguments::commonSources, @@ -140,17 +138,14 @@ class CompilerArgumentsContentProspectorTest { K2JVMCompilerArguments::noCallAssertions, K2JVMCompilerArguments::noReceiverAssertions, K2JVMCompilerArguments::noParamAssertions, - K2JVMCompilerArguments::strictJavaNullabilityAssertions, K2JVMCompilerArguments::noOptimize, K2JVMCompilerArguments::inheritMultifileParts, K2JVMCompilerArguments::useTypeTable, - K2JVMCompilerArguments::skipRuntimeVersionCheck, K2JVMCompilerArguments::useOldClassFilesReading, K2JVMCompilerArguments::singleModule, K2JVMCompilerArguments::suppressMissingBuiltinsError, K2JVMCompilerArguments::useJavac, K2JVMCompilerArguments::compileJava, - K2JVMCompilerArguments::noExceptionOnExplicitEqualsForBoxedNull, K2JVMCompilerArguments::disableStandardScript, K2JVMCompilerArguments::strictMetadataVersionSemantics, K2JVMCompilerArguments::suppressDeprecatedJvmTargetWarning, @@ -162,7 +157,6 @@ class CompilerArgumentsContentProspectorTest { K2JVMCompilerArguments::noKotlinNothingValueException, K2JVMCompilerArguments::noResetJarTimestamps, K2JVMCompilerArguments::noUnifiedNullChecks, - K2JVMCompilerArguments::useOldSpilledVarTypeAnalysis, K2JVMCompilerArguments::useOldInlineClassesManglingScheme, K2JVMCompilerArguments::enableJvmPreview, ) @@ -176,7 +170,6 @@ class CompilerArgumentsContentProspectorTest { K2JVMCompilerArguments::jvmTarget, K2JVMCompilerArguments::abiStability, K2JVMCompilerArguments::javaModulePath, - K2JVMCompilerArguments::constructorCallNormalizationMode, K2JVMCompilerArguments::assertionsMode, K2JVMCompilerArguments::buildFile, K2JVMCompilerArguments::declarationsOutputPath, @@ -223,7 +216,6 @@ class CompilerArgumentsContentProspectorTest { K2JSCompilerArguments::irProduceKlibFile, K2JSCompilerArguments::irProduceJs, K2JSCompilerArguments::irDce, - K2JSCompilerArguments::irDceDriven, K2JSCompilerArguments::irDcePrintReachabilityInfo, K2JSCompilerArguments::irPropertyLazyInitialization, K2JSCompilerArguments::irOnly, diff --git a/jps/jps-plugin/build.gradle.kts b/jps/jps-plugin/build.gradle.kts index 3346943fdd4..ff06a6201c4 100644 --- a/jps/jps-plugin/build.gradle.kts +++ b/jps/jps-plugin/build.gradle.kts @@ -32,6 +32,7 @@ dependencies { testCompile(commonDep("junit:junit")) testCompile(project(":kotlin-test:kotlin-test-jvm")) testCompile(projectTests(":kotlin-build-common")) + testApi(projectTests(":compiler:test-infrastructure-utils")) testCompileOnly(jpsStandalone()) { includeJars("jps-builders", "jps-builders-6") } Ide.IJ { testCompile(intellijDep("devkit")) diff --git a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AbstractIncrementalLazyCachesTest.kt b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AbstractIncrementalLazyCachesTest.kt index a6f8bf63561..4f4eef38302 100644 --- a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AbstractIncrementalLazyCachesTest.kt +++ b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AbstractIncrementalLazyCachesTest.kt @@ -68,6 +68,7 @@ abstract class AbstractIncrementalLazyCachesTest : AbstractIncrementalJpsTest() when { name.endsWith("incremental-compilation") -> { + @Suppress("DEPRECATION") IncrementalCompilation.setIsEnabledForJvm(modification.dataFile.readAsBool()) } } diff --git a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AbstractLookupTrackerTest.kt b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AbstractLookupTrackerTest.kt index 2dc303acf8c..c48596fc51a 100644 --- a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AbstractLookupTrackerTest.kt +++ b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AbstractLookupTrackerTest.kt @@ -29,7 +29,6 @@ import org.jetbrains.kotlin.cli.jvm.K2JVMCompiler import org.jetbrains.kotlin.codegen.forTestCompile.ForTestCompileRuntime import org.jetbrains.kotlin.compilerRunner.* import org.jetbrains.kotlin.config.Services -import org.jetbrains.kotlin.idea.artifacts.TestKotlinArtifacts import org.jetbrains.kotlin.incremental.components.LookupInfo import org.jetbrains.kotlin.incremental.components.LookupTracker import org.jetbrains.kotlin.incremental.components.Position @@ -87,7 +86,7 @@ abstract class AbstractJvmLookupTrackerTest : AbstractLookupTrackerTest() { sourcesToCompile = filesToCompile.toList(), commonSources = emptyList(), javaSourceRoots = listOf(JvmSourceRoot(srcDir, null)), - classpath = listOf(outDir, TestKotlinArtifacts.kotlinStdlib).filter { it.exists() }, + classpath = listOf(outDir, ForTestCompileRuntime.runtimeJarForTests()).filter { it.exists() }, friendDirs = emptyList() ) @@ -115,7 +114,7 @@ abstract class AbstractJvmLookupTrackerTest : AbstractLookupTrackerTest() { abstract class AbstractJsKlibLookupTrackerTest : AbstractJsLookupTrackerTest() { override val jsStdlibFile: File - get() = KotlinArtifacts.instance.kotlinStdlibJs + get() = File("build/js-ir-runtime/full-runtime.klib") override fun configureAdditionalArgs(args: K2JSCompilerArguments) { args.irProduceKlibDir = true diff --git a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AsmVersionForJpsBuildTest.kt b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AsmVersionForJpsBuildTest.kt index b6564c4068e..339570aaeea 100644 --- a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AsmVersionForJpsBuildTest.kt +++ b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AsmVersionForJpsBuildTest.kt @@ -8,7 +8,7 @@ import org.jetbrains.org.objectweb.asm.RecordComponentVisitor class AsmVersionForJpsBuildTest : TestCase() { // Kotlin compiler contains some version of ASM that is taken from a particular platform dependency fun testAsmVersionForBundledKotlinCompiler() { - val field = RecordComponentVisitor::class.java.getDeclaredField("api").also { it.trySetAccessible() } + val field = RecordComponentVisitor::class.java.getDeclaredField("api").also { it.isAccessible = true } val asmVersionForBundledCompiler = field.getInt(AbstractClassBuilder.EMPTY_RECORD_VISITOR) assertEquals(Opcodes.ASM8, asmVersionForBundledCompiler) diff --git a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/BaseKotlinJpsBuildTestCase.kt b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/BaseKotlinJpsBuildTestCase.kt index 333f27299ce..cf703cc5a19 100644 --- a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/BaseKotlinJpsBuildTestCase.kt +++ b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/BaseKotlinJpsBuildTestCase.kt @@ -30,7 +30,6 @@ import org.jetbrains.jps.util.JpsPathUtil import org.jetbrains.kotlin.compilerRunner.JpsKotlinCompilerRunner import org.jetbrains.kotlin.test.WithMutedInDatabaseRunTest import org.jetbrains.kotlin.test.runTest -import org.jetbrains.kotlin.test.AndroidStudioTestUtils @WithMutedInDatabaseRunTest abstract class BaseKotlinJpsBuildTestCase : JpsBuildTestCase() { @@ -40,7 +39,7 @@ abstract class BaseKotlinJpsBuildTestCase : JpsBuildTestCase() { } override fun shouldRunTest(): Boolean { - return super.shouldRunTest() && !AndroidStudioTestUtils.skipIncompatibleTestAgainstAndroidStudio() + return super.shouldRunTest() } override fun tearDown() { diff --git a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/IncrementalCustomTests.kt b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/IncrementalCustomTests.kt index 22909527138..32704821d91 100644 --- a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/IncrementalCustomTests.kt +++ b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/IncrementalCustomTests.kt @@ -17,14 +17,13 @@ package org.jetbrains.kotlin.jps.build import org.jetbrains.kotlin.incremental.testingUtils.Modification -import org.jetbrains.kotlin.test.KotlinRoot class IncrementalRenameModuleTest : AbstractIncrementalJpsTest() { fun testRenameModule() { - doTest(KotlinRoot.DIR.path + "/jps/jps-plugin/testData/incremental/custom/renameModule/") + doTest("jps-plugin/testData/incremental/custom/renameModule/") } override fun performAdditionalModifications(modifications: List) { projectDescriptor.project.modules.forEach { it.name += "Renamed" } } -} \ No newline at end of file +} diff --git a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/KotlinJpsBuildTest.kt b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/KotlinJpsBuildTest.kt index dde0a945584..7cab1002cd8 100644 --- a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/KotlinJpsBuildTest.kt +++ b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/KotlinJpsBuildTest.kt @@ -247,7 +247,7 @@ open class KotlinJpsBuildTest : KotlinJpsBuildTestBase() { val jslibJar = PathUtil.kotlinPathsForDistDirectory.jsStdLibJarPath val jslibDir = File(workDir, "KotlinJavaScript") try { - Decompressor.Zip(jslibJar).extract(jslibDir.toPath()) + Decompressor.Zip(jslibJar).extract(jslibDir) } catch (ex: IOException) { throw IllegalStateException(ex.message) @@ -1116,14 +1116,3 @@ open class KotlinJpsBuildTest : KotlinJpsBuildTestBase() { } } } - -private inline fun withIC(enabled: Boolean = true, fn: () -> R): R { - val isEnabledBackup = IncrementalCompilation.isEnabledForJvm() - IncrementalCompilation.setIsEnabledForJvm(enabled) - - try { - return fn() - } finally { - IncrementalCompilation.setIsEnabledForJvm(isEnabledBackup) - } -} \ No newline at end of file diff --git a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/KotlinJpsBuildTestBase.kt b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/KotlinJpsBuildTestBase.kt index dec88a47cec..8afb685cb9d 100644 --- a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/KotlinJpsBuildTestBase.kt +++ b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/KotlinJpsBuildTestBase.kt @@ -15,6 +15,7 @@ import org.jetbrains.kotlin.cli.common.arguments.K2JSCompilerArguments import org.jetbrains.kotlin.config.KotlinFacetSettings import org.jetbrains.kotlin.jps.model.JpsKotlinFacetModuleExtension import org.jetbrains.kotlin.platform.js.JsPlatforms +import org.jetbrains.kotlin.test.util.KtTestUtil import java.io.File import java.nio.file.Paths diff --git a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/KotlinLibraries.kt b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/KotlinLibraries.kt index 270d8afe5f8..e717e5256c5 100644 --- a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/KotlinLibraries.kt +++ b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/KotlinLibraries.kt @@ -13,7 +13,6 @@ import org.jetbrains.kotlin.utils.PathUtil import java.io.File enum class KotlinJpsLibrary(val id: String, vararg val roots: File) { - @Deprecated("Use JvmStdlib instead") MockRuntime( "kotlin-mock-runtime", PathUtil.kotlinPathsForDistDirectory.stdlibPath, diff --git a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/fixtures/EnableICFixture.kt b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/fixtures/EnableICFixture.kt index 68bff03674f..dc1176b676c 100644 --- a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/fixtures/EnableICFixture.kt +++ b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/fixtures/EnableICFixture.kt @@ -16,14 +16,18 @@ class EnableICFixture( fun setUp() { isICEnabledBackup = IncrementalCompilation.isEnabledForJvm() + @Suppress("DEPRECATION") IncrementalCompilation.setIsEnabledForJvm(enableJvmIC) isICEnabledForJsBackup = IncrementalCompilation.isEnabledForJs() + @Suppress("DEPRECATION") IncrementalCompilation.setIsEnabledForJs(enableJsIC) } fun tearDown() { + @Suppress("DEPRECATION") IncrementalCompilation.setIsEnabledForJvm(isICEnabledBackup) + @Suppress("DEPRECATION") IncrementalCompilation.setIsEnabledForJs(isICEnabledForJsBackup) } } \ No newline at end of file diff --git a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jvm/compiler/ClasspathOrderTest.kt b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jvm/compiler/ClasspathOrderTest.kt index 0e96039c9e8..d573bc20c64 100644 --- a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jvm/compiler/ClasspathOrderTest.kt +++ b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jvm/compiler/ClasspathOrderTest.kt @@ -18,6 +18,7 @@ package org.jetbrains.kotlin.jvm.compiler import org.jetbrains.jps.builders.java.JavaModuleBuildTargetType import org.jetbrains.kotlin.build.JvmSourceRoot +import org.jetbrains.kotlin.config.IncrementalCompilation import org.jetbrains.kotlin.modules.KotlinModuleXmlBuilder import org.jetbrains.kotlin.test.MockLibraryUtil import org.jetbrains.kotlin.test.TestCaseWithTmpdir @@ -53,7 +54,8 @@ class ClasspathOrderTest : TestCaseWithTmpdir() { JavaModuleBuildTargetType.PRODUCTION.typeId, JavaModuleBuildTargetType.PRODUCTION.isTests, setOf(), - emptyList() + emptyList(), + IncrementalCompilation.isEnabledForJvm() ).asText().toString() val xml = File(tmpdir, "module.xml") diff --git a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/modules/KotlinModuleXmlGeneratorTest.java b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/modules/KotlinModuleXmlGeneratorTest.java index af9b7ff2c75..e65a38b48d4 100644 --- a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/modules/KotlinModuleXmlGeneratorTest.java +++ b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/modules/KotlinModuleXmlGeneratorTest.java @@ -19,7 +19,7 @@ package org.jetbrains.kotlin.modules; import junit.framework.TestCase; import org.jetbrains.jps.builders.java.JavaModuleBuildTargetType; import org.jetbrains.kotlin.build.JvmSourceRoot; -import org.jetbrains.kotlin.idea.test.TestUtilsKt; +import org.jetbrains.kotlin.config.IncrementalCompilation; import org.jetbrains.kotlin.test.KotlinTestUtils; import java.io.File; @@ -27,10 +27,6 @@ import java.util.Arrays; import java.util.Collections; public class KotlinModuleXmlGeneratorTest extends TestCase { - private static String getTestDataPath() { - return TestUtilsKt.IDEA_TEST_DATA_DIR.getAbsolutePath() + "/modules.xml"; - } - public void testBasic() { String actual = new KotlinModuleXmlBuilder().addModule( "name", @@ -43,9 +39,10 @@ public class KotlinModuleXmlGeneratorTest extends TestCase { JavaModuleBuildTargetType.PRODUCTION.getTypeId(), JavaModuleBuildTargetType.PRODUCTION.isTests(), Collections.emptySet(), - Collections.emptyList() + Collections.emptyList(), + IncrementalCompilation.isEnabledForJvm() ).asText().toString(); - KotlinTestUtils.assertEqualsToFile(new File(getTestDataPath() + "/basic.xml"), actual); + KotlinTestUtils.assertEqualsToFile(new File("/basic.xml"), actual); } public void testFiltered() { @@ -60,9 +57,10 @@ public class KotlinModuleXmlGeneratorTest extends TestCase { JavaModuleBuildTargetType.PRODUCTION.getTypeId(), JavaModuleBuildTargetType.PRODUCTION.isTests(), Collections.singleton(new File("cp1")), - Collections.emptyList() + Collections.emptyList(), + IncrementalCompilation.isEnabledForJvm() ).asText().toString(); - KotlinTestUtils.assertEqualsToFile(new File(getTestDataPath() + "/filtered.xml"), actual); + KotlinTestUtils.assertEqualsToFile(new File("/filtered.xml"), actual); } public void testMultiple() { @@ -78,7 +76,8 @@ public class KotlinModuleXmlGeneratorTest extends TestCase { JavaModuleBuildTargetType.PRODUCTION.getTypeId(), JavaModuleBuildTargetType.PRODUCTION.isTests(), Collections.singleton(new File("cp1")), - Collections.emptyList() + Collections.emptyList(), + IncrementalCompilation.isEnabledForJvm() ); builder.addModule( "name2", @@ -91,10 +90,11 @@ public class KotlinModuleXmlGeneratorTest extends TestCase { JavaModuleBuildTargetType.TEST.getTypeId(), JavaModuleBuildTargetType.TEST.isTests(), Collections.singleton(new File("cp12")), - Collections.emptyList() + Collections.emptyList(), + IncrementalCompilation.isEnabledForJvm() ); String actual = builder.asText().toString(); - KotlinTestUtils.assertEqualsToFile(new File(getTestDataPath() + "/multiple.xml"), actual); + KotlinTestUtils.assertEqualsToFile(new File("/multiple.xml"), actual); } public void testModularJdkRoot() { @@ -109,8 +109,9 @@ public class KotlinModuleXmlGeneratorTest extends TestCase { JavaModuleBuildTargetType.PRODUCTION.getTypeId(), JavaModuleBuildTargetType.PRODUCTION.isTests(), Collections.emptySet(), - Collections.emptyList() + Collections.emptyList(), + IncrementalCompilation.isEnabledForJvm() ).asText().toString(); - KotlinTestUtils.assertEqualsToFile(new File(getTestDataPath() + "/modularJdkRoot.xml"), actual); + KotlinTestUtils.assertEqualsToFile(new File("/modularJdkRoot.xml"), actual); } } diff --git a/jps/jps-plugin/src/org/jetbrains/kotlin/compilerRunner/JpsCompilerServicesFacadeImpl.kt b/jps/jps-plugin/src/org/jetbrains/kotlin/compilerRunner/JpsCompilerServicesFacadeImpl.kt index 93165ff6411..c56e7d7f59d 100644 --- a/jps/jps-plugin/src/org/jetbrains/kotlin/compilerRunner/JpsCompilerServicesFacadeImpl.kt +++ b/jps/jps-plugin/src/org/jetbrains/kotlin/compilerRunner/JpsCompilerServicesFacadeImpl.kt @@ -21,6 +21,7 @@ import org.jetbrains.kotlin.daemon.client.reportFromDaemon import org.jetbrains.kotlin.daemon.common.JpsCompilerServicesFacade import org.jetbrains.kotlin.daemon.common.SOCKET_ANY_FREE_PORT import org.jetbrains.kotlin.incremental.components.ExpectActualTracker +import org.jetbrains.kotlin.incremental.components.InlineConstTracker import org.jetbrains.kotlin.incremental.components.LookupTracker import org.jetbrains.kotlin.incremental.js.IncrementalDataProvider import org.jetbrains.kotlin.incremental.js.IncrementalResultsConsumer @@ -36,6 +37,7 @@ internal class JpsCompilerServicesFacadeImpl( env.services[LookupTracker::class.java], env.services[CompilationCanceledStatus::class.java], env.services[ExpectActualTracker::class.java], + env.services[InlineConstTracker::class.java], env.services[IncrementalResultsConsumer::class.java], env.services[IncrementalDataProvider::class.java], port diff --git a/jps/jps-plugin/src/org/jetbrains/kotlin/compilerRunner/JpsKotlinCompilerRunner.kt b/jps/jps-plugin/src/org/jetbrains/kotlin/compilerRunner/JpsKotlinCompilerRunner.kt index 0668e492e67..e863da77a3e 100644 --- a/jps/jps-plugin/src/org/jetbrains/kotlin/compilerRunner/JpsKotlinCompilerRunner.kt +++ b/jps/jps-plugin/src/org/jetbrains/kotlin/compilerRunner/JpsKotlinCompilerRunner.kt @@ -354,6 +354,7 @@ class JpsKotlinCompilerRunner { val daemonOptions = configureDaemonOptions() val additionalJvmParams = mutableListOf() + @Suppress("DEPRECATION") IncrementalCompilation.toJvmArgs(additionalJvmParams) val clientFlagFile = KotlinCompilerClient.getOrCreateClientFlagFile(daemonOptions) diff --git a/jps/jps-plugin/src/org/jetbrains/kotlin/jps/targets/KotlinJvmModuleBuildTarget.kt b/jps/jps-plugin/src/org/jetbrains/kotlin/jps/targets/KotlinJvmModuleBuildTarget.kt index 8025c5e59ac..289abd9f0e6 100644 --- a/jps/jps-plugin/src/org/jetbrains/kotlin/jps/targets/KotlinJvmModuleBuildTarget.kt +++ b/jps/jps-plugin/src/org/jetbrains/kotlin/jps/targets/KotlinJvmModuleBuildTarget.kt @@ -203,7 +203,8 @@ class KotlinJvmModuleBuildTarget(kotlinContext: KotlinCompileContext, jpsModuleB isTests, // this excludes the output directories from the class path, to be removed for true incremental compilation outputDirs, - friendDirs + friendDirs, + IncrementalCompilation.isEnabledForJvm() ) }