• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# BuildEngine.BuildPropertyGroup类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



BuildPropertyGroup类属于Microsoft.Build.BuildEngine命名空间,在下文中一共展示了BuildPropertyGroup类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ConstructWithNothing

        public void ConstructWithNothing()
        {
            BuildPropertyGroup group = new BuildPropertyGroup();

            Assertion.AssertEquals(0, group.Count);
            Assertion.AssertEquals(false, group.IsImported);
        }
开发者ID:nikson,项目名称:msbuild,代码行数:7,代码来源:BuildPropertyGroup_Tests.cs


示例2: Toolset

		public Toolset (string toolsVersion, string toolsPath, string toolsFrameworkPath, BuildPropertyGroup buildProperties)
		{
			ToolsVersion = toolsVersion;
			ToolsPath = toolsPath;
			FrameworkToolsPath = toolsFrameworkPath;
			BuildProperties = buildProperties;
		}
开发者ID:GirlD,项目名称:mono,代码行数:7,代码来源:Toolset.cs


示例3: OnSetupReleaseGroup

 protected override void OnSetupReleaseGroup(BuildPropertyGroup group)
 {
     group.AddNewProperty("DefineDebug", "false");
     group.AddNewProperty("DefineTrace", "true");
     group.AddNewProperty("DocumentationFile", Name + ".xml");
     group.AddNewProperty("NoWarn", "42016,41999,42017,42018,42019,42032,42036,42020,42021,42022");
 }
开发者ID:Saleslogix,项目名称:SLXMigration,代码行数:7,代码来源:VBNetProject.cs


示例4: GetCacheScopeIfExists

        private CacheScope GetCacheScopeIfExists(string scopeName, BuildPropertyGroup scopeProperties, string scopeToolsVersion, CacheContentType cacheContentType)
        {
            CacheScope cacheScope = null;

            // Default the version to the default engine version
            if (scopeToolsVersion == null)
            {
                scopeToolsVersion = defaultToolsVersion;
            }

            // Retrieve list of scopes by this name
            if (cacheContents[(int)cacheContentType].ContainsKey(scopeName))
            {
                List<CacheScope> scopesByName = (List<CacheScope>)cacheContents[(int)cacheContentType][scopeName];

                // If the list exists search for matching scope properties otherwise create the list
                if (scopesByName != null)
                {
                    lock (cacheManagerLock)
                    {
                        for (int i = 0; i < scopesByName.Count; i++)
                        {
                            if (scopesByName[i].ScopeProperties.IsEquivalent(scopeProperties) && (String.Compare(scopeToolsVersion, scopesByName[i].ScopeToolsVersion, StringComparison.OrdinalIgnoreCase) == 0))
                            {
                                cacheScope = scopesByName[i];
                                break;
                            }
                        }
                    }
                }
            }

            return cacheScope;
        }
开发者ID:nikson,项目名称:msbuild,代码行数:34,代码来源:CacheManager.cs


示例5: BuildProjectFile

		public bool BuildProjectFile (string projectFileName,
				       string[] targetNames,
				       IDictionary globalProperties,
				       IDictionary targetOutputs, string toolsVersion)
		{
			if (String.IsNullOrEmpty (projectFileName)) {
				string oldProjectToolsVersion = project.ToolsVersion;
				project.ToolsVersion = toolsVersion;
				try {
					return engine.BuildProject (project, targetNames, targetOutputs,
						BuildSettings.DoNotResetPreviouslyBuiltTargets);
				} finally {
					project.ToolsVersion = oldProjectToolsVersion;
				}
			} else {
				BuildPropertyGroup bpg = new BuildPropertyGroup ();
				if (globalProperties != null)
					foreach (DictionaryEntry de in globalProperties)
						bpg.AddProperty (new BuildProperty (
							(string) de.Key, (string) de.Value,
							PropertyType.Global));
				return engine.BuildProjectFile (projectFileName,
					targetNames, bpg, targetOutputs, BuildSettings.DoNotResetPreviouslyBuiltTargets, toolsVersion);
			}
		}
开发者ID:carrie901,项目名称:mono,代码行数:25,代码来源:BuildEngine.cs


