[Gradle] Validate compiler classpath & invoke compiler in single action
#KT-50037 Fixed
This commit is contained in:
committed by
Space
parent
26994817d1
commit
59b6aefe67
+1
@@ -92,6 +92,7 @@ abstract class KotlinJsDce : AbstractKotlinCompileTool<K2JSDceArguments>(), Kotl
|
||||
|
||||
@TaskAction
|
||||
fun performDce(inputChanges: InputChanges) {
|
||||
validateCompilerClasspath()
|
||||
// in case of explicit `all` strategy do not perform incremental copy
|
||||
val shouldPerformIncrementalCopy = isDevMode && !isExplicitDevModeAllStrategy
|
||||
|
||||
|
||||
+5
-5
@@ -106,11 +106,10 @@ abstract class AbstractKotlinCompileTool<T : CommonToolArguments>
|
||||
internal val defaultCompilerClasspath: ConfigurableFileCollection =
|
||||
project.objects.fileCollection()
|
||||
|
||||
init {
|
||||
this.doFirst {
|
||||
require(!defaultCompilerClasspath.isEmpty) {
|
||||
"Default Kotlin compiler classpath is empty! Task: $path (${this::class.qualifiedName})"
|
||||
}
|
||||
protected fun validateCompilerClasspath() {
|
||||
// Note that the check triggers configuration resolution
|
||||
require(!defaultCompilerClasspath.isEmpty) {
|
||||
"Default Kotlin compiler classpath is empty! Task: $path (${this::class.qualifiedName})"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -346,6 +345,7 @@ abstract class AbstractKotlinCompile<T : CommonCompilerArguments> : AbstractKotl
|
||||
}
|
||||
val buildMetrics = metrics.get()
|
||||
buildMetrics.measure(BuildTime.GRADLE_TASK_ACTION) {
|
||||
validateCompilerClasspath()
|
||||
systemPropertiesService.get().startIntercept()
|
||||
CompilerSystemProperties.KOTLIN_COMPILER_ENVIRONMENT_KEEPALIVE_PROPERTY.value = "true"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user