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


C# Project.ResetBuildStatus方法代码示例

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


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

示例1: ResetBuildVirtualPropertyReset

 public void ResetBuildVirtualPropertyReset()
 {
     Project p = new Project(new Engine());
     p.LoadXml(TestData.ContentCreatePropertyTarget);
     p.SetProperty("p", "v1");
     p.Build("CreatePropertyTarget");
     Assertion.AssertEquals("v", p.GetEvaluatedProperty("p"));
     p.ResetBuildStatus();
     Assertion.AssertEquals("v1", p.GetEvaluatedProperty("p"));
 }
开发者ID:nikson,项目名称:msbuild,代码行数:10,代码来源:Project_Tests.cs

示例2: StartRootProjectBuild

        /// <summary>
        /// Engine.BuildProject gets called recursively when projects use the
        /// MSBuild *task* to build other child projects.  If "numberOfProjectsInProgress"
        /// is 0, then we know we are currently NOT in a recursive call.  We
        /// are really being called at the top level.
        /// </summary>
        private void StartRootProjectBuild(BuildRequest buildRequest, Project project)
        {
            foreach (Project loadedProject in projectsLoadedByHost.Values)
            {
                // There should be no projects in the ProjectManager with the same full path, global properties and tools version
                // as any of the loaded projects.  If there are, something went badly awry, because
                // we were supposed to have deleted them after the last build.
                ErrorUtilities.VerifyThrow(null == this.cacheOfBuildingProjects.GetProject(loadedProject.FullFileName, loadedProject.GlobalProperties, loadedProject.ToolsVersion),
                    "Project shouldn't be in ProjectManager already.");

                // Add the loaded project to the list of projects being built, just
                // so that during the build, we have only one place we need to look
                // instead of having to search multiple lists.
                this.cacheOfBuildingProjects.AddProject(loadedProject);
            }

            if (0 == (buildRequest.BuildSettings & BuildSettings.DoNotResetPreviouslyBuiltTargets))
            {
                // Reset the build state for all projects that are still cached from the 
                // last build and the currently loaded projects that we just added to
                // the ProjectManager.
                this.cacheOfBuildingProjects.ResetBuildStatusForAllProjects();

                // Clear the project build results cache
                this.cacheManager.ClearCache();

                // Reset the build state for the project that we're going to build.  This may not
                // be in the ProjectManager if it doesn't have a FullFileName property.
                project.ResetBuildStatus();
            }
        }
开发者ID:nikson,项目名称:msbuild,代码行数:37,代码来源:Engine.cs

示例3: ResetBuildVirtualItemReset

 public void ResetBuildVirtualItemReset()
 {
     Project p = new Project(new Engine());
     p.LoadXml(TestData.ContentCreateItemTarget);
     p.AddNewItem("BuildItem", "i1");
     p.Build("CreateItemTarget");
     Assertion.AssertEquals("i1", p.EvaluatedItems[0].Include);
     Assertion.AssertEquals("i", p.EvaluatedItems[1].Include);
     int preCount = p.EvaluatedItems.Count;
     p.ResetBuildStatus();
     Assertion.AssertEquals("i1", p.EvaluatedItems[0].Include);
     Assertion.AssertEquals(preCount - 1, p.EvaluatedItems.Count);
 }
开发者ID:nikson,项目名称:msbuild,代码行数:13,代码来源:Project_Tests.cs


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