示例6: ExpandAllIntoTaskItems3

        public void ExpandAllIntoTaskItems3()
        {
            BuildPropertyGroup pg = new BuildPropertyGroup();

            BuildItemGroup ig = new BuildItemGroup();
            ig.AddItem(new BuildItem("Compile", "foo.cs"));
            ig.AddItem(new BuildItem("Compile", "bar.cs"));

            BuildItemGroup ig2 = new BuildItemGroup();
            ig2.AddItem(new BuildItem("Resource", "bing.resx"));

            Hashtable itemsByType = new Hashtable(StringComparer.OrdinalIgnoreCase);
            itemsByType["Compile"] = ig;
            itemsByType["Resource"] = ig2;

            Expander expander = new Expander(pg, itemsByType);

            List<TaskItem> itemsOut = expander.ExpandAllIntoTaskItems("foo;bar;@(compile);@(resource)", null);

            ObjectModelHelpers.AssertItemsMatch(@"
                foo
                bar
                foo.cs
                bar.cs
                bing.resx
                ", itemsOut.ToArray());
        }
开发者ID:nikson,项目名称:msbuild,代码行数:27,代码来源:Expander_Tests.cs


示例7: Metadata

        public void Metadata()
        {
            string content = @"
            <i Include='i1' xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
               <m>$(p)</m>
               <n>n1</n>
            </i>";
            XmlDocument doc = new XmlDocument();
            doc.LoadXml(content);
            BuildItem item = CreateBuildItemFromXmlDocument(doc);
            Assertion.AssertEquals("i", item.Name);
            BuildPropertyGroup properties = new BuildPropertyGroup();
            properties.SetProperty("p", "p1");

            // Evaluated
            Expander expander = new Expander(properties, null, ExpanderOptions.ExpandAll);
            item.EvaluateAllItemMetadata(expander, ParserOptions.AllowPropertiesAndItemLists, null, null);
            Assertion.AssertEquals("p1", item.GetEvaluatedMetadata("m"));

            // Unevaluated
            Assertion.AssertEquals("$(p)", item.GetMetadata("m"));
            Assertion.AssertEquals("n1", item.GetMetadata("n"));

            // All custom metadata
            ArrayList metadataNames = new ArrayList(item.CustomMetadataNames);
            Assertion.Assert(metadataNames.Contains("n"));
            Assertion.Assert(metadataNames.Contains("m"));

            // Custom metadata count only
            Assertion.AssertEquals(2, item.CustomMetadataCount);
            
            // All metadata count
            Assertion.AssertEquals(2 + FileUtilities.ItemSpecModifiers.All.Length, item.MetadataCount);
        }
开发者ID:nikson,项目名称:msbuild,代码行数:34,代码来源:BuildItem_Tests.cs


示例8: SetUp

 public void SetUp()
 {
     // Whole bunch of setup code.
     XmlElement taskNode = new XmlDocument().CreateElement("MockTask");
     LoadedType taskClass = new LoadedType(typeof(MockTask), new AssemblyLoadInfo(typeof(MockTask).Assembly.FullName, null));
     Engine engine = new Engine(@"c:\");
     loggingHelper = new EngineLoggingServicesHelper();
     engine.LoggingServices = loggingHelper;
     Project project = new Project(engine);
     taskExecutionModule = new MockTaskExecutionModule(new EngineCallback(engine));
     // Set up some "fake data" which will be passed to the Task Execution State object
     Hashtable[] fakeArray = new Hashtable[1];
     fakeArray[0] = new Hashtable();
     projectLevelProprtiesForInference = new BuildPropertyGroup();
     projectLevelPropertiesForExecution = new BuildPropertyGroup();
     inferenceBucketItemsByName = fakeArray;
     inferenceBucketMetaData = fakeArray;
     projectLevelItemsForInference = new Hashtable();
     executionBucketItemsByName = fakeArray;
     executionBucketMetaData = fakeArray;
     projectLevelItemsForExecution = new Hashtable();
     hostObject = null;
     projectFileOfTaskNode = "In Memory";
     parentProjectFullFileName = project.FullFileName;
     nodeProxyId = engine.EngineCallback.CreateTaskContext(project, null, null, taskNode, EngineCallback.inProcNode, new BuildEventContext(BuildEventContext.InvalidNodeId, BuildEventContext.InvalidTargetId, BuildEventContext.InvalidProjectContextId, BuildEventContext.InvalidTaskId));
     executionDirectory = Directory.GetCurrentDirectory();
     projectId = project.Id;
 }
开发者ID:nikson,项目名称:msbuild,代码行数:28,代码来源:TaskExecutionState_Test.cs


示例9: GetProperties

		BuildProperty [] GetProperties (BuildPropertyGroup bpg)
		{
			List<BuildProperty> list = new List<BuildProperty> ();
			foreach (BuildProperty bp in bpg)
				list.Add (bp);
			return list.ToArray ();
		}
开发者ID:nlhepler,项目名称:mono,代码行数:7,代码来源:BuildPropertyGroupTest.cs


示例10: ManualResetEvent

        /// <summary>
        /// Initialize the node with the id and the callback object
        /// </summary>
        internal Node
        (
            int nodeId, 
            LoggerDescription[] nodeLoggers, 
            IEngineCallback parentCallback,
            BuildPropertyGroup parentGlobalProperties,
            ToolsetDefinitionLocations toolsetSearchLocations,
            string parentStartupDirectory
        )
        {
            this.nodeId = nodeId;
            this.parentCallback = parentCallback;

            this.exitNodeEvent = new ManualResetEvent(false);
            this.buildRequests = new Queue<BuildRequest>();

            this.requestToLocalIdMapping = new Hashtable();
            this.lastRequestIdUsed = 0;

            this.centralizedLogging = false;
            this.nodeLoggers = nodeLoggers;

            this.localEngine = null;
            this.launchedEngineLoopThread = false;
            this.nodeShutdown = false;
            this.parentGlobalProperties = parentGlobalProperties;
            this.toolsetSearchLocations = toolsetSearchLocations;
            this.parentStartupDirectory = parentStartupDirectory;
        }
开发者ID:nikson,项目名称:msbuild,代码行数:32,代码来源:Node.cs


示例11: CantModifyThroughEnumerator

        public void CantModifyThroughEnumerator()
        {
            BuildPropertyGroup pg = new BuildPropertyGroup();
            // Only NormalProperties are modifiable anyway
            BuildProperty p1 = new BuildProperty("name1", "value1", PropertyType.NormalProperty);
            pg.SetProperty(p1);

            BuildPropertyGroupProxy proxy = new BuildPropertyGroupProxy(pg);

            Hashtable list = new Hashtable(StringComparer.OrdinalIgnoreCase);

            // Get the one property
            foreach (DictionaryEntry prop in proxy)
            {
                list.Add(prop.Key, prop.Value);
            }

            // Change the property
            Assertion.Assert((string)list["name1"] == "value1");
            list["name1"] = "newValue";
            Assertion.Assert((string)list["name1"] == "newValue");

            // Get the property again
            list = new Hashtable(StringComparer.OrdinalIgnoreCase);
            foreach (DictionaryEntry prop in proxy)
            {
                list.Add(prop.Key, prop.Value);
            }

            // Property value hasn't changed
            Assertion.Assert((string)list["name1"] == "value1");
        }
开发者ID:nikson,项目名称:msbuild,代码行数:32,代码来源:BuildPropertyGroupProxy_Tests.cs


示例12: TestAssignment

		public void TestAssignment ()
		{
			bpg = new BuildPropertyGroup ();
			
			Assert.AreEqual (0, bpg.Count);
			Assert.AreEqual (false, bpg.IsImported);
		}
开发者ID:nlhepler,项目名称:mono,代码行数:7,代码来源:BuildPropertyGroupTest.cs


示例13: Build

        public static bool Build(Project pProj, OutputWindowPane pPane, string pTarget, NameValueCollection pParams)
        {
            Microsoft.Build.BuildEngine.Engine buildEngine = new Microsoft.Build.BuildEngine.Engine();
              BuildExecutor executor = new BuildExecutor(pPane);

              RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\.NETFramework", false);
              if (key == null) {
            throw new Exception("Failed to determine .NET Framework install root - no .NETFramework key");
              }
              string installRoot = key.GetValue("InstallRoot") as string;
              if (installRoot == null) {
            throw new Exception("Failed to determine .NET Framework install root - no InstallRoot value");
              }
              key.Close();

              buildEngine.BinPath = Path.Combine(installRoot, string.Format("v{0}.{1}.{2}", Environment.Version.Major, Environment.Version.Minor, Environment.Version.Build));
              buildEngine.RegisterLogger(executor);

              executor.Verbosity = LoggerVerbosity.Normal;

              BuildPropertyGroup properties = new BuildPropertyGroup();
              foreach (string propKey in pParams.Keys) {
            string val = pParams[propKey];

            properties.SetProperty(propKey, val, true);
              }

              return buildEngine.BuildProjectFile(pProj.FileName, new string[]{pTarget}, properties);
        }
开发者ID:paulj,项目名称:webgac,代码行数:29,代码来源:BuildExecutor.cs


示例14: SimpleAddAndRetrieveProject

        public void SimpleAddAndRetrieveProject()
        {
            // Initialize engine.
            Engine engine = new Engine(@"c:\");

            // Instantiate new project manager.
            ProjectManager projectManager = new ProjectManager();

            // Set up variables that represent the information we would be getting from 
            // the "MSBuild" task.
            string fullPath = @"c:\rajeev\temp\myapp.proj";
            BuildPropertyGroup globalProperties = new BuildPropertyGroup();
            globalProperties.SetProperty("Configuration", "Debug");

            // Create a new project that matches the information that we're pretending
            // to receive from the MSBuild task.
            Project project1 = new Project(engine);
            project1.FullFileName = fullPath;
            project1.GlobalProperties = globalProperties;

            // Add the new project to the ProjectManager.
            projectManager.AddProject(project1);

            // Try and retrieve the project from the ProjectManager based on the fullpath + globalprops,
            // and make sure we get back the same project we added.
            Assertion.AssertEquals(project1, projectManager.GetProject(fullPath, globalProperties, null));
        }
开发者ID:nikson,项目名称:msbuild,代码行数:27,代码来源:ProjectManager_Tests.cs


示例15: OnSetupDebugGroup

 protected override void OnSetupDebugGroup(BuildPropertyGroup group)
 {
     group.AddNewProperty("Optimize", "false");
     group.AddNewProperty("DefineConstants", "DEBUG;TRACE");
     group.AddNewProperty("ErrorReport", "prompt");
     group.AddNewProperty("WarningLevel", "4");
 }
开发者ID:Saleslogix,项目名称:SLXMigration,代码行数:7,代码来源:CSharpProject.cs


示例16: Expander

 /// <summary>
 /// Special cased constructor. Where we are only going to expand properties and metadata,
 /// it's a waste of memory to use a lookup. Just use the property group.
 /// PERF: This improves the EvaluateAllItemDefinitions codepath.
 /// </summary>
 internal Expander(BuildPropertyGroup properties, string implicitMetadataItemType, Dictionary<string, string> unqualifiedItemMetadata)
 {
     this.options = ExpanderOptions.ExpandPropertiesAndMetadata;
     this.properties = properties;
     this.itemMetadata = unqualifiedItemMetadata;
     this.implicitMetadataItemType = implicitMetadataItemType;
 }
开发者ID:nikson,项目名称:msbuild,代码行数:12,代码来源:Expander.cs


示例17: BuildWhen

		public BuildWhen (XmlElement whenElement, Project parentProject)
		{
			this.parentProject = parentProject;
			this.groupingCollection = new GroupingCollection (parentProject);
			if (whenElement == null)
				throw new ArgumentNullException ("whenElement");
			this.whenElement = whenElement;
			foreach (XmlElement xe in whenElement.ChildNodes) {
				switch (xe.Name) {
					case "ItemGroup":
						BuildItemGroup big = new BuildItemGroup (xe, parentProject, null, true);
						//big.BindToXml (xe);
						groupingCollection.Add (big);
						break;
					case "PropertyGroup":
						BuildPropertyGroup bpg = new BuildPropertyGroup (xe, parentProject, null, true);
						//bpg.BindToXml (xe);
						groupingCollection.Add (bpg);
						break;
					case "Choose":
						BuildChoose bc = new BuildChoose (xe, parentProject);
						groupingCollection.Add (bc);
						break;
					default:
						throw new InvalidProjectFileException ( string.Format ("Invalid element '{0}' in When.", xe.Name));
				}
			}
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:28,代码来源:BuildWhen.cs


示例18: GetProperties

		BuildProperty [] GetProperties (BuildPropertyGroup bpg)
		{
			BuildProperty [] arr = new BuildProperty [bpg.Count];
			int i = 0;
			foreach (BuildProperty bp in bpg)
				arr [i++] = bp;
			return arr;
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:8,代码来源:BuildPropertyTest.cs


示例19: ConstructWithSimpleProject

        public void ConstructWithSimpleProject()
        {
            Project p = Build.UnitTests.ObjectModelHelpers.CreateInMemoryProject(basicProjectContentsWithOnePropertyGroup);
            BuildPropertyGroup group = new BuildPropertyGroup(p);

            Assertion.AssertEquals(0, group.Count);
            Assertion.AssertEquals(false, group.IsImported);
        }
开发者ID:nikson,项目名称:msbuild,代码行数:8,代码来源:BuildPropertyGroup_Tests.cs


示例20: GetPropValue

		static string GetPropValue (BuildPropertyGroup bpg, string name)
		{
			foreach (BuildProperty bp in bpg) {
				if (bp.Name == name) {
					return bp.FinalValue;
				}
			}
			return String.Empty;
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:9,代码来源:EngineTest.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# BuildEngine.Engine类代码示例发布时间:2022-05-26
下一篇:
C# BuildEngine.BuildItemGroup类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap