Report EOL and maintenance status for Gradle versions

This commit is contained in:
Vlad Chesnokov
2026-08-26 12:38:45 +02:00
parent 346a44564f
commit dfc644bc4a
16 changed files with 423 additions and 31 deletions
+24
View File
@@ -0,0 +1,24 @@
export class GradleVersion {
static PATTERN = /((\d+)(\.\d+)+)(-([a-z]+)-(\w+))?(-(SNAPSHOT|\d{14}([-+]\d{4})?))?/
major: number
versionPart: string
stagePart: string
snapshotPart: string
constructor(readonly version: string) {
const matcher = GradleVersion.PATTERN.exec(version)
if (!matcher) {
throw new Error(`'${version}' is not a valid Gradle version string (examples: '1.0', '1.0-rc-1')`)
}
this.major = Number(matcher[2])
this.versionPart = matcher[1]
this.stagePart = matcher[4]
this.snapshotPart = matcher[7]
}
isFinalRelease(): boolean {
return !this.stagePart && !this.snapshotPart
}
}