本文整理汇总了C#中BuildInfo类的典型用法代码示例。如果您正苦于以下问题:C# BuildInfo类的具体用法?C# BuildInfo怎么用?C# BuildInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BuildInfo类属于命名空间,在下文中一共展示了BuildInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetBuildDoneImage
public static ControlTemplate GetBuildDoneImage(BuildInfo buildInfo, IEnumerable<ProjectItem> allProjects, out ControlTemplate stateImage)
{
if (buildInfo == null || buildInfo.BuildAction == null || buildInfo.BuildScope == null)
{
stateImage = null;
return VectorResources.TryGet(BuildActionResourcesUri, "StandBy");
}
if (allProjects == null)
throw new InvalidOperationException();
int errorProjectsCount = allProjects.Count(item => item.State.IsErrorState());
bool buildedProjectsSuccess = buildInfo.BuildedProjects.BuildWithoutErrors;
string stateKey;
if (buildInfo.BuildIsCancelled)
stateKey = "BuildCancelled";
else if (!buildedProjectsSuccess)
stateKey = "BuildError";
else if (buildedProjectsSuccess && errorProjectsCount == 0)
stateKey = "BuildDone";
else if (buildedProjectsSuccess && errorProjectsCount != 0)
stateKey = "BuildErrorDone";
else
throw new InvalidOperationException();
stateImage = VectorResources.TryGet(BuildStateResourcesUri, stateKey);
string actionKey = GetBuildActionResourceKey(buildInfo.BuildAction.Value);
return VectorResources.TryGet(BuildActionResourcesUri, actionKey);
}
示例2: BuildMethodCall
protected override IBuildContext BuildMethodCall(ExpressionBuilder builder, MethodCallExpression methodCall, BuildInfo buildInfo)
{
var sequence = builder.BuildSequence(new BuildInfo(buildInfo, methodCall.Arguments[0]));
if (sequence.SelectQuery.Select.TakeValue != null || sequence.SelectQuery.Select.SkipValue != null)
sequence = new SubQueryContext(sequence);
var lambda = (LambdaExpression)methodCall.Arguments[1].Unwrap();
var sparent = sequence.Parent;
var order = new ExpressionContext(buildInfo.Parent, sequence, lambda);
var body = lambda.Body.Unwrap();
var sql = builder.ConvertExpressions(order, body, ConvertFlags.Key);
builder.ReplaceParent(order, sparent);
if (!methodCall.Method.Name.StartsWith("Then"))
sequence.SelectQuery.OrderBy.Items.Clear();
foreach (var expr in sql)
{
var e = builder.ConvertSearchCondition(sequence, expr.Sql);
sequence.SelectQuery.OrderBy.Expr(e, methodCall.Method.Name.EndsWith("Descending"));
}
return sequence;
}
示例3: Create
public static IncrementalBuildContext Create(DocumentBuildParameters parameters, BuildInfo cb, BuildInfo lb, string intermediateFolder)
{
if (parameters == null)
{
throw new ArgumentNullException(nameof(parameters));
}
if (cb == null)
{
throw new ArgumentNullException(nameof(cb));
}
if (intermediateFolder == null)
{
throw new ArgumentNullException(nameof(intermediateFolder));
}
var baseDir = Path.Combine(intermediateFolder, cb.DirectoryName);
var lastBaseDir = lb != null ? Path.Combine(intermediateFolder, lb.DirectoryName) : null;
var lastBuildStartTime = lb?.BuildStartTime;
var canBuildInfoIncremental = CanBuildInfoIncremental(cb, lb);
var lbv = lb?.Versions?.SingleOrDefault(v => v.VersionName == parameters.VersionName);
var cbv = new BuildVersionInfo
{
VersionName = parameters.VersionName,
ConfigHash = ComputeConfigHash(parameters),
AttributesFile = IncrementalUtility.CreateRandomFileName(baseDir),
DependencyFile = IncrementalUtility.CreateRandomFileName(baseDir),
ManifestFile = IncrementalUtility.CreateRandomFileName(baseDir),
XRefSpecMapFile = IncrementalUtility.CreateRandomFileName(baseDir),
BuildMessageFile = IncrementalUtility.CreateRandomFileName(baseDir),
Attributes = ComputeFileAttributes(parameters, lbv?.Dependency),
Dependency = new DependencyGraph(),
};
cb.Versions.Add(cbv);
var context = new IncrementalBuildContext(baseDir, lastBaseDir, lastBuildStartTime, canBuildInfoIncremental, parameters, cbv, lbv);
return context;
}
示例4: Build
/// <summary>
/// Constructor
/// </summary>
/// <param name="buildInfo">Build Info</param>
public Build(BuildInfo buildInfo)
{
this.buildInfo = buildInfo;
sProjectDir = sProjectsDir + @"\project-" + buildInfo.project_id;
commands = new LinkedList<string>();
__output.Clear();
}
示例5: DrawGUI
public override void DrawGUI(Rect position, BuildInfo buildReportToDisplay)
{
GUILayout.Space(2); // top padding for scrollbar
_assetListScrollPos = GUILayout.BeginScrollView(_assetListScrollPos);
GUILayout.Space(10); // top padding for content
GUILayout.BeginHorizontal();
GUILayout.Space(10); // extra left padding
DrawTotalSize(buildReportToDisplay);
GUILayout.Space(BuildReportTool.Window.Settings.CATEGORY_HORIZONTAL_SPACING);
GUILayout.BeginVertical();
DrawBuildSizes(buildReportToDisplay);
GUILayout.Space(BuildReportTool.Window.Settings.CATEGORY_VERTICAL_SPACING);
DrawDLLList(buildReportToDisplay);
GUILayout.EndVertical();
GUILayout.Space(20); // extra right padding
GUILayout.EndHorizontal();
GUILayout.EndScrollView();
}
示例6: BuildMethodCall
protected override IBuildContext BuildMethodCall(ExpressionBuilder builder, MethodCallExpression methodCall, BuildInfo buildInfo)
{
var sequence = builder.BuildSequence(new BuildInfo(buildInfo, methodCall.Arguments[0]));
var query = builder.BuildSequence(new BuildInfo(buildInfo, methodCall.Arguments[1], new SqlQuery()));
var except = query.SqlQuery;
sequence = new SubQueryContext(sequence);
var sql = sequence.SqlQuery;
except.ParentSql = sql;
if (methodCall.Method.Name == "Except")
sql.Where.Not.Exists(except);
else
sql.Where.Exists(except);
var keys1 = sequence.ConvertToSql(null, 0, ConvertFlags.Key);
var keys2 = query. ConvertToSql(null, 0, ConvertFlags.Key);
if (keys1.Length != keys2.Length)
throw new InvalidOperationException();
for (var i = 0; i < keys1.Length; i++)
{
except.Where
.Expr(keys1[i].Sql)
.Equal
.Expr(keys2[i].Sql);
}
return sequence;
}
示例7: getBuild
/// <summary>
/// Get a new build
/// </summary>
/// <returns>BuildInfo object or null on error/no build</returns>
public static BuildInfo getBuild()
{
Console.WriteLine("* Checking for builds...");
string sPostBody = "token=" + Uri.EscapeDataString(Config.token);
string sResp = post(apiurl + "/builds/register.json", sPostBody);
try
{
if (!String.IsNullOrEmpty(sResp))
{
JsonObject obj = JsonObject.Parse(sResp);
if (obj != null)
{
BuildInfo info = new BuildInfo();
info.id = obj.Get<int>("id");
info.project_id = obj.Get<int>("project_id");
info.commands = obj.Get<string[]>("commands");
info.repo_url = obj.Get("repo_url");
info.reference = obj.Get("sha");
info.ref_name = obj.Get("ref");
return info;
}
}
else
{
Console.WriteLine("* Nothing");
}
}
catch (Exception)
{
Console.WriteLine("* Failed");
}
return null;
}
示例8: IsSequence
public bool IsSequence(ExpressionBuilder builder, BuildInfo buildInfo)
{
var expr = (ChangeTypeExpression)buildInfo.Expression;
var info = new BuildInfo(buildInfo, expr.Expression);
return GetBuilder(builder, info).IsSequence(builder, info);
}
示例9: Convert
protected override SequenceConvertInfo Convert(
ExpressionBuilder builder, MethodCallExpression methodCall, BuildInfo buildInfo, ParameterExpression param)
{
var predicate = (LambdaExpression)methodCall.Arguments[1].Unwrap();
var info = builder.ConvertSequence(new BuildInfo(buildInfo, methodCall.Arguments[0]), predicate.Parameters[0]);
if (info != null)
{
info.Expression = methodCall.Transform(ex => ConvertMethod(methodCall, 0, info, predicate.Parameters[0], ex));
if (param != null)
{
if (param.Type != info.Parameter.Type)
param = Expression.Parameter(info.Parameter.Type, param.Name);
if (info.ExpressionsToReplace != null)
foreach (var path in info.ExpressionsToReplace)
{
path.Path = path.Path.Transform(e => e == info.Parameter ? param : e);
path.Expr = path.Expr.Transform(e => e == info.Parameter ? param : e);
}
}
info.Parameter = param;
return info;
}
return null;
}
示例10: DrawGUI
public override void DrawGUI(Rect position, BuildInfo buildReportToDisplay)
{
if (!buildReportToDisplay.HasUsedAssets)
{
return;
}
// init variables to use
// --------------------------------------------------------------------------
BuildReportTool.FileFilterGroup fileFilterGroupToUse = buildReportToDisplay.FileFilters;
if (BuildReportTool.Options.ShouldUseConfiguredFileFilters())
{
fileFilterGroupToUse = _configuredFileFilterGroup;
}
BuildReportTool.AssetList listToDisplay = GetAssetListToDisplay(buildReportToDisplay);
//BuildReportTool.SizePart[] assetListToUse = listToDisplay.GetListToDisplay(fileFilterGroupToUse);
//
//if (assetListToUse == null || assetListToUse.Length == 0)
//{
// fileFilterGroupToUse.ForceSetSelectedFilterIdx(0);
//}
if (listToDisplay == null)
{
if (IsShowingUsedAssets)
{
Utility.DrawCentralMessage(position, "No \"Used Assets\" included in this build report.");
}
else if (IsShowingUnusedAssets)
{
Utility.DrawCentralMessage(position, "No \"Unused Assets\" included in this build report.");
}
return;
}
// gui
// --------------------------------------------------------------------------
GUILayout.Space(1);
DrawTopBar(position, buildReportToDisplay, fileFilterGroupToUse);
if (buildReportToDisplay.HasUsedAssets)
{
DrawAssetList(position, listToDisplay, fileFilterGroupToUse, BuildReportTool.Options.AssetListPaginationLength);
}
// status bar at bottom
// --------------------------------------------------------------------------
GUILayout.Space(20);
string selectedInfoLabel = string.Format("{0}{1}. {2}{3} ({4}%) Click on an asset's checkbox to include it in size calculation. Click on the filename to highlight it on your Project window.", Labels.SELECTED_QTY_LABEL, listToDisplay.GetSelectedCount().ToString("N0"), Labels.SELECTED_SIZE_LABEL, listToDisplay.GetReadableSizeOfSumSelection(), listToDisplay.GetPercentageOfSumSelection().ToString("N"));
GUI.Label(new Rect(0, position.height - 20, position.width, 20), selectedInfoLabel, BuildReportTool.Window.Settings.STATUS_BAR_LABEL_STYLE_NAME);
}
示例11: DocumentBuilder
public DocumentBuilder(
IEnumerable<Assembly> assemblies,
ImmutableArray<string> postProcessorNames,
string templateHash,
string intermediateFolder = null,
string commitFromSHA = null,
string commitToSHA = null)
{
Logger.LogVerbose("Loading plug-in...");
using (new LoggerPhaseScope("ImportPlugins", true))
{
var assemblyList = assemblies?.ToList();
_container = GetContainer(assemblyList);
_container.SatisfyImports(this);
_currentBuildInfo.CommitFromSHA = commitFromSHA;
_currentBuildInfo.CommitToSHA = commitToSHA;
if (intermediateFolder != null)
{
_currentBuildInfo.PluginHash = ComputePluginHash(assemblyList);
_currentBuildInfo.TemplateHash = templateHash;
_currentBuildInfo.DirectoryName = IncrementalUtility.CreateRandomDirectory(intermediateFolder);
}
}
Logger.LogInfo($"{Processors.Count()} plug-in(s) loaded.");
foreach (var processor in Processors)
{
Logger.LogVerbose($"\t{processor.Name} with build steps ({string.Join(", ", from bs in processor.BuildSteps orderby bs.BuildOrder select bs.Name)})");
}
_postProcessors = GetPostProcessor(postProcessorNames);
_intermediateFolder = intermediateFolder;
_lastBuildInfo = LoadLastBuildInfo();
}
示例12: DependencyBuildInfo
public DependencyBuildInfo(BuildInfo buildInfo, bool upgradeStableVersions)
{
BuildInfo = buildInfo;
UpgradeStableVersions = upgradeStableVersions;
Packages = buildInfo.LatestPackages
.Select(pair => new PackageIdentity(pair.Key, new NuGetVersion(pair.Value)))
.ToArray();
}
示例13: Build
/// <summary>
/// Constructor
/// </summary>
/// <param name="buildInfo">Build Info</param>
public Build(BuildInfo buildInfo)
{
this.buildInfo = buildInfo;
sProjectDir = sProjectsDir + @"\project-" + buildInfo.project_id;
commands = new LinkedList<string>();
outputList = new ConcurrentQueue<string>();
completed = false;
}
示例14: RefreshData
public override void RefreshData(BuildInfo buildReport)
{
const string README_FILENAME = "README.txt";
_readmeContents = BuildReportTool.Util.GetPackageFileContents(README_FILENAME);
const string CHANGELOG_FILENAME = "VERSION.txt";
_changelogContents = BuildReportTool.Util.GetPackageFileContents(CHANGELOG_FILENAME);
}
示例15: BuildMethodCall
protected override IBuildContext BuildMethodCall(ExpressionBuilder builder, MethodCallExpression methodCall, BuildInfo buildInfo)
{
var sequence = builder.BuildSequence(new BuildInfo(buildInfo, methodCall.Arguments[0]));
var condition = (LambdaExpression)methodCall.Arguments[1].Unwrap();
var result = builder.BuildWhere(buildInfo.Parent, sequence, condition, true);
result.SetAlias(condition.Parameters[0].Name);
return result;
}