d4a3190bfc
- Bifurcate Package and Publish targets to enable signing. - Move publish from bash/ps into c#. - Create multiple targets to create MSIs and Bundles.
34 lines
No EOL
894 B
C#
34 lines
No EOL
894 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace Microsoft.DotNet.Cli.Build.Framework
|
|
{
|
|
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
|
|
public class BuildPlatformsAttribute : TargetConditionAttribute
|
|
{
|
|
private IEnumerable<BuildPlatform> _buildPlatforms;
|
|
|
|
public BuildPlatformsAttribute(params BuildPlatform[] platforms)
|
|
{
|
|
if (platforms == null)
|
|
{
|
|
throw new ArgumentNullException("platforms");
|
|
}
|
|
|
|
_buildPlatforms = platforms;
|
|
}
|
|
|
|
public override bool EvaluateCondition()
|
|
{
|
|
foreach (var platform in _buildPlatforms)
|
|
{
|
|
if (CurrentPlatform.IsPlatform(platform))
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
|
|
return false;
|
|
}
|
|
}
|
|
} |