Merge pull request #18351 from jtattermusch/introduce_netstandard20

C#: also target netstandard2.0
pull/18399/head
Jan Tattermusch 6 years ago committed by GitHub
commit 92749d094e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/csharp/Grpc.Auth/Grpc.Auth.csproj
  2. 2
      src/csharp/Grpc.Core.Api/Grpc.Core.Api.csproj
  3. 2
      src/csharp/Grpc.Core.NativeDebug/Grpc.Core.NativeDebug.csproj
  4. 2
      src/csharp/Grpc.Core.Testing/Grpc.Core.Testing.csproj
  5. 2
      src/csharp/Grpc.Core/Grpc.Core.csproj
  6. 2
      src/csharp/Grpc.Core/GrpcEnvironment.cs
  7. 4
      src/csharp/Grpc.Core/Internal/NativeExtension.cs
  8. 4
      src/csharp/Grpc.Core/Internal/PlatformApis.cs
  9. 2
      src/csharp/Grpc.Core/Internal/UnmanagedLibrary.cs
  10. 2
      src/csharp/Grpc.Core/Utils/TaskUtils.cs
  11. 2
      src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.csproj
  12. 2
      src/csharp/Grpc.Reflection/Grpc.Reflection.csproj
  13. 2
      src/csharp/Grpc/Grpc.csproj

@ -15,7 +15,7 @@
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>net45;netstandard1.5</TargetFrameworks>
<TargetFrameworks>net45;netstandard1.5;netstandard2.0</TargetFrameworks>
<DefineConstants>$(DefineConstants);SIGNED</DefineConstants>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>

@ -15,7 +15,7 @@
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>net45;netstandard1.5</TargetFrameworks>
<TargetFrameworks>net45;netstandard1.5;netstandard2.0</TargetFrameworks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

@ -15,7 +15,7 @@
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>net45;netstandard1.5</TargetFrameworks>
<TargetFrameworks>net45;netstandard1.5;netstandard2.0</TargetFrameworks>
<!-- This package only carries native debug symbols -->
<IncludeBuildOutput>false</IncludeBuildOutput>
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>

@ -15,7 +15,7 @@
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>net45;netstandard1.5</TargetFrameworks>
<TargetFrameworks>net45;netstandard1.5;netstandard2.0</TargetFrameworks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

@ -15,7 +15,7 @@
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>net45;netstandard1.5</TargetFrameworks>
<TargetFrameworks>net45;netstandard1.5;netstandard2.0</TargetFrameworks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

@ -448,7 +448,7 @@ namespace Grpc.Core
// the gRPC channels and servers before the application exits. The following
// hooks provide some extra handling for cases when this is not the case,
// in the effort to achieve a reasonable behavior on shutdown.
#if NETSTANDARD1_5
#if NETSTANDARD1_5 || NETSTANDARD2_0
// No action required at shutdown on .NET Core
// - In-progress P/Invoke calls (such as grpc_completion_queue_next) don't seem
// to prevent a .NET core application from terminating, so no special handling

@ -153,7 +153,7 @@ namespace Grpc.Core.Internal
private static string GetAssemblyPath()
{
var assembly = typeof(NativeExtension).GetTypeInfo().Assembly;
#if NETSTANDARD1_5
#if NETSTANDARD1_5 || NETSTANDARD2_0
// Assembly.EscapedCodeBase does not exist under CoreCLR, but assemblies imported from a nuget package
// don't seem to be shadowed by DNX-based projects at all.
return assembly.Location;
@ -172,7 +172,7 @@ namespace Grpc.Core.Internal
#endif
}
#if !NETSTANDARD1_5
#if !NETSTANDARD1_5 && !NETSTANDARD2_0
private static bool IsFileUri(string uri)
{
return uri.ToLowerInvariant().StartsWith(Uri.UriSchemeFile);

@ -49,7 +49,7 @@ namespace Grpc.Core.Internal
static PlatformApis()
{
#if NETSTANDARD1_5
#if NETSTANDARD1_5 || NETSTANDARD2_0
isLinux = RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
isMacOSX = RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
isWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
@ -171,7 +171,7 @@ namespace Grpc.Core.Internal
public static string GetUnityRuntimePlatform()
{
GrpcPreconditions.CheckState(IsUnity, "Not running on Unity.");
#if NETSTANDARD1_5
#if NETSTANDARD1_5 || NETSTANDARD2_0
return Type.GetType(UnityEngineApplicationClassName).GetTypeInfo().GetProperty("platform").GetValue(null).ToString();
#else
return Type.GetType(UnityEngineApplicationClassName).GetProperty("platform").GetValue(null).ToString();

@ -120,7 +120,7 @@ namespace Grpc.Core.Internal
{
throw new MissingMethodException(string.Format("The native method \"{0}\" does not exist", methodName));
}
#if NETSTANDARD1_5
#if NETSTANDARD1_5 || NETSTANDARD2_0
return Marshal.GetDelegateForFunctionPointer<T>(ptr); // non-generic version is obsolete
#else
return Marshal.GetDelegateForFunctionPointer(ptr, typeof(T)) as T; // generic version not available in .NET45

@ -33,7 +33,7 @@ namespace Grpc.Core.Utils
{
get
{
#if NETSTANDARD1_5
#if NETSTANDARD1_5 || NETSTANDARD2_0
return Task.CompletedTask;
#else
return Task.FromResult<object>(null); // for .NET45, emulate the functionality

@ -15,7 +15,7 @@
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>net45;netstandard1.5</TargetFrameworks>
<TargetFrameworks>net45;netstandard1.5;netstandard2.0</TargetFrameworks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

@ -15,7 +15,7 @@
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>net45;netstandard1.5</TargetFrameworks>
<TargetFrameworks>net45;netstandard1.5;netstandard2.0</TargetFrameworks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

@ -15,7 +15,7 @@
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>net45;netstandard1.5</TargetFrameworks>
<TargetFrameworks>net45;netstandard1.5;netstandard2.0</TargetFrameworks>
<!-- This is only a metapackage -->
<IncludeBuildOutput>false</IncludeBuildOutput>
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>

Loading…
Cancel
Save