зеркало из https://github.com/aspnet/KoreBuild.git
Merge branch 'release' into dev
This commit is contained in:
Коммит
552166c854
|
@ -1 +1 @@
|
|||
1.0.0-rc2-002673
|
||||
1.0.0-rc2-002678
|
|
@ -1 +1 @@
|
|||
1.0.0-rc2-002673
|
||||
1.0.0-rc2-002678
|
|
@ -1 +1 @@
|
|||
1.0.0-rc2-002673
|
||||
1.0.0-rc2-002678
|
|
@ -2,22 +2,29 @@ use namespace="System"
|
|||
|
||||
functions
|
||||
@{
|
||||
DateTime Start = new DateTime(2015, 1, 1);
|
||||
|
||||
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)
|
||||
if (now >= Start)
|
||||
{
|
||||
var yearsSinceStart = (now.Year - start.Year) + 1;
|
||||
var yearsSinceStart = (now.Year - Start.Year) + 1;
|
||||
version = yearsSinceStart + now.ToString("MMdd");
|
||||
}
|
||||
|
||||
return version;
|
||||
}
|
||||
|
||||
string CreateSecondBasedTimeStamp()
|
||||
{
|
||||
var seconds = (long)(DateTime.UtcNow - Start).TotalSeconds;
|
||||
return seconds.ToString("x").PadLeft(9, (char)'0');
|
||||
}
|
||||
|
||||
private bool _buildQualitySet;
|
||||
private string _buildQuality;
|
||||
|
||||
|
@ -48,7 +55,7 @@ functions
|
|||
var buildNumber = Environment.GetEnvironmentVariable("KOREBUILD_BUILD_NUMBER");
|
||||
if (string.IsNullOrEmpty(buildNumber))
|
||||
{
|
||||
return "t" + DateTime.UtcNow.ToString("yyMMddHHmmss");
|
||||
return "t" + CreateSecondBasedTimeStamp();
|
||||
}
|
||||
|
||||
return !string.IsNullOrEmpty(BuildQuality) ? BuildQuality + "-" + buildNumber : buildNumber;
|
||||
|
|
Загрузка…
Ссылка в новой задаче