当前位置: 首页>>代码示例>>C#>>正文


C# BuildResult.HasResultsForTarget方法代码示例

本文整理汇总了C#中Microsoft.Build.Execution.BuildResult.HasResultsForTarget方法的典型用法代码示例。如果您正苦于以下问题:C# BuildResult.HasResultsForTarget方法的具体用法?C# BuildResult.HasResultsForTarget怎么用?C# BuildResult.HasResultsForTarget使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Microsoft.Build.Execution.BuildResult的用法示例。


在下文中一共展示了BuildResult.HasResultsForTarget方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TestHasResultsForTarget

        public void TestHasResultsForTarget()
        {
            BuildRequest request = CreateNewBuildRequest(1, new string[0]);
            BuildResult result = new BuildResult(request);
            result.AddResultsForTarget("foo", TestUtilities.GetEmptySucceedingTargetResult());

            Assert.IsTrue(result.HasResultsForTarget("foo"));
            Assert.IsFalse(result.HasResultsForTarget("bar"));
        }
开发者ID:JamesLinus,项目名称:msbuild,代码行数:9,代码来源:BuildResult_Tests.cs

示例2: AreResultsIdenticalForTarget

        static private bool AreResultsIdenticalForTarget(BuildResult a, BuildResult b, string target)
        {
            if (!a.HasResultsForTarget(target) || !b.HasResultsForTarget(target))
            {
                return false;
            }

            if (a[target].ResultCode != b[target].ResultCode)
            {
                return false;
            }

            if (!AreItemsIdentical(a[target].Items, b[target].Items))
            {
                return false;
            }

            return true;
        }
开发者ID:cameron314,项目名称:msbuild,代码行数:19,代码来源:ResultsCache_Tests.cs

示例3: CheckResults

        /// <summary>
        /// Looks for results for the specified targets.
        /// </summary>
        /// <param name="result">The result to examine</param>
        /// <param name="targets">The targets to search for</param>
        /// <param name="targetClass">The class of targets</param>
        /// <param name="targetsMissingResults">An optional list to be populated with missing targets</param>
        /// <param name="skippedResultsAreOK">If true, a status of "skipped" counts as having valid results 
        /// for that target.  Otherwise, a skipped target is treated as equivalent to a missing target.</param>
        /// <returns>False if there were missing results, true otherwise.</returns>
        private bool CheckResults(BuildResult result, List<string> targets, TargetClass targetClass, HashSet<string> targetsMissingResults, bool skippedResultsAreOK)
        {
            bool returnValue = true;
            foreach (string target in targets)
            {
                if (!result.HasResultsForTarget(target) || (result[target].ResultCode == TargetResultCode.Skipped && !skippedResultsAreOK))
                {
                    if (null != targetsMissingResults)
                    {
                        targetsMissingResults.Add(target);
                        returnValue = false;
                    }
                    else
                    {
                        return false;
                    }
                }
                else
                {
                    // If the result was a failure and we have not seen any skipped targets up to this point, then we conclude we do 
                    // have results for this request, and they indicate failure.
                    if (result[target].ResultCode == TargetResultCode.Failure && (targetsMissingResults == null || targetsMissingResults.Count == 0))
                    {
                        return true;
                    }
                }
            }

            return returnValue;
        }
开发者ID:cameron314,项目名称:msbuild,代码行数:40,代码来源:ResultsCache.cs


注:本文中的Microsoft.Build.Execution.BuildResult.HasResultsForTarget方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。