Set the file version environment variable
This commit is contained in:
parent
9e872c3721
commit
188f5e8328
|
|
@ -3,6 +3,22 @@ use namespace="System"
|
|||
|
||||
functions
|
||||
@{
|
||||
string CreateDayBasedVersionNumber()
|
||||
{
|
||||
var start = new DateTime(2015, 1, 1);
|
||||
var now = DateTime.UtcNow;
|
||||
|
||||
string version = "0";
|
||||
// If the computer date is set before the start date, then the version is 0
|
||||
if (now >= start)
|
||||
{
|
||||
var monthsSinceStart = (now.Year - start.Year) * 12 + now.Month;
|
||||
version = monthsSinceStart.ToString("000") + now.Day.ToString("00");
|
||||
}
|
||||
|
||||
return version;
|
||||
}
|
||||
|
||||
string BuildNumber
|
||||
{
|
||||
get
|
||||
|
|
|
|||
|
|
@ -20,6 +20,10 @@ default Configuration='${E("Configuration")}'
|
|||
{
|
||||
E("DNX_AUTHOR", AUTHORS);
|
||||
}
|
||||
if (string.IsNullOrEmpty(E("DNX_ASSEMBLY_FILE_VERSION")))
|
||||
{
|
||||
E("DNX_ASSEMBLY_FILE_VERSION", CreateDayBasedVersionNumber());
|
||||
}
|
||||
if (string.IsNullOrEmpty(Configuration))
|
||||
{
|
||||
Configuration = "Debug";
|
||||
|
|
|
|||
Loading…
Reference in New Issue