JS IR gradle plugin: don't run IC for the main module
This commit is contained in:
committed by
teamcityserver
parent
e03cb372b7
commit
525c5b886f
+16
-10
@@ -104,6 +104,7 @@ abstract class KotlinJsIrLink @Inject constructor(
|
||||
|
||||
val cacheBuilder = CacheBuilder(
|
||||
buildDir,
|
||||
compilation as KotlinCompilation<*>,
|
||||
kotlinOptions,
|
||||
libraryFilter,
|
||||
compilerRunner.get(),
|
||||
@@ -150,6 +151,7 @@ abstract class KotlinJsIrLink @Inject constructor(
|
||||
.buildCompilerArgs(
|
||||
project.configurations.getByName(compilation.compileDependencyConfigurationName),
|
||||
compilation.output.classesDirs,
|
||||
compilation,
|
||||
associatedCaches
|
||||
)
|
||||
}
|
||||
@@ -175,6 +177,7 @@ 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,
|
||||
@@ -198,6 +201,7 @@ internal class CacheBuilder(
|
||||
fun buildCompilerArgs(
|
||||
compileClasspath: Configuration,
|
||||
additionalForResolve: FileCollection?,
|
||||
compilation: KotlinCompilation<*>,
|
||||
associatedCaches: List<File>
|
||||
): List<File> {
|
||||
|
||||
@@ -222,16 +226,18 @@ internal class CacheBuilder(
|
||||
}
|
||||
}
|
||||
|
||||
additionalForResolve?.files?.forEach { file ->
|
||||
val cacheDirectory = rootCacheDirectory.resolve(file.name)
|
||||
cacheDirectory.mkdirs()
|
||||
runCompiler(
|
||||
file,
|
||||
compileClasspath.files,
|
||||
cacheDirectory,
|
||||
(allCacheDirectories + associatedCaches).distinct()
|
||||
)
|
||||
allCacheDirectories.add(cacheDirectory)
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
return associatedCaches + allCacheDirectories
|
||||
|
||||
Reference in New Issue
Block a user