Return back to using Exec task instead of JavaExec for serializing builtins
Idea patches all JavaExec tasks and enables debugger for them. This causes unexpected breakpoints stops during serialization (IDEA-200192). An attempt with explicit removing added agentlib:jdwp= parameter breaks Gradle up-to-date check for this task: > Task ':core:builtins:serialize' is not up-to-date because: > Value of input property 'jvmArgs' has changed for task ':core:builtins:serialize' Co-authored-by: Ilya Gorbunov <ilya.gorbunov@jetbrains.com>
This commit is contained in:
committed by
Ilya Gorbunov
parent
580d03be5f
commit
be92c5e787
@@ -18,21 +18,23 @@ val clean by tasks.getting {
|
||||
}
|
||||
}
|
||||
|
||||
val serialize by tasks.creating(JavaExec::class) {
|
||||
val JDK_18: String = rootProject.extra["JDK_18"] as String
|
||||
|
||||
// We avoid using JavaExec task here due to IDEA-200192:
|
||||
// IDEA attaches debugger to all JavaExec tasks making our breakpoints trigger during irrelevant task execution
|
||||
val serialize by tasks.creating(Exec::class) {
|
||||
val outDir = builtinsSerialized
|
||||
val inDirs = arrayOf(builtinsSrc, builtinsNative)
|
||||
inDirs.forEach { inputs.dir(it) }
|
||||
outputs.dir(outDir)
|
||||
|
||||
classpath(rootProject.buildscript.configurations["bootstrapCompilerClasspath"])
|
||||
main = "org.jetbrains.kotlin.serialization.builtins.RunKt"
|
||||
|
||||
doFirst {
|
||||
// Reassign to remove debugger options. Workaround for IDEA-200192.
|
||||
jvmArgs = listOf("-Didea.io.use.nio2=true")
|
||||
}
|
||||
|
||||
args(outDir, *inDirs)
|
||||
commandLine(
|
||||
"$JDK_18/bin/java",
|
||||
"-Didea.io.use.nio2=true",
|
||||
"-cp", rootProject.buildscript.configurations["bootstrapCompilerClasspath"].asPath,
|
||||
"org.jetbrains.kotlin.serialization.builtins.RunKt",
|
||||
outDir, *inDirs
|
||||
)
|
||||
}
|
||||
|
||||
val builtinsJar by task<Jar> {
|
||||
|
||||
Reference in New Issue
Block a user