Adjust PEVersionTask regex to allow any commit hash length

This commit is contained in:
booky10 committed 2024-07-08 04:18:25 +02:00
1 parent 05c116271e
commit a830fe8b63
1 file changed
+1 -1
@@ -61,7 +61,7 @@ abstract class PEVersionTask : DefaultTask() {
val snapShot: Boolean
) {
companion object {
private val REGEX = Regex("""(\d+)\.(\d+)\.(\d+)(?:\+[0-9a-f]{8,})?(-SNAPSHOT)?""")
private val REGEX = Regex("""(\d+)\.(\d+)\.(\d+)(?:\+[0-9a-f]+)?(-SNAPSHOT)?""")
fun fromString(version: String): Version {
val match = REGEX.matchEntire(version) ?: throw IllegalArgumentException("Invalid version: $version")