[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
|
@TaskAction
|
||||||
fun performDce(inputChanges: InputChanges) {
|
fun performDce(inputChanges: InputChanges) {
|
||||||
|
validateCompilerClasspath()
|
||||||
// in case of explicit `all` strategy do not perform incremental copy
|
// in case of explicit `all` strategy do not perform incremental copy
|
||||||
val shouldPerformIncrementalCopy = isDevMode && !isExplicitDevModeAllStrategy
|
val shouldPerformIncrementalCopy = isDevMode && !isExplicitDevModeAllStrategy
|
||||||
|
|
||||||
|
|||||||
+5
-5
@@ -106,11 +106,10 @@ abstract class AbstractKotlinCompileTool<T : CommonToolArguments>
|
|||||||
internal val defaultCompilerClasspath: ConfigurableFileCollection =
|
internal val defaultCompilerClasspath: ConfigurableFileCollection =
|
||||||
project.objects.fileCollection()
|
project.objects.fileCollection()
|
||||||
|
|
||||||
init {
|
protected fun validateCompilerClasspath() {
|
||||||
this.doFirst {
|
// Note that the check triggers configuration resolution
|
||||||
require(!defaultCompilerClasspath.isEmpty) {
|
require(!defaultCompilerClasspath.isEmpty) {
|
||||||
"Default Kotlin compiler classpath is empty! Task: $path (${this::class.qualifiedName})"
|
"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()
|
val buildMetrics = metrics.get()
|
||||||
buildMetrics.measure(BuildTime.GRADLE_TASK_ACTION) {
|
buildMetrics.measure(BuildTime.GRADLE_TASK_ACTION) {
|
||||||
|
validateCompilerClasspath()
|
||||||
systemPropertiesService.get().startIntercept()
|
systemPropertiesService.get().startIntercept()
|
||||||
CompilerSystemProperties.KOTLIN_COMPILER_ENVIRONMENT_KEEPALIVE_PROPERTY.value = "true"
|
CompilerSystemProperties.KOTLIN_COMPILER_ENVIRONMENT_KEEPALIVE_PROPERTY.value = "true"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user