Merge pull request #907 from sharwell/net35

Add ReferenceAssemblies.NetFramework.Net35
This commit is contained in:
Sam Harwell 2021-09-28 14:14:50 -07:00 коммит произвёл GitHub
Родитель aba633cc45 459295cbc9
Коммит 5c5865fba1
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 51 добавлений и 1 удалений

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

@ -176,6 +176,7 @@ Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.Net
Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.NetCore Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.NetCore
Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.NetFramework Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.NetFramework
Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.NetFramework.Net20 Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.NetFramework.Net20
Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.NetFramework.Net35
Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.NetFramework.Net40 Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.NetFramework.Net40
Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.NetFramework.Net45 Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.NetFramework.Net45
Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.NetFramework.Net451 Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.NetFramework.Net451
@ -267,6 +268,9 @@ static Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.NetCore.NetCoreApp30.g
static Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.NetCore.NetCoreApp31.get -> Microsoft.CodeAnalysis.Testing.ReferenceAssemblies static Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.NetCore.NetCoreApp31.get -> Microsoft.CodeAnalysis.Testing.ReferenceAssemblies
static Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.NetFramework.Net20.Default.get -> Microsoft.CodeAnalysis.Testing.ReferenceAssemblies static Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.NetFramework.Net20.Default.get -> Microsoft.CodeAnalysis.Testing.ReferenceAssemblies
static Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.NetFramework.Net20.WindowsForms.get -> Microsoft.CodeAnalysis.Testing.ReferenceAssemblies static Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.NetFramework.Net20.WindowsForms.get -> Microsoft.CodeAnalysis.Testing.ReferenceAssemblies
static Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.NetFramework.Net35.Default.get -> Microsoft.CodeAnalysis.Testing.ReferenceAssemblies
static Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.NetFramework.Net35.WindowsForms.get -> Microsoft.CodeAnalysis.Testing.ReferenceAssemblies
static Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.NetFramework.Net35.Wpf.get -> Microsoft.CodeAnalysis.Testing.ReferenceAssemblies
static Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.NetFramework.Net40.Default.get -> Microsoft.CodeAnalysis.Testing.ReferenceAssemblies static Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.NetFramework.Net40.Default.get -> Microsoft.CodeAnalysis.Testing.ReferenceAssemblies
static Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.NetFramework.Net40.WindowsForms.get -> Microsoft.CodeAnalysis.Testing.ReferenceAssemblies static Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.NetFramework.Net40.WindowsForms.get -> Microsoft.CodeAnalysis.Testing.ReferenceAssemblies
static Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.NetFramework.Net40.Wpf.get -> Microsoft.CodeAnalysis.Testing.ReferenceAssemblies static Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.NetFramework.Net40.Wpf.get -> Microsoft.CodeAnalysis.Testing.ReferenceAssemblies

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

@ -27,7 +27,7 @@ namespace Microsoft.CodeAnalysis.Testing
{ {
public sealed partial class ReferenceAssemblies public sealed partial class ReferenceAssemblies
{ {
private const string ReferenceAssembliesPackageVersion = "1.0.0"; private const string ReferenceAssembliesPackageVersion = "1.0.2";
private static readonly FileSystemSemaphore Semaphore = new FileSystemSemaphore(Path.Combine(Path.GetTempPath(), "test-packages", ".lock")); private static readonly FileSystemSemaphore Semaphore = new FileSystemSemaphore(Path.Combine(Path.GetTempPath(), "test-packages", ".lock"));
@ -579,6 +579,26 @@ namespace Microsoft.CodeAnalysis.Testing
= Default.AddAssemblies(ImmutableArray.Create("System.Drawing", "System.Windows.Forms")); = Default.AddAssemblies(ImmutableArray.Create("System.Drawing", "System.Windows.Forms"));
} }
public static class Net35
{
public static ReferenceAssemblies Default { get; }
= new ReferenceAssemblies(
"net35",
new PackageIdentity(
"Microsoft.NETFramework.ReferenceAssemblies.net35",
ReferenceAssembliesPackageVersion),
Path.Combine("build", ".NETFramework", "v3.5"))
.WithAssemblyIdentityComparer(DesktopAssemblyIdentityComparer.Default)
.AddAssemblies(ImmutableArray.Create("mscorlib", "System", "System.Core", "System.Data", "System.Data.DataSetExtensions", "System.Xml", "System.Xml.Linq"))
.AddLanguageSpecificAssemblies(LanguageNames.VisualBasic, ImmutableArray.Create("Microsoft.VisualBasic"));
public static ReferenceAssemblies WindowsForms { get; }
= Default.AddAssemblies(ImmutableArray.Create("System.Deployment", "System.Drawing", "System.Windows.Forms"));
public static ReferenceAssemblies Wpf { get; }
= Default.AddAssemblies(ImmutableArray.Create("PresentationCore", "PresentationFramework", "WindowsBase"));
}
public static class Net40 public static class Net40
{ {
public static ReferenceAssemblies Default { get; } public static ReferenceAssemblies Default { get; }

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

@ -29,6 +29,30 @@ namespace Microsoft.CodeAnalysis.Testing
Assert.NotEmpty(resolved); Assert.NotEmpty(resolved);
} }
[Fact]
public async Task ResolveReferenceAssemblies_Net35()
{
var referenceAssemblies = ReferenceAssemblies.NetFramework.Net35.Default;
var resolved = await referenceAssemblies.ResolveAsync(LanguageNames.CSharp, CancellationToken.None);
Assert.NotEmpty(resolved);
}
[Fact]
public async Task ResolveReferenceAssemblies_Net35_WindowsForms()
{
var referenceAssemblies = ReferenceAssemblies.NetFramework.Net35.WindowsForms;
var resolved = await referenceAssemblies.ResolveAsync(LanguageNames.CSharp, CancellationToken.None);
Assert.NotEmpty(resolved);
}
[Fact]
public async Task ResolveReferenceAssemblies_Net35_Wpf()
{
var referenceAssemblies = ReferenceAssemblies.NetFramework.Net35.Wpf;
var resolved = await referenceAssemblies.ResolveAsync(LanguageNames.CSharp, CancellationToken.None);
Assert.NotEmpty(resolved);
}
[Fact] [Fact]
public async Task ResolveReferenceAssemblies_Net40() public async Task ResolveReferenceAssemblies_Net40()
{ {
@ -550,6 +574,7 @@ namespace Microsoft.CodeAnalysis.Testing
} }
[Theory] [Theory]
[InlineData("net35")]
[InlineData("net40")] [InlineData("net40")]
[InlineData("net45")] [InlineData("net45")]
[InlineData("net451")] [InlineData("net451")]
@ -608,6 +633,7 @@ class TestClass {
return targetFramework switch return targetFramework switch
{ {
"net20" => ReferenceAssemblies.NetFramework.Net20.Default, "net20" => ReferenceAssemblies.NetFramework.Net20.Default,
"net35" => ReferenceAssemblies.NetFramework.Net35.Default,
"net40" => ReferenceAssemblies.NetFramework.Net40.Default, "net40" => ReferenceAssemblies.NetFramework.Net40.Default,
"net45" => ReferenceAssemblies.NetFramework.Net45.Default, "net45" => ReferenceAssemblies.NetFramework.Net45.Default,
"net451" => ReferenceAssemblies.NetFramework.Net451.Default, "net451" => ReferenceAssemblies.NetFramework.Net451.Default,