[jps] Fix Kotlin JPS commits compilation after cherry-pick from intellij/master

This commit is contained in:
Nikita Bobko
2021-11-19 18:21:48 +01:00
parent 29384c7a65
commit 01c82da8d2
8 changed files with 24 additions and 24 deletions
@@ -19,6 +19,7 @@ import com.intellij.openapi.Disposable
import com.intellij.openapi.util.Disposer
import com.intellij.openapi.util.io.FileUtil
import com.intellij.openapi.util.io.FileUtilRt
import com.intellij.testFramework.RunAll
import com.intellij.testFramework.TestLoggerFactory
import com.intellij.testFramework.UsefulTestCase
import com.intellij.util.ThrowableRunnable
@@ -47,7 +48,6 @@ import org.jetbrains.kotlin.cli.common.arguments.CommonCompilerArguments
import org.jetbrains.kotlin.cli.common.arguments.K2JVMCompilerArguments
import org.jetbrains.kotlin.cli.common.arguments.K2MetadataCompilerArguments
import org.jetbrains.kotlin.cli.common.arguments.parseCommandLineArguments
import org.jetbrains.kotlin.idea.test.runAll
import org.jetbrains.kotlin.incremental.LookupSymbol
import org.jetbrains.kotlin.incremental.testingUtils.*
import org.jetbrains.kotlin.jps.build.dependeciestxt.ModulesTxt
@@ -160,11 +160,11 @@ abstract class AbstractIncrementalJpsTest(
(AbstractIncrementalJpsTest::projectDescriptor).javaField!![this] = null
(AbstractIncrementalJpsTest::systemPropertiesBackup).javaField!![this] = null
} finally {
runAll(
RunAll(
ThrowableRunnable { lookupsDuringTest.clear() },
ThrowableRunnable { enableICFixture.tearDown() },
ThrowableRunnable { super.tearDown() }
)
).run()
}
}
@@ -16,12 +16,12 @@
package org.jetbrains.kotlin.jps.build
import com.intellij.testFramework.RunAll
import com.intellij.testFramework.UsefulTestCase
import com.intellij.util.ThrowableRunnable
import org.jetbrains.jps.builders.BuildTarget
import org.jetbrains.jps.builders.storage.BuildDataPaths
import org.jetbrains.kotlin.config.IncrementalCompilation
import org.jetbrains.kotlin.idea.test.runAll
import org.jetbrains.kotlin.incremental.KOTLIN_CACHE_DIRECTORY_NAME
import org.jetbrains.kotlin.incremental.storage.BasicMapsOwner
import org.jetbrains.kotlin.incremental.testingUtils.Modification
@@ -44,10 +44,10 @@ abstract class AbstractIncrementalLazyCachesTest : AbstractIncrementalJpsTest()
}
override fun tearDown() {
runAll(
RunAll(
ThrowableRunnable { enableICFixture.tearDown() },
ThrowableRunnable { super.tearDown() }
)
).run()
}
override fun doTest(testDataPath: String) {
@@ -16,6 +16,7 @@
package org.jetbrains.kotlin.jps.build
import com.intellij.testFramework.RunAll
import com.intellij.testFramework.UsefulTestCase
import com.intellij.util.ThrowableRunnable
import com.intellij.util.containers.StringInterner
@@ -29,7 +30,6 @@ 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.idea.test.runAll
import org.jetbrains.kotlin.incremental.components.LookupInfo
import org.jetbrains.kotlin.incremental.components.LookupTracker
import org.jetbrains.kotlin.incremental.components.Position
@@ -204,10 +204,10 @@ abstract class AbstractLookupTrackerTest : TestWithWorkingDir() {
}
override fun tearDown() {
runAll(
RunAll(
ThrowableRunnable { enableICFixture.tearDown() },
ThrowableRunnable { super.tearDown() }
)
).run()
}
protected abstract fun markDirty(removedAndModifiedSources: Iterable<File>)
@@ -17,6 +17,7 @@
package org.jetbrains.kotlin.jps.build
import com.intellij.openapi.vfs.StandardFileSystems
import com.intellij.testFramework.RunAll
import com.intellij.util.ThrowableRunnable
import com.intellij.util.io.URLUtil
import org.jetbrains.jps.builders.JpsBuildTestCase
@@ -29,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.idea.test.runAll
import org.jetbrains.kotlin.test.AndroidStudioTestUtils
@WithMutedInDatabaseRunTest
@@ -44,7 +44,7 @@ abstract class BaseKotlinJpsBuildTestCase : JpsBuildTestCase() {
}
override fun tearDown() {
runAll(
RunAll(
ThrowableRunnable {
System.clearProperty("kotlin.jps.tests")
myModel = null
@@ -52,7 +52,7 @@ abstract class BaseKotlinJpsBuildTestCase : JpsBuildTestCase() {
},
ThrowableRunnable { JpsKotlinCompilerRunner.releaseCompileServiceSession() },
ThrowableRunnable { super.tearDown() }
)
).run()
}
override fun addJdk(name: String, path: String?): JpsSdk<JpsDummyElement> {
@@ -6,11 +6,11 @@
package org.jetbrains.kotlin.jps.build
import com.intellij.openapi.util.io.FileUtil
import com.intellij.testFramework.RunAll
import com.intellij.util.ThrowableRunnable
import org.jetbrains.jps.model.java.JpsJavaExtensionService
import org.jetbrains.jps.model.module.JpsModule
import org.jetbrains.jps.util.JpsPathUtil
import org.jetbrains.kotlin.idea.test.runAll
import org.jetbrains.kotlin.cli.common.arguments.K2JSCompilerArguments
import org.jetbrains.kotlin.config.KotlinFacetSettings
import org.jetbrains.kotlin.jps.model.JpsKotlinFacetModuleExtension
@@ -45,10 +45,10 @@ abstract class KotlinJpsBuildTestBase : AbstractKotlinJpsBuildTestCase() {
}
override fun tearDown() {
runAll(
RunAll(
ThrowableRunnable { workDir.deleteRecursively() },
ThrowableRunnable { super.tearDown() }
)
).run()
}
override fun doGetProjectDir(): File = workDir
@@ -16,12 +16,12 @@
package org.jetbrains.kotlin.jps.build
import com.intellij.testFramework.RunAll
import com.intellij.util.ThrowableRunnable
import org.jetbrains.kotlin.cli.common.arguments.CommonCompilerArguments
import org.jetbrains.kotlin.compilerRunner.JpsKotlinCompilerRunner
import org.jetbrains.kotlin.config.LanguageVersion
import org.jetbrains.kotlin.daemon.common.isDaemonEnabled
import org.jetbrains.kotlin.idea.test.runAll
import org.jetbrains.kotlin.jps.build.fixtures.EnableICFixture
import org.jetbrains.kotlin.jps.model.kotlinCommonCompilerArguments
import org.jetbrains.kotlin.jps.model.kotlinCompilerArguments
@@ -37,10 +37,10 @@ class KotlinJpsBuildTestIncremental : KotlinJpsBuildTest() {
}
override fun tearDown() {
runAll(
RunAll(
ThrowableRunnable { enableICFixture.tearDown() },
ThrowableRunnable { super.tearDown() }
)
).run()
}
fun testKotlinJavaScriptChangePackage() {
@@ -5,12 +5,12 @@
package org.jetbrains.kotlin.jps.build
import com.intellij.testFramework.RunAll
import com.intellij.util.ThrowableRunnable
import org.jetbrains.jps.builders.*
import org.jetbrains.jps.builders.java.JavaSourceRootDescriptor
import org.jetbrains.jps.cmdline.ProjectDescriptor
import org.jetbrains.jps.incremental.ModuleBuildTarget
import org.jetbrains.kotlin.idea.test.runAll
import org.jetbrains.kotlin.incremental.KOTLIN_CACHE_DIRECTORY_NAME
import org.jetbrains.kotlin.incremental.testingUtils.assertEqualDirectories
import org.jetbrains.kotlin.jps.build.fixtures.EnableICFixture
@@ -32,11 +32,11 @@ class RelocatableJpsCachesTest : BaseKotlinJpsBuildTestCase() {
}
override fun tearDown() {
runAll(
RunAll(
ThrowableRunnable { workingDir.deleteRecursively() },
ThrowableRunnable { enableICFixture.tearDown() },
ThrowableRunnable { super.tearDown() }
)
).run()
}
fun testRelocatableCaches() {
@@ -232,7 +232,7 @@ class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR) {
ExpectActualTracker.DoNothing,
chunk,
messageCollector
)
) ?: return
val removedClasses = HashSet<String>()
for (target in kotlinChunk.targets) {
@@ -406,7 +406,7 @@ class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR) {
exceptActualTracer,
chunk,
messageCollector
)
) ?: return ABORT
context.testingContext?.buildLogger?.compilingFiles(
kotlinDirtyFilesHolder.allDirtyFiles,
@@ -568,7 +568,7 @@ class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR) {
exceptActualTracer: ExpectActualTracker,
chunk: ModuleChunk,
messageCollector: MessageCollectorAdapter
): JpsCompilerEnvironment {
): JpsCompilerEnvironment? {
val compilerServices = with(Services.Builder()) {
kotlinModuleBuilderTarget.makeServices(this, incrementalCaches, lookupTracker, exceptActualTracer)
build()