mirror of
https://github.com/Ryujinx/Opentk.git
synced 2024-12-28 00:15:45 +00:00
dd257ee29d
- DateStamp, which generates a version number based on the current date. - DelTree which mimics RemoveDir but can delete non-empty directories on xbuild 2.6.x (which only supports empty directories). - Run which mimics Exec but also captures stderr/stdout.
40 lines
940 B
C#
40 lines
940 B
C#
using System;
|
|
using System.Globalization;
|
|
using Microsoft.Build.Framework;
|
|
using Microsoft.Build.Utilities;
|
|
|
|
namespace Build.Tasks
|
|
{
|
|
/// <summary>
|
|
/// Returns a date stamp in the form yyMMdd.
|
|
/// </summary>
|
|
public class DateStamp : Task
|
|
{
|
|
string date;
|
|
|
|
/// <summary>
|
|
/// Gets a <see cref="System.String"/> represting the date stamp.
|
|
/// </summary>
|
|
[Output]
|
|
public string Date
|
|
{
|
|
get { return date; }
|
|
private set { date = value; }
|
|
}
|
|
|
|
public override bool Execute()
|
|
{
|
|
try
|
|
{
|
|
Date = DateTime.Now.ToString("yyMMdd", CultureInfo.InvariantCulture);
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
Log.LogErrorFromException(e);
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
}
|
|
}
|