Skip to content
Snippets Groups Projects
Commit eeb21d1f authored by Jan Tattermusch's avatar Jan Tattermusch Committed by GitHub
Browse files

Merge pull request #8039 from jtattermusch/dotnetcli_distribtest_prototype

Dotnet CLI distrib tests and associated cleanup.
parents 1b5f0579 e4e30f88
No related branches found
No related tags found
No related merge requests found
Showing
with 100 additions and 105 deletions
......@@ -42,11 +42,6 @@
}
}
},
"runtimes": {
"win7-x64": { },
"debian.8-x64": { },
"osx.10.11-x64": { }
},
"dependencies": {
"Grpc.Core": {
......@@ -66,8 +61,10 @@
"portable-net45"
],
"dependencies": {
"Microsoft.NETCore.App": "1.0.0",
"NETStandard.Library": "1.6.0"
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0"
}
}
}
},
......
......@@ -100,19 +100,19 @@ namespace Grpc.Core.Internal
// With old-style VS projects, the native libraries get copied using a .targets rule to the build output folder
// alongside the compiled assembly.
// With dotnet cli projects, the native libraries (just the required ones) are similarly copied to the built output folder,
// through the magic of Microsoft.NETCore.Platforms.
// With dotnet cli projects targeting net45 framework, the native libraries (just the required ones)
// are similarly copied to the built output folder, through the magic of Microsoft.NETCore.Platforms.
var classicPath = Path.Combine(assemblyDirectory, GetNativeLibraryFilename());
// DNX-style project.json projects will use Grpc.Core assembly directly in the location where it got restored
// With dotnet cli project targeting netcoreapp1.0, projects will use Grpc.Core assembly directly in the location where it got restored
// by nuget. We locate the native libraries based on known structure of Grpc.Core nuget package.
// When "dotnet publish" is used, the runtimes directory is copied next to the published assemblies.
string runtimesDirectory = string.Format("runtimes/{0}/native", GetPlatformString());
var netCorePublishedAppStylePath = Path.Combine(assemblyDirectory, runtimesDirectory, GetNativeLibraryFilename());
var netCoreAppStylePath = Path.Combine(assemblyDirectory, "../..", runtimesDirectory, GetNativeLibraryFilename());
// TODO: Support .NET Core applications, which act slightly differently. We may be okay if "dotnet publish"
// is used, but "dotnet run" leaves the native libraries in-package, while copying assemblies.
string platform = GetPlatformString();
string relativeDirectory = string.Format("../../runtimes/{0}/native", platform);
var dnxStylePath = Path.Combine(assemblyDirectory, relativeDirectory, GetNativeLibraryFilename());
string[] paths = new[] { classicPath, dnxStylePath };
// Look for all native library in all possible locations in given order.
string[] paths = new[] { classicPath, netCorePublishedAppStylePath, netCoreAppStylePath};
return new UnmanagedLibrary(paths);
}
......
......@@ -42,11 +42,6 @@
}
}
},
"runtimes": {
"win7-x64": { },
"debian.8-x64": { },
"osx.10.11-x64": { }
},
"dependencies": {
"Grpc.Examples": {
......@@ -57,8 +52,10 @@
"net45": { },
"netcoreapp1.0": {
"dependencies": {
"Microsoft.NETCore.App": "1.0.0",
"NETStandard.Library": "1.6.0"
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0"
}
}
}
}
......
......@@ -42,11 +42,6 @@
}
}
},
"runtimes": {
"win7-x64": { },
"debian.8-x64": { },
"osx.10.11-x64": { }
},
"dependencies": {
"Grpc.Examples": {
......@@ -57,8 +52,10 @@
"net45": { },
"netcoreapp1.0": {
"dependencies": {
"Microsoft.NETCore.App": "1.0.0",
"NETStandard.Library": "1.6.0"
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0"
}
}
}
}
......
......@@ -42,11 +42,6 @@
}
}
},
"runtimes": {
"win7-x64": { },
"debian.8-x64": { },
"osx.10.11-x64": { }
},
"dependencies": {
"Grpc.Examples": {
......@@ -62,8 +57,10 @@
"portable-net45"
],
"dependencies": {
"Microsoft.NETCore.App": "1.0.0",
"NETStandard.Library": "1.6.0"
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0"
}
}
}
}
......
{
"buildOptions": {
},
"runtimes": {
"win7-x64": { },
"debian.8-x64": { },
"osx.10.11-x64": { }
},
"dependencies": {
"Grpc.Core": {
......@@ -22,8 +17,10 @@
},
"netcoreapp1.0": {
"dependencies": {
"Microsoft.NETCore.App": "1.0.0",
"NETStandard.Library": "1.6.0"
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0"
}
}
}
}
......
......@@ -42,11 +42,6 @@
}
}
},
"runtimes": {
"win7-x64": { },
"debian.8-x64": { },
"osx.10.11-x64": { }
},
"dependencies": {
"Grpc.HealthCheck": {
......@@ -62,8 +57,10 @@
"portable-net45"
],
"dependencies": {
"Microsoft.NETCore.App": "1.0.0",
"NETStandard.Library": "1.6.0"
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0"
}
}
}
}
......
......@@ -44,11 +44,6 @@
}
}
},
"runtimes": {
"win7-x64": { },
"debian.8-x64": { },
"osx.10.11-x64": { }
},
"dependencies": {
"Grpc.IntegrationTesting": {
......@@ -62,8 +57,10 @@
"portable-net45"
],
"dependencies": {
"Microsoft.NETCore.App": "1.0.0",
"NETStandard.Library": "1.6.0"
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0"
}
}
}
}
......
......@@ -44,11 +44,6 @@
}
}
},
"runtimes": {
"win7-x64": { },
"debian.8-x64": { },
"osx.10.11-x64": { }
},
"dependencies": {
"Grpc.IntegrationTesting": {
......@@ -62,8 +57,10 @@
"portable-net45"
],
"dependencies": {
"Microsoft.NETCore.App": "1.0.0",
"NETStandard.Library": "1.6.0"
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0"
}
}
}
}
......
......@@ -44,11 +44,6 @@
}
}
},
"runtimes": {
"win7-x64": { },
"debian.8-x64": { },
"osx.10.11-x64": { }
},
"dependencies": {
"Grpc.IntegrationTesting": {
......@@ -62,8 +57,10 @@
"portable-net45"
],
"dependencies": {
"Microsoft.NETCore.App": "1.0.0",
"NETStandard.Library": "1.6.0"
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0"
}
}
}
}
......
......@@ -44,11 +44,6 @@
}
}
},
"runtimes": {
"win7-x64": { },
"debian.8-x64": { },
"osx.10.11-x64": { }
},
"dependencies": {
"Grpc.IntegrationTesting": {
......@@ -62,8 +57,10 @@
"portable-net45"
],
"dependencies": {
"Microsoft.NETCore.App": "1.0.0",
"NETStandard.Library": "1.6.0"
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0"
}
}
}
}
......
......@@ -44,11 +44,6 @@
}
}
},
"runtimes": {
"win7-x64": { },
"debian.8-x64": { },
"osx.10.11-x64": { }
},
"dependencies": {
"Grpc.Auth": {
......@@ -75,8 +70,10 @@
"portable-net45"
],
"dependencies": {
"Microsoft.NETCore.App": "1.0.0",
"NETStandard.Library": "1.6.0",
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0"
},
"System.Linq.Expressions": "4.1.0"
}
}
......
......@@ -30,11 +30,9 @@
set -ex
cd $(dirname $0)/../..
cd $(dirname $0)
mkdir -p artifacts/
cd src/csharp
mkdir -p ../../artifacts/
# IMPORTANT: NuGet packages generated by dotnet CLI are considered experimental.
# The official nugets are generated by src/csharp/build_packages.bat
......@@ -43,6 +41,11 @@ mkdir -p nativelibs/windows_x86 nativelibs/windows_x64 \
nativelibs/linux_x86 nativelibs/linux_x64 \
nativelibs/macosx_x86 nativelibs/macosx_x64
mkdir -p protoc_plugins/windows_x86 protoc_plugins/windows_x64 \
protoc_plugins/linux_x86 protoc_plugins/linux_x64 \
protoc_plugins/macosx_x86 protoc_plugins/macosx_x64
# Collect the artifacts built by the previous build step if running on Jenkins
cp $EXTERNAL_GIT_ROOT/architecture=x86,language=csharp,platform=windows/artifacts/* nativelibs/windows_x86 || true
cp $EXTERNAL_GIT_ROOT/architecture=x64,language=csharp,platform=windows/artifacts/* nativelibs/windows_x64 || true
cp $EXTERNAL_GIT_ROOT/architecture=x86,language=csharp,platform=linux/artifacts/* nativelibs/linux_x86 || true
......@@ -50,10 +53,21 @@ cp $EXTERNAL_GIT_ROOT/architecture=x64,language=csharp,platform=linux/artifacts/
cp $EXTERNAL_GIT_ROOT/architecture=x86,language=csharp,platform=macos/artifacts/* nativelibs/macosx_x86 || true
cp $EXTERNAL_GIT_ROOT/architecture=x64,language=csharp,platform=macos/artifacts/* nativelibs/macosx_x64 || true
# Collect protoc artifacts built by the previous build step
cp $EXTERNAL_GIT_ROOT/architecture=x86,language=protoc,platform=windows/artifacts/* protoc_plugins/windows_x86 || true
cp $EXTERNAL_GIT_ROOT/architecture=x64,language=protoc,platform=windows/artifacts/* protoc_plugins/windows_x64 || true
cp $EXTERNAL_GIT_ROOT/architecture=x86,language=protoc,platform=linux/artifacts/* protoc_plugins/linux_x86 || true
cp $EXTERNAL_GIT_ROOT/architecture=x64,language=protoc,platform=linux/artifacts/* protoc_plugins/linux_x64 || true
cp $EXTERNAL_GIT_ROOT/architecture=x86,language=protoc,platform=macos/artifacts/* protoc_plugins/macosx_x86 || true
cp $EXTERNAL_GIT_ROOT/architecture=x64,language=protoc,platform=macos/artifacts/* protoc_plugins/macosx_x64 || true
dotnet restore .
dotnet pack --configuration Release Grpc.Core/project.json --output ../../artifacts
dotnet pack --configuration Release Grpc.Auth/project.json --output ../../artifacts
dotnet pack --configuration Release Grpc.HealthCheck/project.json --output ../../artifacts
tar -czf ../../artifacts/csharp_nugets_experimental.tar.gz ../../artifacts/*.nupkg
nuget pack Grpc.nuspec -Version "1.1.0-dev" -OutputDirectory ../../artifacts
nuget pack Grpc.Tools.nuspec -Version "1.1.0-dev" -OutputDirectory ../../artifacts
(cd ../../artifacts && zip csharp_nugets_dotnetcli.zip *.nupkg)
......@@ -20,8 +20,10 @@
"portable-net45"
],
"dependencies": {
"Microsoft.NETCore.App": "1.0.0",
"NETStandard.Library": "1.6.0"
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0"
}
}
}
},
......
......@@ -11,8 +11,10 @@
"net45": { },
"netcoreapp1.0": {
"dependencies": {
"Microsoft.NETCore.App": "1.0.0",
"NETStandard.Library": "1.6.0"
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0"
}
}
}
}
......
......@@ -11,8 +11,10 @@
"net45": { },
"netcoreapp1.0": {
"dependencies": {
"Microsoft.NETCore.App": "1.0.0",
"NETStandard.Library": "1.6.0"
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0"
}
}
}
}
......
......@@ -16,8 +16,10 @@
"portable-net45"
],
"dependencies": {
"Microsoft.NETCore.App": "1.0.0",
"NETStandard.Library": "1.6.0"
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0"
}
}
}
}
......
......@@ -17,8 +17,10 @@
},
"netcoreapp1.0": {
"dependencies": {
"Microsoft.NETCore.App": "1.0.0",
"NETStandard.Library": "1.6.0"
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0"
}
}
}
}
......
......@@ -16,8 +16,10 @@
"portable-net45"
],
"dependencies": {
"Microsoft.NETCore.App": "1.0.0",
"NETStandard.Library": "1.6.0"
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0"
}
}
}
}
......
......@@ -14,8 +14,10 @@
"portable-net45"
],
"dependencies": {
"Microsoft.NETCore.App": "1.0.0",
"NETStandard.Library": "1.6.0"
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0"
}
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment