mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-04-28 15:06:45 +00:00
Consolidated DateStamp and AssemblyInfo generation.
This commit is contained in:
parent
08da770c7d
commit
63e31e34b2
|
@ -2,6 +2,8 @@
|
||||||
- Make a release from trunk.
|
- Make a release from trunk.
|
||||||
|
|
||||||
[Short term]
|
[Short term]
|
||||||
|
- Move Documentation generation to obj directory.
|
||||||
|
- Completely clean bin and obj directories on Clean command?
|
||||||
- Automate uploads of nightly builds.
|
- Automate uploads of nightly builds.
|
||||||
- Modify buildbot to generate zip package from the nsis installer.
|
- Modify buildbot to generate zip package from the nsis installer.
|
||||||
- Implement GL3.3 and 4.1.
|
- Implement GL3.3 and 4.1.
|
||||||
|
|
|
@ -53,7 +53,12 @@ namespace Build.Tasks
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Date = DateTime.Now.ToString("yyMMdd", CultureInfo.InvariantCulture);
|
// Build number is defined as the number of days since 1/1/2010.
|
||||||
|
// Revision number is defined as the fraction of the current day, expressed in seconds.
|
||||||
|
double timespan = DateTime.UtcNow.Subtract(new DateTime(2010, 1, 1)).TotalDays;
|
||||||
|
string build = ((int)timespan).ToString();
|
||||||
|
string revision = ((int)((timespan - (int)timespan) * UInt16.MaxValue)).ToString();
|
||||||
|
Date = String.Format("{0}.{1}", build, revision);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
|
|
@ -44,16 +44,11 @@ namespace Build.Tasks
|
||||||
public string Major { get; set; }
|
public string Major { get; set; }
|
||||||
public string Minor { get; set; }
|
public string Minor { get; set; }
|
||||||
|
|
||||||
string Build { get; set; }
|
string Date { get; set; }
|
||||||
string Revision { get; set; }
|
|
||||||
|
|
||||||
public GenerateAssemblyInfo()
|
public GenerateAssemblyInfo()
|
||||||
{
|
{
|
||||||
// Build number is defined as the number of days since 1/1/2010.
|
Date = new DateStamp().Date;
|
||||||
// Revision number is defined as the fraction of the current day, expressed in seconds.
|
|
||||||
double timespan = DateTime.UtcNow.Subtract(new DateTime(2010, 1, 1)).TotalDays;
|
|
||||||
Build = ((int)timespan).ToString();
|
|
||||||
Revision = ((int)((timespan - (int)timespan) * UInt16.MaxValue)).ToString();
|
|
||||||
Major = Major ?? "0";
|
Major = Major ?? "0";
|
||||||
Minor = Minor ?? "0";
|
Minor = Minor ?? "0";
|
||||||
}
|
}
|
||||||
|
@ -80,7 +75,7 @@ namespace Build.Tasks
|
||||||
sw.WriteLine("[assembly: AssemblyCopyright(\"{0}\")]", AssemblyCopyright ?? "");
|
sw.WriteLine("[assembly: AssemblyCopyright(\"{0}\")]", AssemblyCopyright ?? "");
|
||||||
sw.WriteLine("[assembly: AssemblyTrademark(\"{0}\")]", AssemblyTrademark ?? "");
|
sw.WriteLine("[assembly: AssemblyTrademark(\"{0}\")]", AssemblyTrademark ?? "");
|
||||||
sw.WriteLine("[assembly: AssemblyVersion(\"{0}.{1}.0.0\")]", Major, Minor);
|
sw.WriteLine("[assembly: AssemblyVersion(\"{0}.{1}.0.0\")]", Major, Minor);
|
||||||
sw.WriteLine("[assembly: AssemblyFileVersion(\"{0}.{1}.{2}.{3}\")]", Major, Minor, Build, Revision);
|
sw.WriteLine("[assembly: AssemblyFileVersion(\"{0}.{1}.{2}\")]", Major, Minor, Date);
|
||||||
|
|
||||||
sw.Flush();
|
sw.Flush();
|
||||||
sw.Close();
|
sw.Close();
|
||||||
|
|
Loading…
Reference in a new issue