An addin for Cake that allows for the easy retrieval of version numbers from an assembly. Also support creating CI version numbers that fit with SemVer based on this article.
You can easily reference Cake.VersionReader directly in your build script using Cake's Addin syntax:
#addin nuget:?package=Cake.VersionReader
The following methods are provided:
- GetVersionNumber(this ICakeContext context, FilePath file)
Get the version number for the spesified file in the SemVer format "0.0.0"
- GetFullVersionNumber(this ICakeContext context, FilePath file)
Get the version number for the spesified file in 4-digit format "0.0.0.0"
- GetVersionNumberWithContinuesIntegrationNumberAppended(this ICakeContext context, FilePath file, int buildNumber)
Get the CI version number in the format "0.0.0-CI00000"
- GetFullVersionNumberWithContinuesIntegrationNumberAppended(this ICakeContext context, FilePath file, int buildNumber)
Get the CI version number in the format "0.0.0.0-CI00000"
Cyclops by Mike Hince from the Noun Project, remixed with the Cake icon.