mirror of
https://github.com/Ryujinx/Opentk.git
synced 2024-12-28 16:25:33 +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.
51 lines
1.3 KiB
C#
51 lines
1.3 KiB
C#
using System;
|
|
using System.Globalization;
|
|
using Microsoft.Build.Framework;
|
|
using Microsoft.Build.Utilities;
|
|
|
|
namespace Build.Tasks
|
|
{
|
|
/// <summary>
|
|
/// Deletes directory and all of its contents.
|
|
/// Replaces RemoveDir task which exhibits different behavior
|
|
/// on xbuild compared to msbuild: the first requires an empty
|
|
/// directory, while the latter does not.
|
|
/// </summary>
|
|
public class DelTree : Task
|
|
{
|
|
string path;
|
|
|
|
/// <summary>
|
|
/// The filesystem path to delete.
|
|
/// </summary>
|
|
[Required]
|
|
public string Path
|
|
{
|
|
get { return path; }
|
|
set { path = value; }
|
|
}
|
|
|
|
public override bool Execute()
|
|
{
|
|
try
|
|
{
|
|
if (String.IsNullOrEmpty(Path) ||
|
|
System.IO.Directory.Exists(Path))
|
|
{
|
|
return false;
|
|
}
|
|
else
|
|
{
|
|
System.IO.Directory.Delete(Path, true);
|
|
}
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
Log.LogErrorFromException(e);
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
}
|
|
}
|