[kotlin-tooling-core] Support 'pub' suffix for KotlinToolingVersion
This commit is contained in:
committed by
Space
parent
2a9fd47755
commit
e6c0d73989
+1
-1
@@ -53,7 +53,7 @@ class KotlinToolingVersion(
|
|||||||
classifier.matches(Regex("""beta(\d*)?(-release)?-?\d*""")) -> Maturity.BETA
|
classifier.matches(Regex("""beta(\d*)?(-release)?-?\d*""")) -> Maturity.BETA
|
||||||
classifier.matches(Regex("""alpha(\d*)?(-release)?-?\d*""")) -> Maturity.ALPHA
|
classifier.matches(Regex("""alpha(\d*)?(-release)?-?\d*""")) -> Maturity.ALPHA
|
||||||
classifier.matches(Regex("""m\d+(-release)?(-\d*)?""")) -> Maturity.MILESTONE
|
classifier.matches(Regex("""m\d+(-release)?(-\d*)?""")) -> Maturity.MILESTONE
|
||||||
classifier.matches(Regex("""dev-?\d*""")) -> Maturity.DEV
|
classifier.matches(Regex("""(dev|pub)-?\d*""")) -> Maturity.DEV
|
||||||
classifier == "snapshot" -> Maturity.SNAPSHOT
|
classifier == "snapshot" -> Maturity.SNAPSHOT
|
||||||
else -> throw IllegalArgumentException("Can't infer maturity of KotlinVersion $this")
|
else -> throw IllegalArgumentException("Can't infer maturity of KotlinVersion $this")
|
||||||
}
|
}
|
||||||
|
|||||||
+24
@@ -82,6 +82,10 @@ class KotlinToolingVersionTest {
|
|||||||
assertTrue(
|
assertTrue(
|
||||||
KotlinToolingVersion("1.7.0-dev") > KotlinToolingVersion("1.7.0-snapshot")
|
KotlinToolingVersion("1.7.0-dev") > KotlinToolingVersion("1.7.0-snapshot")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
assertEquals(
|
||||||
|
0, KotlinToolingVersion("1.7.20-dev").compareTo(KotlinToolingVersion("1.7.20-pub"))
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -184,6 +188,26 @@ class KotlinToolingVersionTest {
|
|||||||
KotlinToolingVersion.Maturity.MILESTONE,
|
KotlinToolingVersion.Maturity.MILESTONE,
|
||||||
KotlinToolingVersion("1.6.20-M2411-1901").maturity
|
KotlinToolingVersion("1.6.20-M2411-1901").maturity
|
||||||
)
|
)
|
||||||
|
|
||||||
|
assertEquals(
|
||||||
|
KotlinToolingVersion.Maturity.DEV,
|
||||||
|
KotlinToolingVersion("1.6.20-dev-2411").maturity
|
||||||
|
)
|
||||||
|
|
||||||
|
assertEquals(
|
||||||
|
KotlinToolingVersion.Maturity.DEV,
|
||||||
|
KotlinToolingVersion("1.6.20-DeV").maturity
|
||||||
|
)
|
||||||
|
|
||||||
|
assertEquals(
|
||||||
|
KotlinToolingVersion.Maturity.DEV,
|
||||||
|
KotlinToolingVersion("1.6.20-pub-2411").maturity
|
||||||
|
)
|
||||||
|
|
||||||
|
assertEquals(
|
||||||
|
KotlinToolingVersion.Maturity.DEV,
|
||||||
|
KotlinToolingVersion("1.6.20-pUb").maturity
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
Reference in New Issue
Block a user