Revert "JS IR gradle plugin: don't run IC for the main module"

This reverts commit 525c5b886f.
This commit is contained in:
Anton Bannykh
2021-11-10 16:36:56 +03:00
committed by TeamCityServer
parent 1ae042edc3
commit b684c2f8d7
@@ -117,7 +117,6 @@ abstract class KotlinJsIrLink @Inject constructor(
val cacheBuilder = CacheBuilder(
buildDir,
compilation as KotlinCompilation<*>,
kotlinOptions,
libraryFilter,
compilerRunner.get(),
@@ -164,7 +163,6 @@ abstract class KotlinJsIrLink @Inject constructor(
.buildCompilerArgs(
project.configurations.getByName(compilation.compileDependencyConfigurationName),
compilation.output.classesDirs,
compilation,
associatedCaches
)
}
@@ -194,7 +192,6 @@ abstract class KotlinJsIrLink @Inject constructor(
internal class CacheBuilder(
private val buildDir: File,
private val rootCompilation: KotlinCompilation<*>,
private val kotlinOptions: KotlinJsOptions,
private val libraryFilter: (File) -> Boolean,
private val compilerRunner: GradleCompilerRunner,
@@ -218,7 +215,6 @@ internal class CacheBuilder(
fun buildCompilerArgs(
compileClasspath: Configuration,
additionalForResolve: FileCollection?,
compilation: KotlinCompilation<*>,
associatedCaches: List<File>
): List<File> {
@@ -243,18 +239,16 @@ internal class CacheBuilder(
}
}
if (compilation != rootCompilation) {
additionalForResolve?.files?.forEach { file ->
val cacheDirectory = rootCacheDirectory.resolve(file.name)
cacheDirectory.mkdirs()
runCompiler(
file,
compileClasspath.files,
cacheDirectory,
(allCacheDirectories + associatedCaches).distinct()
)
allCacheDirectories.add(cacheDirectory)
}
additionalForResolve?.files?.forEach { file ->
val cacheDirectory = rootCacheDirectory.resolve(file.name)
cacheDirectory.mkdirs()
runCompiler(
file,
compileClasspath.files,
cacheDirectory,
(allCacheDirectories + associatedCaches).distinct()
)
allCacheDirectories.add(cacheDirectory)
}
return associatedCaches + allCacheDirectories