Refactor the build scripts
- Bifurcate Package and Publish targets to enable signing. - Move publish from bash/ps into c#. - Create multiple targets to create MSIs and Bundles.
This commit is contained in:
parent
781678de92
commit
d4a3190bfc
25 changed files with 754 additions and 577 deletions
|
@ -0,0 +1,37 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Microsoft.DotNet.Cli.Build.Framework
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true, Inherited = false)]
|
||||
public class EnvironmentAttribute : TargetConditionAttribute
|
||||
{
|
||||
private string _envVar;
|
||||
private string _expectedVal;
|
||||
|
||||
public EnvironmentAttribute(string envVar, string expectedVal)
|
||||
{
|
||||
if (string.IsNullOrEmpty(envVar))
|
||||
{
|
||||
throw new ArgumentNullException("envVar");
|
||||
}
|
||||
|
||||
_envVar = envVar;
|
||||
_expectedVal = expectedVal;
|
||||
}
|
||||
|
||||
public override bool EvaluateCondition()
|
||||
{
|
||||
var actualVal = Environment.GetEnvironmentVariable(_envVar);
|
||||
|
||||
if (string.IsNullOrEmpty(_expectedVal))
|
||||
{
|
||||
return string.IsNullOrEmpty(actualVal) ||
|
||||
actualVal.Equals("0") ||
|
||||
actualVal.ToLower().Equals("false");
|
||||
}
|
||||
|
||||
return _expectedVal.Equals(actualVal, StringComparison.Ordinal);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue