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(
|
val cacheBuilder = CacheBuilder(
|
||||||
buildDir,
|
buildDir,
|
||||||
|
compilation as KotlinCompilation<*>,
|
||||||
kotlinOptions,
|
kotlinOptions,
|
||||||
libraryFilter,
|
libraryFilter,
|
||||||
compilerRunner.get(),
|
compilerRunner.get(),
|
||||||
@@ -150,6 +151,7 @@ abstract class KotlinJsIrLink @Inject constructor(
|
|||||||
.buildCompilerArgs(
|
.buildCompilerArgs(
|
||||||
project.configurations.getByName(compilation.compileDependencyConfigurationName),
|
project.configurations.getByName(compilation.compileDependencyConfigurationName),
|
||||||
compilation.output.classesDirs,
|
compilation.output.classesDirs,
|
||||||
|
compilation,
|
||||||
associatedCaches
|
associatedCaches
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -175,6 +177,7 @@ abstract class KotlinJsIrLink @Inject constructor(
|
|||||||
|
|
||||||
internal class CacheBuilder(
|
internal class CacheBuilder(
|
||||||
private val buildDir: File,
|
private val buildDir: File,
|
||||||
|
private val rootCompilation: KotlinCompilation<*>,
|
||||||
private val kotlinOptions: KotlinJsOptions,
|
private val kotlinOptions: KotlinJsOptions,
|
||||||
private val libraryFilter: (File) -> Boolean,
|
private val libraryFilter: (File) -> Boolean,
|
||||||
private val compilerRunner: GradleCompilerRunner,
|
private val compilerRunner: GradleCompilerRunner,
|
||||||
@@ -198,6 +201,7 @@ internal class CacheBuilder(
|
|||||||
fun buildCompilerArgs(
|
fun buildCompilerArgs(
|
||||||
compileClasspath: Configuration,
|
compileClasspath: Configuration,
|
||||||
additionalForResolve: FileCollection?,
|
additionalForResolve: FileCollection?,
|
||||||
|
compilation: KotlinCompilation<*>,
|
||||||
associatedCaches: List<File>
|
associatedCaches: List<File>
|
||||||
): List<File> {
|
): List<File> {
|
||||||
|
|
||||||
@@ -222,16 +226,18 @@ internal class CacheBuilder(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
additionalForResolve?.files?.forEach { file ->
|
if (compilation != rootCompilation) {
|
||||||
val cacheDirectory = rootCacheDirectory.resolve(file.name)
|
additionalForResolve?.files?.forEach { file ->
|
||||||
cacheDirectory.mkdirs()
|
val cacheDirectory = rootCacheDirectory.resolve(file.name)
|
||||||
runCompiler(
|
cacheDirectory.mkdirs()
|
||||||
file,
|
runCompiler(
|
||||||
compileClasspath.files,
|
file,
|
||||||
cacheDirectory,
|
compileClasspath.files,
|
||||||
(allCacheDirectories + associatedCaches).distinct()
|
cacheDirectory,
|
||||||
)
|
(allCacheDirectories + associatedCaches).distinct()
|
||||||
allCacheDirectories.add(cacheDirectory)
|
)
|
||||||
|
allCacheDirectories.add(cacheDirectory)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return associatedCaches + allCacheDirectories
|
return associatedCaches + allCacheDirectories
|
||||||
|
|||||||
Reference in New Issue
Block a user