[C#] Grpc.Tools - Remove TODOs for splitting package (#33581)

It has been decided that we will no longer try and split Grpc.Tools
NuGet package logic into two packages by adding logic to
Google.Protobuf.Tools. See
https://github.com/protocolbuffers/protobuf/issues/5957

This PR removes some of the TODOs and redundant files.

There is further simplification work that could be done to combine the
props and targets files that were already split. But this is the first
step in the tidying up the code.
pull/33735/head
tony 2 years ago committed by GitHub
parent 083bbee480
commit 82cdea3b88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 22
      src/csharp/Grpc.Tools/Grpc.Tools.csproj
  2. 7
      src/csharp/Grpc.Tools/build/Grpc.Tools.props
  3. 7
      src/csharp/Grpc.Tools/build/Grpc.Tools.targets
  4. 3
      src/csharp/Grpc.Tools/build/_grpc/README
  5. 2
      src/csharp/Grpc.Tools/build/_grpc/_Grpc.Tools.targets
  6. 5
      src/csharp/Grpc.Tools/build/_protobuf/Google.Protobuf.Tools.props
  7. 1
      src/csharp/Grpc.Tools/build/_protobuf/Google.Protobuf.Tools.targets
  8. 1
      src/csharp/Grpc.Tools/build/_protobuf/README
  9. 17
      src/csharp/Grpc.Tools/build/native/Grpc.Tools.props

@ -9,17 +9,14 @@
<Import Project="SourceLink.csproj.include" />
<PropertyGroup Label="Asset root folders. TODO(kkm): Change with package separation.">
<!-- TODO(kkm): Rework whole section when splitting packages. -->
<!-- GRPC: ../../third_party/protobuf/src/google/protobuf/ -->
<!-- GPB: ../src/google/protobuf/ -->
<PropertyGroup Label="Asset root folders.">
<!-- Root of well known types .proto files -->
<Assets_ProtoInclude>../../../third_party/protobuf/src/google/protobuf/</Assets_ProtoInclude>
<!-- GPB: ../protoc/ -->
<!-- GRPC: ../protoc_plugins/protoc_ -->
<!-- Protocol buffers compiler binaries -->
<Assets_ProtoCompiler>../protoc_plugins/protoc_</Assets_ProtoCompiler>
<!-- GRPC: ../protoc_plugins/ -->
<!-- Plugins binaries -->
<Assets_GrpcPlugins>../protoc_plugins/</Assets_GrpcPlugins>
</PropertyGroup>
@ -28,7 +25,6 @@
</PropertyGroup>
<PropertyGroup Label="NuGet package definition" Condition=" '$(Configuration)' == 'Release' ">
<!-- TODO(kkm): Change to "build\" after splitting. -->
<BuildOutputTargetFolder>build\_protobuf\</BuildOutputTargetFolder>
<DevelopmentDependency>true</DevelopmentDependency>
<NoPackageAnalysis>true</NoPackageAnalysis>
@ -51,22 +47,20 @@
<ItemGroup Label="NuGet package assets">
<None Pack="true" PackagePath="build\" Include="build\**\*.xml; build\**\*.props; build\**\*.targets;" />
<!-- Protobuf assets (for Google.Protobuf.Tools) -->
<!-- Protobuf assets - well known types -->
<_ProtoAssetName Include="any;api;descriptor;duration;empty;field_mask;
source_context;struct;timestamp;type;wrappers" />
<_Asset PackagePath="build/native/include/google/protobuf/" Include="@(_ProtoAssetName->'$(Assets_ProtoInclude)%(Identity).proto')" />
<!-- TODO(kkm): GPB builds assets into "macosx", GRPC into "macos". -->
<!-- TODO(kkm): Do not place non-tools under tools/, use build/native/bin/. -->
<!-- TODO(kkm): Do not package windows x64 builds (#13098). -->
<!-- protocol buffers compiler -->
<_Asset PackagePath="tools/windows_x86/" Include="$(Assets_ProtoCompiler)windows_x86/protoc.exe" />
<_Asset PackagePath="tools/windows_x64/" Include="$(Assets_ProtoCompiler)windows_x64/protoc.exe" />
<_Asset PackagePath="tools/linux_x86/" Include="$(Assets_ProtoCompiler)linux_x86/protoc" />
<_Asset PackagePath="tools/linux_x64/" Include="$(Assets_ProtoCompiler)linux_x64/protoc" />
<_Asset PackagePath="tools/linux_arm64/" Include="$(Assets_ProtoCompiler)linux_aarch64/protoc" />
<_Asset PackagePath="tools/macosx_x64/" Include="$(Assets_ProtoCompiler)macos_x64/protoc" /> <!-- GPB: macosx-->
<_Asset PackagePath="tools/macosx_x64/" Include="$(Assets_ProtoCompiler)macos_x64/protoc" />
<!-- gRPC assets (for Grpc.Tools) -->
<!-- gRPC protocol buffer compiler plugins -->
<_Asset PackagePath="tools/windows_x86/" Include="$(Assets_GrpcPlugins)protoc_windows_x86/grpc_csharp_plugin.exe" />
<_Asset PackagePath="tools/windows_x64/" Include="$(Assets_GrpcPlugins)protoc_windows_x64/grpc_csharp_plugin.exe" />
<_Asset PackagePath="tools/linux_x86/" Include="$(Assets_GrpcPlugins)protoc_linux_x86/grpc_csharp_plugin" />

@ -4,8 +4,11 @@
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
<!-- Name of this file must match package ID. -->
<!-- Packages will be split later. -->
<!-- Name of this file (Grpc.Tools.props) must match package ID (Grpc.Tools). -->
<!-- TODO(tonydnewell) The files below were originally separate to allow
Grpc.Tools and Google.Protobuf.Tools split, but since we abandoned that plan,
the logic could now be simplified by combining these files together -->
<Import Project="_grpc/_Grpc.Tools.props"/>
<Import Project="_protobuf/Google.Protobuf.Tools.props"/>
</Project>

@ -4,8 +4,11 @@
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
<!-- Name of this file must match package ID. -->
<!-- Packages will be split later. -->
<!-- Name of this file (Grpc.Tools.targets) must match package ID (Grpc.Tools). -->
<!-- TODO(tonydnewell) The files below were originally separate to allow
Grpc.Tools and Google.Protobuf.Tools split, but since we abandoned that plan,
the logic could now be simplified by combining these files together -->
<Import Project="_grpc/_Grpc.Tools.targets"/>
<Import Project="_protobuf/Google.Protobuf.Tools.targets"/>
</Project>

@ -1,3 +0,0 @@
TODO(kkm): These file will go into Grpc.Tools/build after package split.
Remove leading underscores from file names; they are hiding the
files from some NuGet versions which pull them into project.

@ -21,8 +21,6 @@
<!-- This target is invoked in a C# project, or can be called in a customized project. -->
<Target Name="gRPC_ResolvePluginFullPath" AfterTargets="Protobuf_ResolvePlatform">
<PropertyGroup>
<!-- TODO(kkm): Do not use Protobuf_PackagedToolsPath, roll gRPC's own. -->
<!-- First try environment variable. -->
<gRPC_PluginFullPath Condition=" '$(gRPC_PluginFullPath)' == '' ">$(GRPC_PROTOC_PLUGIN)</gRPC_PluginFullPath>

@ -6,9 +6,10 @@
<!-- Revision number of this package conventions (as if "API" version). -->
<Protobuf_ToolingRevision>1</Protobuf_ToolingRevision>
<!-- TODO(kkm): Remove one "../" when separating packages. -->
<!-- TODO(kkm): Do not place non-tools under tools/, use build/native/bin/. -->
<!-- Tools - protocol buffers compiler and plugins -->
<Protobuf_PackagedToolsPath>$( [System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)../../tools) )</Protobuf_PackagedToolsPath>
<!-- Protocol buffers Well Known Types -->
<Protobuf_StandardImportsPath>$( [System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)../native/include) )</Protobuf_StandardImportsPath>
</PropertyGroup>

