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


C# AssemblyInfo.Execute方法代码示例

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


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

示例1: AssemblyInfoExecute

        public void AssemblyInfoExecute()
        {
            AssemblyInfo task = new AssemblyInfo();
            task.BuildEngine = new MockBuild();
            task.CodeLanguage = "cs";
            string outputFile = Path.Combine(testDirectory, "AssemblyInfo.cs");
            task.OutputFile = outputFile;
            task.AssemblyTitle = "AssemblyInfoTask";
            task.AssemblyDescription = "AssemblyInfo Description";
            task.AssemblyConfiguration = "";
            task.AssemblyCompany = "Company Name, LLC";
            task.AssemblyProduct = "AssemblyInfoTask";
            task.AssemblyCopyright = "Copyright (c) Company Name, LLC 2005";
            task.AssemblyTrademark = "";
            task.ComVisible = false;
            task.CLSCompliant = true;
            task.Guid = "d038566a-1937-478a-b5c5-b79c4afb253d";
            task.AssemblyVersion = "1.2.3.4";
            task.AssemblyFileVersion = "1.2.3.4";
            task.AssemblyInformationalVersion = "1.2.3.4";
            task.AssemblyKeyFile = @"..\MSBuild.Community.Tasks\MSBuild.Community.Tasks.snk";
            Assert.IsTrue(task.Execute(), "Execute Failed");

            Assert.IsTrue(File.Exists(outputFile), "File missing: " + outputFile);
        }
开发者ID:464884492,项目名称:msbuildtasks,代码行数:25,代码来源:AssemblyInfoTest.cs

示例2: AssemblyInfoVB

        public void AssemblyInfoVB() {
            AssemblyInfo task = new AssemblyInfo();
            task.BuildEngine = new MockBuild();
            task.CodeLanguage = "vb";
            string outputFile = Path.Combine(testDirectory, "VersionInfo.vb");
            task.OutputFile = outputFile;
            task.AssemblyVersion = "1.2.3.4";
            task.AssemblyFileVersion = "1.2.3.4";
            task.AssemblyInformationalVersion = "1.2.3.4";
            Assert.IsTrue(task.Execute(), "Execute Failed");

            Assert.IsTrue(File.Exists(outputFile), "File missing: " + outputFile);

        }
开发者ID:KGuetter,项目名称:msbuildtasks,代码行数:14,代码来源:AssemblyInfoTest.cs

示例3: AssemblyInfoCPP

        public void AssemblyInfoCPP()
        {
            AssemblyInfo task = new AssemblyInfo();
            task.BuildEngine = new MockBuild();
            task.CodeLanguage = "cpp";
            string outputFile = Path.Combine(testDirectory, "VersionInfo.cpp");
            task.OutputFile = outputFile;
            task.AssemblyVersion = "1.2.3.4";
            task.AssemblyFileVersion = "1.2.3.4";
            task.AssemblyInformationalVersion = "1.2.3.4";
            task.SkipVerification = true;
            task.UnmanagedCode = true;
            task.GenerateClass = true;

            Assert.IsTrue(task.Execute(), "Execute Failed");

            Assert.IsTrue(File.Exists(outputFile), "File missing: " + outputFile);
        }
开发者ID:464884492,项目名称:msbuildtasks,代码行数:18,代码来源:AssemblyInfoTest.cs

示例4: Can_update_attribute_when_single_quotes_appear_in_attribute_constructor

        public void Can_update_attribute_when_single_quotes_appear_in_attribute_constructor()
        {
            string tempFile = System.IO.Path.Combine(Environment.CurrentDirectory, "Data", "AssemblyInfo_mixed_spacing.Temp.cs");
            try
            {
                System.IO.File.Copy(System.IO.Path.Combine(Environment.CurrentDirectory, "Data", "AssemblyInfo_mixed_spacing.cs"), tempFile, overwrite: true);
                var assemblyInfoTask = new AssemblyInfo
                {
                    BuildEngine = new MockBuildEngine(),
                    AssemblyDescription = "Foo Bar Description.",
                    AssemblyInfoFiles = new ITaskItem[] { new TaskItem(tempFile), }
                };

                Assert.IsTrue(assemblyInfoTask.Execute());
            }
            finally
            {
                System.IO.File.Delete(tempFile);                
            }
        }
开发者ID:simondmorias,项目名称:MSBuildExtensionPack,代码行数:20,代码来源:AssemblyInfoTests.cs

示例5: Can_update_attribute

        public void Can_update_attribute()
        {
            string tempFile = System.IO.Path.Combine(Environment.CurrentDirectory, "Data", "AssemblyInfo_normal_spacing.Temp.cs");
            try
            {
                System.IO.File.Copy(System.IO.Path.Combine(Environment.CurrentDirectory, "Data", "AssemblyInfo_normal_spacing.cs"), tempFile, overwrite: true);
                var assemblyInfoTask = new AssemblyInfo
                {
                    BuildEngine = new MockBuildEngine(),
                    AssemblyCompany = "Foo Bar Ltd.",
                    AssemblyInfoFiles = new ITaskItem[] { new TaskItem(tempFile), }
                };

                Assert.IsTrue(assemblyInfoTask.Execute());
            }
            finally
            {
                System.IO.File.Delete(tempFile);                
            }
        }
开发者ID:simondmorias,项目名称:MSBuildExtensionPack,代码行数:20,代码来源:AssemblyInfoTests.cs

示例6: AssemblyInfoFileShouldHaveUtf8ByteOrderMark

        public void AssemblyInfoFileShouldHaveUtf8ByteOrderMark()
        {
            AssemblyInfo task = new AssemblyInfo();
            task.BuildEngine = new MockBuild();
            task.CodeLanguage = "cs";
            string outputFile = Path.Combine(testDirectory, "AssemblyInfoBOM.cs");
            task.OutputFile = outputFile;
            task.AssemblyTitle = "AssemblyInfoTask";
            task.AssemblyCopyright = "Copyright � Ignaz Kohlbecker 2006";
            Assert.IsTrue(task.Execute(), "Execute Failed");

            byte[] firstBytesOfFile = new byte[3];
            File.OpenRead(outputFile).Read(firstBytesOfFile, 0, 3);

            byte[] utf8Bom = UTF8Encoding.UTF8.GetPreamble();

            Assert.AreEqual(utf8Bom, firstBytesOfFile, "The expected UTF8 BOM marker was not found on the generated file.");
        }
开发者ID:464884492,项目名称:msbuildtasks,代码行数:18,代码来源:AssemblyInfoTest.cs


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