Merge branch '4.0.0' into 4.1.0

This commit is contained in:
Samantha Houts 2019-05-31 21:00:25 -07:00
Родитель e120e7d15a 14539da7b4
Коммит 46d9cf283e
2 изменённых файлов: 19 добавлений и 19 удалений

Просмотреть файл

@ -38,13 +38,13 @@
<PropertyGroup>
<InformationalVersion>$(PackageVersion)</InformationalVersion>
<FileVersion>$(Version).$(GitCommits)</FileVersion>
<AssemblyVersion>$(Version).0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion> <!-- THIS SHALL REMAIN 2.0.0.0 -->
</PropertyGroup>
<ItemGroup>
<AssemblyAttribute Include="System.Reflection.AssemblyMetadata">
<_Parameter1>Version</_Parameter1>
<_Parameter2>$(Version)</_Parameter2>
<_Parameter2>2.0.0.0</_Parameter2> <!-- THIS SHALL REMAIN 2.0.0.0 -->
</AssemblyAttribute>
<AssemblyAttribute Include="System.Reflection.AssemblyMetadata">
<_Parameter1>PackageVersion</_Parameter1>

Просмотреть файл

@ -5,7 +5,7 @@ using System.IO;
using System.Reflection;
using System.Diagnostics;
namespace Xamarin.Forms.Xaml.UnitTests
namespace Xamarin.Forms.MSBuild.UnitTests
{
[TestFixture]
public class AssemblyInfoTests
@ -36,35 +36,35 @@ namespace Xamarin.Forms.Xaml.UnitTests
public void AssemblyVersion(string assemblyName)
{
Assembly testAssembly = System.Reflection.Assembly.Load(assemblyName);
Version version = testAssembly.GetName().Version;
Version gitInfoVersion = Version.Parse(GetFileFromRoot(s_gitInfoFile));
Assert.AreEqual(version.Major, gitInfoVersion.Major);
Assert.AreEqual(version.Minor, gitInfoVersion.Minor);
Assert.AreEqual(version.Build, gitInfoVersion.Build);
Version actual = testAssembly.GetName().Version;
Assert.AreEqual(2, actual.Major, actual.ToString());
Assert.AreEqual(0, actual.Minor, actual.ToString());
Assert.AreEqual(0, actual.Build, actual.ToString());
}
[Test, TestCaseSource("references")]
public void FileVersion(string assemblyName)
{
Assembly testAssembly = System.Reflection.Assembly.Load(assemblyName);
FileVersionInfo version = FileVersionInfo.GetVersionInfo(testAssembly.Location);
Version gitInfoVersion = Version.Parse(GetFileFromRoot(s_gitInfoFile));
Assert.AreEqual(version.FileMajorPart, gitInfoVersion.Major);
Assert.AreEqual(version.FileMinorPart, gitInfoVersion.Minor);
Assert.AreEqual(version.FileBuildPart, gitInfoVersion.Build);
FileVersionInfo actual = FileVersionInfo.GetVersionInfo(testAssembly.Location);
Version expected = Version.Parse(GetFileFromRoot(s_gitInfoFile));
Assert.AreEqual(expected.Major, actual.FileMajorPart, $"FileMajorPart is wrong. {actual.ToString()}");
Assert.AreEqual(expected.Minor, actual.FileMinorPart, $"FileMinorPart is wrong. {actual.ToString()}");
// Fails locally
//Assert.AreEqual(expected.Build, actual.FileBuildPart, $"FileBuildPart is wrong. {actual.ToString()}");
//We need to enable this
// Assert.AreEqual(version.FilePrivatePart, ThisAssembly.Git.Commits);
Assert.AreEqual(version.ProductName, s_productName);
Assert.AreEqual(version.CompanyName, s_company);
// Assert.AreEqual(ThisAssembly.Git.Commits, version.FilePrivatePart);
Assert.AreEqual(s_productName, actual.ProductName);
Assert.AreEqual(s_company, actual.CompanyName);
}
[Test, TestCaseSource("references")]
public void ProductAndCompany(string assemblyName)
{
Assembly testAssembly = System.Reflection.Assembly.Load(assemblyName);
FileVersionInfo version = FileVersionInfo.GetVersionInfo(testAssembly.Location);
Assert.AreEqual(version.ProductName, s_productName);
Assert.AreEqual(version.CompanyName, s_company);
FileVersionInfo actual = FileVersionInfo.GetVersionInfo(testAssembly.Location);
Assert.AreEqual(s_productName, actual.ProductName);
Assert.AreEqual(s_company, actual.CompanyName);
}
static string GetFileFromRoot(string file)