本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例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.");
}