Add ResolveContext

This commit is contained in:
Him188 2020-09-20 19:05:45 +08:00
parent 57c30e4689
commit 704674698f

View File

@ -124,11 +124,12 @@ internal constructor(
*/
@Throws(IllegalArgumentException::class)
@JvmStatic
public fun parseRangeRequirement(requirement: String): Requirement = SemVersionInternal.parseRangeRequirement(requirement)
public fun parseRangeRequirement(requirement: String): Requirement =
SemVersionInternal.parseRangeRequirement(requirement)
/** @see [Requirement.test] */
@JvmStatic
public fun Requirement.test(version: String): Boolean = test(invoke(version))
public fun Requirement.test(@ResolveContext(PLUGIN_VERSION) version: String): Boolean = test(invoke(version))
/**
* 当满足 [requirement] 时返回 true, 否则返回 false
@ -144,7 +145,7 @@ internal constructor(
/** for Kotlin only */
@JvmStatic
@JvmSynthetic
public operator fun Requirement.contains(version: String): Boolean = test(version)
public operator fun Requirement.contains(@ResolveContext(PLUGIN_VERSION) version: String): Boolean = test(version)
}
@Transient