(CoroutineDebugger) Disable agent for MPP projects
#KT-39412 fixed
This commit is contained in:
+2
-2
@@ -31,9 +31,9 @@ class KotlinGradleCoroutineDebugProjectResolver : AbstractProjectResolverExtensi
|
|||||||
if (task instanceof Test || task instanceof JavaExec) {
|
if (task instanceof Test || task instanceof JavaExec) {
|
||||||
def kotlinxCoroutinesCoreJar = task.classpath.find { it.name.startsWith("kotlinx-coroutines-core") }
|
def kotlinxCoroutinesCoreJar = task.classpath.find { it.name.startsWith("kotlinx-coroutines-core") }
|
||||||
if (kotlinxCoroutinesCoreJar) {
|
if (kotlinxCoroutinesCoreJar) {
|
||||||
def results = (kotlinxCoroutinesCoreJar.getName() =~ /kotlinx-coroutines-core[a-z\-]+(\d[\w\.\-]+)\.jar${'$'}/).findAll()
|
def results = (kotlinxCoroutinesCoreJar.getName() =~ /kotlinx-coroutines-core(\-jvm)?-(\d[\w\.\-]+)\.jar${'$'}/).findAll()
|
||||||
if (results) {
|
if (results) {
|
||||||
def version = results.first()[1]
|
def version = results.first()[2]
|
||||||
def referenceVersion = org.gradle.util.VersionNumber.parse('1.3.7-255')
|
def referenceVersion = org.gradle.util.VersionNumber.parse('1.3.7-255')
|
||||||
if (org.gradle.util.VersionNumber.parse(version) > referenceVersion) {
|
if (org.gradle.util.VersionNumber.parse(version) > referenceVersion) {
|
||||||
task.jvmArgs ("-javaagent:${'$'}{kotlinxCoroutinesCoreJar?.absolutePath}", "-ea")
|
task.jvmArgs ("-javaagent:${'$'}{kotlinxCoroutinesCoreJar?.absolutePath}", "-ea")
|
||||||
|
|||||||
+1
-1
@@ -57,7 +57,7 @@ class DebuggerConnection(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun determineCoreVersionMode(kotlinxCoroutinesCore: String): CoroutineDebuggerMode {
|
private fun determineCoreVersionMode(kotlinxCoroutinesCore: String): CoroutineDebuggerMode {
|
||||||
val regex = Regex(""".+\Wkotlinx-coroutines-core([\-a-z]+)(\d[\w\.\-]+)?\.jar""")
|
val regex = Regex(""".+\Wkotlinx-coroutines-core(\-jvm)?-(\d[\w\.\-]+)?\.jar""")
|
||||||
val matchResult = regex.matchEntire(kotlinxCoroutinesCore) ?: return CoroutineDebuggerMode.DISABLED
|
val matchResult = regex.matchEntire(kotlinxCoroutinesCore) ?: return CoroutineDebuggerMode.DISABLED
|
||||||
val versionToCompareTo = DefaultArtifactVersion("1.3.7-255")
|
val versionToCompareTo = DefaultArtifactVersion("1.3.7-255")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user