[Gradle, JS] Introduce semver satisfying for comparison with wildcard
This commit is contained in:
@@ -49,6 +49,7 @@ dependencies {
|
||||
|
||||
compile("com.google.code.gson:gson:${rootProject.extra["versions.jar.gson"]}")
|
||||
compile("de.undercouch:gradle-download-task:4.0.2")
|
||||
implementation("com.github.gundy:semver4j:0.16.4")
|
||||
|
||||
compileOnly("com.android.tools.build:gradle:2.0.0")
|
||||
compileOnly("com.android.tools.build:gradle-core:2.0.0")
|
||||
|
||||
+5
-1
@@ -5,6 +5,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.gradle.targets.js.yarn
|
||||
|
||||
import com.github.gundy.semver4j.SemVer
|
||||
import org.gradle.api.Project
|
||||
import org.jetbrains.kotlin.gradle.internal.execWithProgress
|
||||
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin
|
||||
@@ -156,7 +157,10 @@ private class YarnEntryRegistry(lockFile: File) {
|
||||
if (entry == null && version == "*") {
|
||||
val searchKey = dependencyKey(packageKey, "")
|
||||
entry = entryMap.entries
|
||||
.firstOrNull { it.key.startsWith(searchKey) }
|
||||
.filter { it.key.startsWith(searchKey) }
|
||||
.firstOrNull {
|
||||
SemVer.satisfies(it.key.removePrefix(searchKey), "*")
|
||||
}
|
||||
?.value
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user