(CoroutineDebugger) minimum supported version kotlinx-coroutines-core.1.3.8
Workaround for starting agent on windows removed, version upgraded in tests #KT-40073 fixed
This commit is contained in:
+1
-6
@@ -29,22 +29,17 @@ class KotlinGradleCoroutineDebugProjectResolver : AbstractProjectResolverExtensi
|
||||
"""
|
||||
gradle.taskGraph.beforeTask { Task task ->
|
||||
if (task instanceof Test) {
|
||||
def kotlinxCoroutinesDebugJar = task.classpath.find { it.name.startsWith("kotlinx-coroutines-debug") }
|
||||
def kotlinxCoroutinesCoreJar = task.classpath.find { it.name.startsWith("kotlinx-coroutines-core") }
|
||||
if (kotlinxCoroutinesCoreJar) {
|
||||
def results = (kotlinxCoroutinesCoreJar.getName() =~ /kotlinx-coroutines-core\-([\d\.]+)\.jar${'$'}/).findAll()
|
||||
if (results) {
|
||||
def version = results.first()[1]
|
||||
if (org.gradle.util.VersionNumber.parse( version ) >= org.gradle.util.VersionNumber.parse('1.3.6')) {
|
||||
if (org.gradle.util.VersionNumber.parse( version ) >= org.gradle.util.VersionNumber.parse('1.3.8')) {
|
||||
task.jvmArgs ("-javaagent:${'$'}{kotlinxCoroutinesCoreJar?.absolutePath}", "-ea")
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
if (kotlinxCoroutinesDebugJar) {
|
||||
task.jvmArgs ("-javaagent:${'$'}{kotlinxCoroutinesDebugJar?.absolutePath}", "-ea")
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
""".trimIndent()
|
||||
|
||||
+6
-11
@@ -43,18 +43,12 @@ class DebuggerConnection(
|
||||
if (params is JavaParameters && modifyArgs) {
|
||||
// gradle related logic in KotlinGradleCoroutineDebugProjectResolver
|
||||
val kotlinxCoroutinesCore = params.classPath?.pathList?.firstOrNull { it.contains("kotlinx-coroutines-core") }
|
||||
val kotlinxCoroutinesDebug = params.classPath?.pathList?.firstOrNull { it.contains("kotlinx-coroutines-debug") }
|
||||
|
||||
if (kotlinxCoroutinesCore != null) {
|
||||
val coreVersion = determineCoreVersionMode(kotlinxCoroutinesCore)
|
||||
val mode = if (coreVersion == CoroutineDebuggerMode.DISABLED && kotlinxCoroutinesDebug != null)
|
||||
CoroutineDebuggerMode.VERSION_UP_TO_1_3_5
|
||||
else
|
||||
coreVersion
|
||||
val mode = determineCoreVersionMode(kotlinxCoroutinesCore)
|
||||
|
||||
when (mode) {
|
||||
CoroutineDebuggerMode.VERSION_1_3_6_AND_UP -> initializeCoroutineAgent(params, kotlinxCoroutinesCore)
|
||||
CoroutineDebuggerMode.VERSION_UP_TO_1_3_5 -> initializeCoroutineAgent(params, kotlinxCoroutinesDebug)
|
||||
CoroutineDebuggerMode.VERSION_1_3_8_AND_UP -> initializeCoroutineAgent(params, kotlinxCoroutinesCore)
|
||||
else -> log.debug("CoroutineDebugger disabled.")
|
||||
}
|
||||
}
|
||||
@@ -65,11 +59,11 @@ class DebuggerConnection(
|
||||
private fun determineCoreVersionMode(kotlinxCoroutinesCore: String): CoroutineDebuggerMode {
|
||||
val regex = Regex(""".+\Wkotlinx-coroutines-core-(.+)?\.jar""")
|
||||
val matchResult = regex.matchEntire(kotlinxCoroutinesCore) ?: return CoroutineDebuggerMode.DISABLED
|
||||
val versionToCompareTo = DefaultArtifactVersion("1.3.5-255")
|
||||
val versionToCompareTo = DefaultArtifactVersion("1.3.7-255")
|
||||
|
||||
val artifactVersion = DefaultArtifactVersion(matchResult.groupValues[1])
|
||||
return if (artifactVersion >= versionToCompareTo)
|
||||
CoroutineDebuggerMode.VERSION_1_3_6_AND_UP
|
||||
CoroutineDebuggerMode.VERSION_1_3_8_AND_UP
|
||||
else
|
||||
CoroutineDebuggerMode.DISABLED
|
||||
}
|
||||
@@ -122,5 +116,6 @@ class DebuggerConnection(
|
||||
enum class CoroutineDebuggerMode {
|
||||
DISABLED,
|
||||
VERSION_UP_TO_1_3_5,
|
||||
VERSION_1_3_6_AND_UP
|
||||
VERSION_1_3_6_AND_UP,
|
||||
VERSION_1_3_8_AND_UP,
|
||||
}
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.idea.debugger.test
|
||||
|
||||
import org.junit.runner.RunWith
|
||||
import org.junit.runners.Suite
|
||||
|
||||
@Suite.SuiteClasses(
|
||||
ContinuationStackTraceTestGenerated::class,
|
||||
XCoroutinesStackTraceTestGenerated::class
|
||||
)
|
||||
@RunWith(Suite::class)
|
||||
class CoroutineDebuggerTestSuite
|
||||
-2
@@ -111,8 +111,6 @@ internal class KotlinOutputChecker(
|
||||
|
||||
return lines
|
||||
.map { it.replace("FRAME:(.*):\\d+".toRegex(), "$1:!LINE_NUMBER!") }
|
||||
// kotlinx-coroutines-core temporary fix for windows agents
|
||||
.filterNot { it == "Failed to install signal handler: java.lang.IllegalArgumentException: Unknown signal: TRAP" }
|
||||
.filter { !(it.matches(JDI_BUG_OUTPUT_PATTERN_1) || it.matches(JDI_BUG_OUTPUT_PATTERN_2)) }
|
||||
.joinToString("\n")
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
package continuation
|
||||
// ATTACH_LIBRARY: maven(org.jetbrains.kotlinx:kotlinx-coroutines-debug:1.3.4)-javaagent
|
||||
// ATTACH_LIBRARY: maven(org.jetbrains.kotlinx:kotlinx-coroutines-debug:1.3.8)-javaagent
|
||||
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import kotlinx.coroutines.yield
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
package continuation
|
||||
// ATTACH_LIBRARY: maven(org.jetbrains.kotlinx:kotlinx-coroutines-debug:1.3.4)-javaagent
|
||||
// ATTACH_LIBRARY: maven(org.jetbrains.kotlinx:kotlinx-coroutines-debug:1.3.8)-javaagent
|
||||
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import kotlinx.coroutines.yield
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
package continuation
|
||||
// ATTACH_LIBRARY: maven(org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.6)-javaagent
|
||||
// ATTACH_LIBRARY: maven(org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.8)-javaagent
|
||||
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import kotlinx.coroutines.yield
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package continuation
|
||||
|
||||
// ATTACH_LIBRARY: maven(org.jetbrains.kotlinx:kotlinx-coroutines-debug:1.3.4)-javaagent
|
||||
// ATTACH_LIBRARY: maven(org.jetbrains.kotlinx:kotlinx-coroutines-debug:1.3.8)-javaagent
|
||||
|
||||
import kotlinx.coroutines.coroutineScope
|
||||
import kotlinx.coroutines.delay
|
||||
|
||||
Reference in New Issue
Block a user