Note: This API documentation is for FAKE version 4. The migration API documentation can be found here. The API documentation for the new fake 5 modules can be found here

SemVerHelper

Contains helpers which allow to deal with Semantic Versioning (SemVer).

Nested types and modules

TypeDescription
Ident
PreRelease
SemVerInfo

Contains the version information.

Functions and values

Function or valueDescription
identRE
Signature: Regex
isValidSemVer(input)
Signature: input:string -> bool

Returns true if input appears to be a parsable semver string

parse(version)
Signature: version:string -> SemVerInfo

Parses the given version string into a SemVerInfo which can be printed using ToString() or compared according to the rules described in the SemVer docs.

Sample

1: 
2: 
3: 
4: 
5: 
6: 
7: 
8: 
parse "1.0.0-rc.1"     < parse "1.0.0"          // true
parse "1.2.3-alpha"    > parse "1.2.2"          // true
parse "1.2.3-alpha2"   > parse "1.2.3-alpha"    // true, but only because of lexical compare
parse "1.2.3-alpha002" > parse "1.2.3-alpha1"   // false, due to lexical compare
parse "1.5.0-beta.2"   > parse "1.5.0-rc.1"     // false, due to lexical compare of first prerelease identitifer
parse "1.5.0-beta.2"   > parse "1.5.0-beta.3"   // true, due to numeric compare of second prerelease identitifer
parse "1.5.0-0123.001" < parse "1.5.0-0123.002" // true, due to numeric compare of second prerelease identifier
parse "1.0.0+lol"      = parse "1.0.0"          // true, because build identifiers do not influence comparison
parseIdent(s)
Signature: s:string -> Ident
SemVerPattern
Signature: string