Add Conditional Target capabilities to the build scripts
Make Attribute properties immutable PR Feedback, bugfixes PR Feedback
This commit is contained in:
parent
adc6aa7eff
commit
6d8b622451
16 changed files with 415 additions and 116 deletions
|
@ -0,0 +1,50 @@
|
|||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue