Remove net451 as a cross-compile target

This commit is contained in:
Pranav K 2017-03-23 09:59:11 -07:00
Родитель 7e9b92072e
Коммит 474b32f615
18 изменённых файлов: 35 добавлений и 20 удалений

1
.gitignore поставляемый
Просмотреть файл

@ -32,3 +32,4 @@ project.lock.json
.vscode/ .vscode/
*.nuget.props *.nuget.props
*.nuget.targets *.nuget.targets
global.json

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

@ -3,7 +3,7 @@
<Import Project="..\..\build\dependencies.props" /> <Import Project="..\..\build\dependencies.props" />
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>net451;netcoreapp2.0</TargetFrameworks> <TargetFrameworks>net46;netcoreapp2.0</TargetFrameworks>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

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

@ -3,7 +3,7 @@
<Import Project="..\..\build\dependencies.props" /> <Import Project="..\..\build\dependencies.props" />
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>net451;netcoreapp2.0</TargetFrameworks> <TargetFrameworks>net46;netcoreapp2.0</TargetFrameworks>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

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

@ -3,7 +3,7 @@
<Import Project="..\..\build\dependencies.props" /> <Import Project="..\..\build\dependencies.props" />
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>net451;netcoreapp2.0</TargetFrameworks> <TargetFrameworks>net46;netcoreapp2.0</TargetFrameworks>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

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

@ -3,7 +3,7 @@
<Import Project="..\..\build\dependencies.props" /> <Import Project="..\..\build\dependencies.props" />
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>net451;netcoreapp2.0</TargetFrameworks> <TargetFrameworks>net46;netcoreapp2.0</TargetFrameworks>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

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

@ -160,7 +160,7 @@ namespace Microsoft.AspNetCore.Buffering
return _innerStream.WriteAsync(buffer, offset, count, cancellationToken); return _innerStream.WriteAsync(buffer, offset, count, cancellationToken);
} }
} }
#if !NETSTANDARD1_3 #if NET46
public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state) public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
{ {
if (_isBuffering) if (_isBuffering)
@ -184,6 +184,9 @@ namespace Microsoft.AspNetCore.Buffering
_innerStream.EndWrite(asyncResult); _innerStream.EndWrite(asyncResult);
} }
} }
#elif NETSTANDARD1_3
#else
#error target frameworks need to be updated
#endif #endif
public override void Flush() public override void Flush()
{ {

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

@ -5,7 +5,7 @@
<PropertyGroup> <PropertyGroup>
<VersionPrefix>0.3.0</VersionPrefix> <VersionPrefix>0.3.0</VersionPrefix>
<Description>ASP.NET Core middleware for buffering response bodies.</Description> <Description>ASP.NET Core middleware for buffering response bodies.</Description>
<TargetFrameworks>net451;netstandard1.3</TargetFrameworks> <TargetFrameworks>net46;netstandard1.3</TargetFrameworks>
<NoWarn>$(NoWarn);CS1591</NoWarn> <NoWarn>$(NoWarn);CS1591</NoWarn>
<GenerateDocumentationFile>true</GenerateDocumentationFile> <GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageTags>aspnetcore;buffer;buffering</PackageTags> <PackageTags>aspnetcore;buffer;buffering</PackageTags>

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

@ -7,7 +7,7 @@
<Description>ASP.NET Core basic middleware for supporting HTTP method overrides. Includes: <Description>ASP.NET Core basic middleware for supporting HTTP method overrides. Includes:
* X-Forwarded-* headers to forward headers from a proxy. * X-Forwarded-* headers to forward headers from a proxy.
* HTTP method override header.</Description> * HTTP method override header.</Description>
<TargetFrameworks>net451;netstandard1.3</TargetFrameworks> <TargetFramework>netstandard1.3</TargetFramework>
<NoWarn>$(NoWarn);CS1591</NoWarn> <NoWarn>$(NoWarn);CS1591</NoWarn>
<GenerateDocumentationFile>true</GenerateDocumentationFile> <GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageTags>aspnetcore;proxy;headers;xforwarded</PackageTags> <PackageTags>aspnetcore;proxy;headers;xforwarded</PackageTags>

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

@ -137,7 +137,7 @@ namespace Microsoft.AspNetCore.ResponseCompression
} }
} }
#if NET451 #if NET46
public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, Object state) public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, Object state)
{ {
var tcs = new TaskCompletionSource<object>(state); var tcs = new TaskCompletionSource<object>(state);
@ -184,6 +184,9 @@ namespace Microsoft.AspNetCore.ResponseCompression
var task = (Task)asyncResult; var task = (Task)asyncResult;
task.GetAwaiter().GetResult(); task.GetAwaiter().GetResult();
} }
#elif NETSTANDARD1_3
#else
#error target frameworks need to be updated
#endif #endif
public override async Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) public override async Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)

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

@ -37,12 +37,12 @@ namespace Microsoft.AspNetCore.ResponseCompression
{ {
get get
{ {
#if NET451 #if NET46
return false; return false;
#elif NETSTANDARD1_3 #elif NETSTANDARD1_3
return true; return true;
#else #else
// Not implemented, compiler break #error target frameworks need to be updated
#endif #endif
} }
} }

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

@ -5,7 +5,7 @@
<PropertyGroup> <PropertyGroup>
<VersionPrefix>1.1.0</VersionPrefix> <VersionPrefix>1.1.0</VersionPrefix>
<Description>ASP.NET Core middleware for HTTP Response compression.</Description> <Description>ASP.NET Core middleware for HTTP Response compression.</Description>
<TargetFrameworks>net451;netstandard1.3</TargetFrameworks> <TargetFrameworks>net46;netstandard1.3</TargetFrameworks>
<GenerateDocumentationFile>true</GenerateDocumentationFile> <GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageTags>aspnetcore</PackageTags> <PackageTags>aspnetcore</PackageTags>
</PropertyGroup> </PropertyGroup>

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

@ -8,7 +8,7 @@
* Support for custom URL rewrite rules * Support for custom URL rewrite rules
* Support for running IIS URL Rewrite module rules * Support for running IIS URL Rewrite module rules
* Support for running Apache mod_rewrite rules.</Description> * Support for running Apache mod_rewrite rules.</Description>
<TargetFrameworks>net451;netstandard1.3</TargetFrameworks> <TargetFramework>netstandard1.3</TargetFramework>
<NoWarn>$(NoWarn);CS1591</NoWarn> <NoWarn>$(NoWarn);CS1591</NoWarn>
<GenerateDocumentationFile>true</GenerateDocumentationFile> <GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageTags>aspnetcore;urlrewrite;mod_rewrite</PackageTags> <PackageTags>aspnetcore;urlrewrite;mod_rewrite</PackageTags>

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

@ -3,8 +3,10 @@
<Import Project="..\..\build\common.props" /> <Import Project="..\..\build\common.props" />
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>netcoreapp2.0;net452</TargetFrameworks> <TargetFrameworks>netcoreapp2.0;net46</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks> <TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

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

@ -3,8 +3,10 @@
<Import Project="..\..\build\common.props" /> <Import Project="..\..\build\common.props" />
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>netcoreapp2.0;net452</TargetFrameworks> <TargetFrameworks>netcoreapp2.0;net46</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks> <TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

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

@ -108,7 +108,7 @@ namespace Microsoft.AspNetCore.ResponseCompression.Tests
Assert.Equal(File.ReadAllBytes(path), written); Assert.Equal(File.ReadAllBytes(path), written);
} }
#if NET452 #if NET46
[Theory] [Theory]
[InlineData(true)] [InlineData(true)]
[InlineData(false)] [InlineData(false)]

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

@ -3,8 +3,10 @@
<Import Project="..\..\build\common.props" /> <Import Project="..\..\build\common.props" />
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>netcoreapp2.0;net452</TargetFrameworks> <TargetFrameworks>netcoreapp2.0;net46</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks> <TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

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

@ -505,7 +505,7 @@ namespace Microsoft.AspNetCore.ResponseCompression.Tests
var response = await client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead); var response = await client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead);
#if NET452 // Flush not supported, compression disabled #if NET46 // Flush not supported, compression disabled
Assert.NotNull(response.Headers.GetValues(HeaderNames.ContentMD5)); Assert.NotNull(response.Headers.GetValues(HeaderNames.ContentMD5));
Assert.Empty(response.Content.Headers.ContentEncoding); Assert.Empty(response.Content.Headers.ContentEncoding);
#elif NETCOREAPP2_0 // Flush supported, compression enabled #elif NETCOREAPP2_0 // Flush supported, compression enabled
@ -513,7 +513,7 @@ namespace Microsoft.AspNetCore.ResponseCompression.Tests
Assert.False(response.Headers.TryGetValues(HeaderNames.ContentMD5, out contentMD5)); Assert.False(response.Headers.TryGetValues(HeaderNames.ContentMD5, out contentMD5));
Assert.Single(response.Content.Headers.ContentEncoding, "gzip"); Assert.Single(response.Content.Headers.ContentEncoding, "gzip");
#else #else
#error Target framework needs to be updated #error target frameworks need to be updated.
#endif #endif
var body = await response.Content.ReadAsStreamAsync(); var body = await response.Content.ReadAsStreamAsync();
@ -570,7 +570,7 @@ namespace Microsoft.AspNetCore.ResponseCompression.Tests
var response = await client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead); var response = await client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead);
#if NET452 // Flush not supported, compression disabled #if NET46 // Flush not supported, compression disabled
Assert.NotNull(response.Headers.GetValues(HeaderNames.ContentMD5)); Assert.NotNull(response.Headers.GetValues(HeaderNames.ContentMD5));
Assert.Empty(response.Content.Headers.ContentEncoding); Assert.Empty(response.Content.Headers.ContentEncoding);
#elif NETCOREAPP2_0 // Flush supported, compression enabled #elif NETCOREAPP2_0 // Flush supported, compression enabled

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

@ -3,8 +3,10 @@
<Import Project="..\..\build\common.props" /> <Import Project="..\..\build\common.props" />
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>netcoreapp2.0;net452</TargetFrameworks> <TargetFrameworks>netcoreapp2.0;net46</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks> <TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>