dotnet-installer/scripts/Microsoft.DotNet.Cli.Build.Framework/CurrentArchitecture.cs
Bryan Thornbury 6d8b622451 Add Conditional Target capabilities to the build scripts
Make Attribute properties immutable

PR Feedback, bugfixes

PR Feedback
2016-02-24 16:55:11 -08:00

50 lines
No EOL
1.2 KiB
C#

using System;
using Microsoft.Extensions.PlatformAbstractions;
namespace Microsoft.DotNet.Cli.Build.Framework
{
public static class CurrentArchitecture
{
public static BuildArchitecture Current
{
get
{
return DetermineCurrentArchitecture();
}
}
public static bool Isx86
{
get
{
var archName = PlatformServices.Default.Runtime.RuntimeArchitecture;
return string.Equals(archName, "x86", StringComparison.OrdinalIgnoreCase);
}
}
public static bool Isx64
{
get
{
var archName = PlatformServices.Default.Runtime.RuntimeArchitecture;
return string.Equals(archName, "x64", StringComparison.OrdinalIgnoreCase);
}
}
private static BuildArchitecture DetermineCurrentArchitecture()
{
if (Isx86)
{
return BuildArchitecture.x86;
}
else if (Isx64)
{
return BuildArchitecture.x64;
}
else
{
return default(BuildArchitecture);
}
}
}
}