(CoroutineDebugger) Enable agent for versions 1.3.8.*

Gradle artifact name gets changed from 'kotlinx-coroutines-core' to
'kotlinx-coroutines-core-jvm'. So it should support both.
This commit is contained in:
Vladimir Ilmov
2020-07-27 14:20:33 +02:00
parent c91858d470
commit 7eca13569b
2 changed files with 6 additions and 6 deletions
@@ -31,12 +31,12 @@ class KotlinGradleCoroutineDebugProjectResolver : AbstractProjectResolverExtensi
if (task instanceof Test || task instanceof JavaExec) {
def kotlinxCoroutinesCoreJar = task.classpath.find { it.name.startsWith("kotlinx-coroutines-core") }
if (kotlinxCoroutinesCoreJar) {
def results = (kotlinxCoroutinesCoreJar.getName() =~ /kotlinx-coroutines-core\-([\d\.]+)\.jar${'$'}/).findAll()
def results = (kotlinxCoroutinesCoreJar.getName() =~ /kotlinx-coroutines-core[a-z\-]+(\d[\w\.\-]+)\.jar${'$'}/).findAll()
if (results) {
def version = results.first()[1]
if (org.gradle.util.VersionNumber.parse( version ) >= org.gradle.util.VersionNumber.parse('1.3.8')) {
def referenceVersion = org.gradle.util.VersionNumber.parse('1.3.7-255')
if (org.gradle.util.VersionNumber.parse(version) > referenceVersion) {
task.jvmArgs ("-javaagent:${'$'}{kotlinxCoroutinesCoreJar?.absolutePath}", "-ea")
return
}
}
}