@ -110,7 +110,6 @@
<!-- Do proto compilation by default in a C# project. In other types, the user invoke
Protobuf_Compile directly where required. -->
<!-- TODO(kkm): Do shared compile in outer multitarget project? -->
<Target Name="_Protobuf_Compile_BeforeCsCompile"
BeforeTargets="BeforeCompile"
DependsOnTargets="Protobuf_Compile"

@ -1 +0,0 @@
TODO(kkm): These file will go into Google.Protobuf.Tools/build after package split.

@ -1,17 +0,0 @@
<?xml version="1.0"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
<!-- Revision number of this package conventions (as if "API" version). -->
<Protobuf_ToolingRevision>1</Protobuf_ToolingRevision>
<!-- For a Visual Studio C++ native project we currently only resolve tools and import paths. -->
<!-- TODO(kkm): Do not place non-tools under tools/, use build/native/bin/. -->
<!-- TODO(kkm): Do not package windows x64 builds (#13098). -->
<Protobuf_ProtocFullPath>$(MSBuildThisFileDirectory)..\..\tools\windows_x86\protoc.exe</Protobuf_ProtocFullPath>
<Protobuf_StandardImportsPath>$(MSBuildThisFileDirectory)include\</Protobuf_StandardImportsPath>
<gRPC_PluginFileName>grpc_cpp_plugin</gRPC_PluginFileName>
<gRPC_PluginFullPath>$(MSBuildThisFileDirectory)..\..\tools\windows_x86\grpc_cpp_plugin.exe</gRPC_PluginFullPath>
</PropertyGroup>
</Project>
Loading…
Cancel
Save