Skip to content

Commit

Permalink
Update to use Directory.Packages.props (#2315)
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesNK authored Nov 18, 2023
1 parent 4a60f41 commit ca9b756
Show file tree
Hide file tree
Showing 97 changed files with 369 additions and 326 deletions.
2 changes: 0 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<Project>
<Import Project="build\sources.props" />
<Import Project="build\dependencies.props" />
<Import Project="build\version.props" />

<PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
<ItemGroup Condition="'$(IsGrpcPublishedPackage)' == 'true'">
<None Include="$(PackageIconFullPath)" Pack="true" PackagePath="\"/>

<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="$(MicrosoftCodeAnalysisNetAnalyzersPackageVersion)" PrivateAssets="All" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="$(MicrosoftSourceLinkGitHubPackageVersion)" PrivateAssets="All" />
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" PrivateAssets="All" />
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" />
</ItemGroup>

<!--
Expand Down
84 changes: 84 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<MicrosoftAspNetCoreAppPackageVersion>8.0.0</MicrosoftAspNetCoreAppPackageVersion>
<MicrosoftAspNetCoreApp7PackageVersion>7.0.5</MicrosoftAspNetCoreApp7PackageVersion>
<MicrosoftAspNetCoreApp6PackageVersion>6.0.11</MicrosoftAspNetCoreApp6PackageVersion>
<GrpcDotNetPackageVersion>2.58.0</GrpcDotNetPackageVersion>
<OpenTelemetryPackageVersion>1.6.0</OpenTelemetryPackageVersion>
<OpenTelemetryIntergationPackageVersion>1.6.0-beta.2</OpenTelemetryIntergationPackageVersion>
<MicrosoftExtensionsPackageVersion>8.0.0</MicrosoftExtensionsPackageVersion>
<MicrosoftExtensions6PackageVersion>6.0.0</MicrosoftExtensions6PackageVersion>
</PropertyGroup>
<ItemGroup>
<!-- ASP.NET Core -->
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly" Version="$(MicrosoftAspNetCoreAppPackageVersion)" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="$(MicrosoftAspNetCoreAppPackageVersion)" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="$(MicrosoftAspNetCoreAppPackageVersion)" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.Certificate" Version="$(MicrosoftAspNetCoreAppPackageVersion)" />
<PackageVersion Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="$(MicrosoftAspNetCoreAppPackageVersion)" />
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="$(MicrosoftAspNetCoreAppPackageVersion)" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="$(MicrosoftAspNetCoreAppPackageVersion)" />
<PackageVersion Include="Microsoft.AspNetCore.Grpc.JsonTranscoding" Version="$(MicrosoftAspNetCoreAppPackageVersion)" />
<PackageVersion Include="Microsoft.AspNetCore.Grpc.Swagger" Version="0.8.0" />

<!-- Extensions -->
<PackageVersion Include="Microsoft.Extensions.Logging" Version="$(MicrosoftExtensionsPackageVersion)" />
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="$(MicrosoftExtensionsPackageVersion)" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="$(MicrosoftExtensionsPackageVersion)" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="$(MicrosoftExtensionsPackageVersion)" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="$(MicrosoftExtensionsPackageVersion)" />

<!-- gRPC -->
<PackageVersion Include="Grpc.Tools" Version="2.59.0" />
<PackageVersion Include="Grpc.Core" Version="2.46.6" />
<PackageVersion Include="Grpc.Core.Api" Version="$(GrpcDotNetPackageVersion)"/>
<PackageVersion Include="Grpc.Net.Client" Version="$(GrpcDotNetPackageVersion)" />
<PackageVersion Include="Grpc.Net.Client.Web" Version="$(GrpcDotNetPackageVersion)" />
<PackageVersion Include="Grpc.Net.ClientFactory" Version="$(GrpcDotNetPackageVersion)" />
<PackageVersion Include="Grpc.AspNetCore" Version="$(GrpcDotNetPackageVersion)" />
<PackageVersion Include="Grpc.AspNetCore.Server" Version="$(GrpcDotNetPackageVersion)" />
<PackageVersion Include="Grpc.AspNetCore.Web" Version="$(GrpcDotNetPackageVersion)" />
<PackageVersion Include="Grpc.Reflection" Version="$(GrpcDotNetPackageVersion)" />
<PackageVersion Include="Grpc.AspNetCore.Server.Reflection" Version="$(GrpcDotNetPackageVersion)" />
<PackageVersion Include="Grpc.HealthCheck" Version="$(GrpcDotNetPackageVersion)" />
<PackageVersion Include="Grpc.AspNetCore.HealthChecks" Version="$(GrpcDotNetPackageVersion)" />
<PackageVersion Include="Grpc.Auth" Version="$(GrpcDotNetPackageVersion)" />

<!-- OpenTelemetry -->
<PackageVersion Include="OpenTelemetry" Version="$(OpenTelemetryPackageVersion)" />
<PackageVersion Include="OpenTelemetry.Exporter.Zipkin" Version="$(OpenTelemetryPackageVersion)" />
<PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="$(OpenTelemetryPackageVersion)" />
<PackageVersion Include="OpenTelemetry.Instrumentation.AspNetCore" Version="$(OpenTelemetryIntergationPackageVersion)" />
<PackageVersion Include="OpenTelemetry.Instrumentation.GrpcNetClient" Version="$(OpenTelemetryIntergationPackageVersion)" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Http" Version="$(OpenTelemetryIntergationPackageVersion)" />

<!-- Other -->
<PackageVersion Include="BenchmarkDotNet" Version="0.13.1" />
<PackageVersion Include="CommandLineParser" Version="2.5.0" />
<PackageVersion Include="Google.Apis.Auth" Version="1.46.0" />
<PackageVersion Include="Google.Protobuf" Version="3.24.0" />
<PackageVersion Include="Microsoft.Build.Locator" Version="1.5.5" />
<PackageVersion Include="Microsoft.Build" Version="16.9.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0-preview.23472.1" />
<PackageVersion Include="Microsoft.Crank.EventSources" Version="0.2.0-alpha.21255.1" />
<PackageVersion Include="Microsoft.Extensions.Logging.Testing" Version="2.1.1" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.6.2" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.1.1" />
<PackageVersion Include="Microsoft.Win32.Registry" Version="4.6.0" />
<PackageVersion Include="Moq" Version="4.16.1" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<PackageVersion Include="Nunit" Version="3.13.3" />
<PackageVersion Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageVersion Include="protobuf-net.Grpc.AspNetCore" Version="1.0.140" />
<PackageVersion Include="protobuf-net.Grpc" Version="1.0.140" />
<PackageVersion Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
<PackageVersion Include="System.CommandLine.Rendering" Version="0.4.0-alpha.22272.1" />
<PackageVersion Include="System.Diagnostics.DiagnosticSource" Version="6.0.1" />
<PackageVersion Include="System.IO.Pipelines" Version="5.0.1" />
<PackageVersion Include="System.Memory" Version="4.5.3" />
<PackageVersion Include="System.Net.Http.WinHttpHandler" Version="7.0.0" />
<PackageVersion Include="System.Security.Principal.Windows" Version="4.7.0" />
<PackageVersion Include="System.Threading.Channels" Version="4.6.0" />
</ItemGroup>
</Project>
38 changes: 0 additions & 38 deletions build/dependencies.props

This file was deleted.

20 changes: 0 additions & 20 deletions build/sources.props

This file was deleted.

6 changes: 3 additions & 3 deletions examples/Aggregator/Client/Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
<Protobuf Include="..\Proto\greet.proto" GrpcServices="None" Link="Protos\greet.proto"/>
<Protobuf Include="..\Proto\count.proto" GrpcServices="None" Link="Protos\count.proto"/>

<PackageReference Include="Google.Protobuf" Version="$(GoogleProtobufPackageVersion)" />
<PackageReference Include="Grpc.Net.Client" Version="$(GrpcDotNetPackageVersion)" />
<PackageReference Include="Grpc.Tools" Version="$(GrpcToolsPackageVersion)" PrivateAssets="All" />
<PackageReference Include="Google.Protobuf" />
<PackageReference Include="Grpc.Net.Client" />
<PackageReference Include="Grpc.Tools" PrivateAssets="All" />
</ItemGroup>

</Project>
25 changes: 17 additions & 8 deletions examples/Aggregator/Server/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,23 @@

if (bool.TryParse(builder.Configuration["EnableOpenTelemetry"], out var enableOpenTelemetry) && enableOpenTelemetry)
{
builder.Services.AddOpenTelemetryTracing(telemetry =>
{
telemetry.SetResourceBuilder(ResourceBuilder.CreateDefault().AddService("aggregator"));
telemetry.AddZipkinExporter();
telemetry.AddGrpcClientInstrumentation();
telemetry.AddHttpClientInstrumentation();
telemetry.AddAspNetCoreInstrumentation();
});
builder.Services.AddOpenTelemetry()
.WithTracing(tracing =>
{
tracing.SetResourceBuilder(ResourceBuilder.CreateDefault().AddService("aggregator"));

if (builder.Environment.IsDevelopment())
{
// We want to view all traces in development
tracing.SetSampler(new AlwaysOnSampler());
}

tracing.AddAspNetCoreInstrumentation()
.AddGrpcClientInstrumentation()
.AddHttpClientInstrumentation();

tracing.AddZipkinExporter();
});
}

// These clients will call back to the server
Expand Down
12 changes: 6 additions & 6 deletions examples/Aggregator/Server/Server.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
<Protobuf Include="..\Proto\greet.proto" GrpcServices="Both" Link="Protos\greet.proto" />
<Protobuf Include="..\Proto\count.proto" GrpcServices="Both" Link="Protos\count.proto" />

<PackageReference Include="Grpc.AspNetCore" Version="$(GrpcDotNetPackageVersion)" />
<PackageReference Include="Grpc.AspNetCore" />

<PackageReference Include="OpenTelemetry.Exporter.Zipkin" Version="$(OpenTelemetryPackageVersion)" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="$(OpenTelemetryIntergationPackageVersion)" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="$(OpenTelemetryIntergationPackageVersion)" />
<PackageReference Include="OpenTelemetry.Instrumentation.GrpcNetClient" Version="$(OpenTelemetryIntergationPackageVersion)" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="$(OpenTelemetryIntergationPackageVersion)" />
<PackageReference Include="OpenTelemetry.Exporter.Zipkin" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" />
<PackageReference Include="OpenTelemetry.Instrumentation.GrpcNetClient" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" />
</ItemGroup>

</Project>
12 changes: 6 additions & 6 deletions examples/Blazor/Client/Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="$(MicrosoftAspNetCoreAppPackageVersion)" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="$(MicrosoftAspNetCoreAppPackageVersion)" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" PrivateAssets="all" />

<PackageReference Include="Google.Protobuf" Version="$(GoogleProtobufPackageVersion)" />
<PackageReference Include="Grpc.Tools" Version="$(GrpcToolsPackageVersion)" PrivateAssets="All" />
<PackageReference Include="Grpc.Net.Client" Version="$(GrpcDotNetPackageVersion)" />
<PackageReference Include="Grpc.Net.Client.Web" Version="$(GrpcDotNetPackageVersion)" />
<PackageReference Include="Google.Protobuf" />
<PackageReference Include="Grpc.Tools" PrivateAssets="All" />
<PackageReference Include="Grpc.Net.Client" />
<PackageReference Include="Grpc.Net.Client.Web" />

<Protobuf Include="..\Proto\weather.proto" GrpcServices="Client" Link="Protos\weather.proto" Access="Internal" />
<Protobuf Include="..\Proto\count.proto" GrpcServices="Client" Link="Protos\count.proto" Access="Internal" />
Expand Down
6 changes: 3 additions & 3 deletions examples/Blazor/Server/Server.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
<Protobuf Include="..\Proto\weather.proto" GrpcServices="Server" Link="Protos\weather.proto" />
<Protobuf Include="..\Proto\count.proto" GrpcServices="Server" Link="Protos\count.proto" />

<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="$(MicrosoftAspNetCoreAppPackageVersion)" />
<PackageReference Include="Grpc.AspNetCore" Version="$(GrpcDotNetPackageVersion)" />
<PackageReference Include="Grpc.AspNetCore.Web" Version="$(GrpcDotNetPackageVersion)" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" />
<PackageReference Include="Grpc.AspNetCore" />
<PackageReference Include="Grpc.AspNetCore.Web" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions examples/Browser/Server/Server.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<ItemGroup>
<Protobuf Include="..\Proto\greet.proto" GrpcServices="Server" Link="Protos\greet.proto" />

<PackageReference Include="Grpc.AspNetCore" Version="$(GrpcDotNetPackageVersion)" />
<PackageReference Include="Grpc.AspNetCore.Web" Version="$(GrpcDotNetPackageVersion)" />
<PackageReference Include="Grpc.AspNetCore" />
<PackageReference Include="Grpc.AspNetCore.Web" />
</ItemGroup>

<Target Name="DebugEnsureNodeEnv" BeforeTargets="Build" Condition=" '$(Configuration)' == 'Debug' And !Exists('$(SpaRoot)node_modules') ">
Expand Down
6 changes: 3 additions & 3 deletions examples/Certifier/Client/Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
<ItemGroup>
<Protobuf Include="..\Proto\certify.proto" GrpcServices="Client" Link="Protos\certify.proto" />

<PackageReference Include="Google.Protobuf" Version="$(GoogleProtobufPackageVersion)" />
<PackageReference Include="Grpc.Net.Client" Version="$(GrpcDotNetPackageVersion)" />
<PackageReference Include="Grpc.Tools" Version="$(GrpcToolsPackageVersion)" PrivateAssets="All" />
<PackageReference Include="Google.Protobuf" />
<PackageReference Include="Grpc.Net.Client" />
<PackageReference Include="Grpc.Tools" PrivateAssets="All" />

<None Update="Certs\client.pfx">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
Expand Down
4 changes: 2 additions & 2 deletions examples/Certifier/Server/Server.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<ItemGroup>
<Protobuf Include="..\Proto\certify.proto" GrpcServices="Server" Link="Protos\certify.proto" />

<PackageReference Include="Grpc.AspNetCore" Version="$(GrpcDotNetPackageVersion)" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Certificate" Version="$(MicrosoftAspNetCoreAppPackageVersion)" />
<PackageReference Include="Grpc.AspNetCore" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Certificate" />
</ItemGroup>

</Project>
6 changes: 3 additions & 3 deletions examples/Channeler/Client/Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
<ItemGroup>
<Protobuf Include="..\Proto\data_channel.proto" GrpcServices="Client" Link="Protos\data_channel.proto" />

<PackageReference Include="Google.Protobuf" Version="$(GoogleProtobufPackageVersion)" />
<PackageReference Include="Grpc.Net.Client" Version="$(GrpcDotNetPackageVersion)" />
<PackageReference Include="Grpc.Tools" Version="$(GrpcToolsPackageVersion)" PrivateAssets="All" />
<PackageReference Include="Google.Protobuf" />
<PackageReference Include="Grpc.Net.Client" />
<PackageReference Include="Grpc.Tools" PrivateAssets="All" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion examples/Channeler/Server/Server.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<ItemGroup>
<Protobuf Include="..\Proto\data_channel.proto" GrpcServices="Server" Link="Protos\data_channel.proto" />

<PackageReference Include="Grpc.AspNetCore" Version="$(GrpcDotNetPackageVersion)" />
<PackageReference Include="Grpc.AspNetCore" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion examples/Coder/Client/Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
<ItemGroup>
<ProjectReference Include="..\Shared\Shared.csproj" />

<PackageReference Include="Grpc.Net.Client" Version="$(GrpcDotNetPackageVersion)" />
<PackageReference Include="Grpc.Net.Client" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion examples/Coder/Server/Server.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<ItemGroup>
<ProjectReference Include="..\Shared\Shared.csproj" />

<PackageReference Include="protobuf-net.Grpc.AspNetCore" Version="$(ProtobufNetGrpcPackageVersion)" />
<PackageReference Include="protobuf-net.Grpc.AspNetCore" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion examples/Coder/Shared/Shared.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="protobuf-net.Grpc" Version="$(ProtobufNetGrpcPackageVersion)" />
<PackageReference Include="protobuf-net.Grpc" />
</ItemGroup>

</Project>
Loading

0 comments on commit ca9b756

Please sign in to comment.