Skip to content

Commit

Permalink
chore: Adopt centralized package management
Browse files Browse the repository at this point in the history
(And put common properties into a Directory.Build.props file at the same time.)
  • Loading branch information
jskeet committed Sep 5, 2024
1 parent fffa958 commit ee91107
Show file tree
Hide file tree
Showing 11 changed files with 90 additions and 65 deletions.
17 changes: 17 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Project>

<PropertyGroup>
<!--
- Target net6.0 for everything, even if netstandard2.1 would
- be fine for library projects.
-->
<TargetFramework>net6.0</TargetFramework>

<!-- Common build properties -->
<LangVersion>latest</LangVersion>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>

<!-- Allow Directory.Packages.props to do its magic -->
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
</Project>
38 changes: 38 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<Project>
<ItemGroup>
<!-- Test-oriented packages -->
<PackageVersion Include="xunit" Version="2.9.0" />
<PackageVersion Include="xunit.assert" Version="2.9.0" />
<PackageVersion Include="xunit.core" Version="2.9.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
<PackageVersion Include="Xunit.SkippableFact" Version="1.4.13" />
<PackageVersion Include="Xunit.Combinatorial" Version="1.6.24" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.0" />
<PackageVersion Include="NSubstitute" Version="5.1.0" />

<!-- Google/gRPC packages -->
<PackageVersion Include="Google.Api.Gax" Version="4.8.0" />
<PackageVersion Include="Google.Api.Gax.Grpc" Version="4.8.0" />
<PackageVersion Include="Google.Api.Gax.Testing" Version="4.8.0" />
<PackageVersion Include="Google.Apis" Version="1.68.0" />
<PackageVersion Include="Google.Cloud.Iam.V1" Version="3.3.0" />
<PackageVersion Include="Google.Cloud.Location" Version="2.3.0" />
<PackageVersion Include="Google.LongRunning" Version="3.3.0" />

<!-- Microsoft/System packages -->
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="6.0.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.11.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.4" />
<PackageVersion Include="System.Collections.Immutable" Version="8.0.0" />
<PackageVersion Include="System.Linq.Async" Version="6.0.1" />

<!-- Other third party packages -->
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<PackageVersion Include="CommandLineParser" Version="2.9.1" />
<PackageVersion Include="YamlDotNet" Version="16.1.0" />

<!-- Build-oriented packages -->
<PackageVersion Include="ConfigureAwaitChecker.Analyzer" Version="5.0.0" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.0" />
<PackageReference Include="xunit" Version="2.9.0" />
<PackageReference Include="Xunit.SkippableFact" Version="1.4.13" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="xunit" />
<PackageReference Include="Xunit.SkippableFact" />
<PackageReference Include="xunit.runner.visualstudio" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.0" />
<PackageReference Include="Google.Api.Gax.Testing" Version="4.8.0" />
<PackageReference Include="xunit" Version="2.9.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="Google.Api.Gax.Testing" />
<PackageReference Include="xunit" />
<PackageReference Include="xunit.runner.visualstudio" />
</ItemGroup>

<ItemGroup>
Expand Down
3 changes: 1 addition & 2 deletions Google.Api.Generator.Rest/Google.Api.Generator.Rest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>

<Version>1.5.0</Version>
<Description>Tool used by Google .NET client library maintainers to generate Discovery-based (REST) libraries. While there is nothing "secret" in this package, it is unlikely to be useful to other developers. It is only published as a matter of convenience for other Google .NET repositories.</Description>
<ToolCommandName>google-rest-generator</ToolCommandName>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Google.Apis" Version="1.68.0" />
<PackageReference Include="Google.Apis" />
<ProjectReference Include="..\Google.Api.Generator.Utils\Google.Api.Generator.Utils.csproj" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="xunit" Version="2.9.0" />
<PackageReference Include="xunit" />
<ProjectReference Include="..\Google.Api.Generator.Utils\Google.Api.Generator.Utils.csproj" />
</ItemGroup>

Expand Down
15 changes: 4 additions & 11 deletions Google.Api.Generator.Tests/Google.Api.Generator.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>

<IsPackable>false</IsPackable>

<LangVersion>latest</LangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Google.Api.Gax.Testing" Version="4.8.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.0" />
<PackageReference Include="xunit" Version="2.9.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Google.Api.Gax.Testing" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="xunit" />
<PackageReference Include="xunit.runner.visualstudio" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 6 additions & 0 deletions Google.Api.Generator.Tests/ProtoTests/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<Project>
<!--
- This file is present to avoid using the generator's
- Directory.Build.props when building the generated test projects.
-->
</Project>
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>

<IsPackable>false</IsPackable>

<LangVersion>latest</LangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Google.Api.Gax.Testing" Version="4.8.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.0" />
<PackageReference Include="xunit" Version="2.9.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Google.Api.Gax.Testing" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="xunit" />
<PackageReference Include="xunit.runner.visualstudio" />
</ItemGroup>

<ItemGroup>
Expand Down
11 changes: 3 additions & 8 deletions Google.Api.Generator.Utils/Google.Api.Generator.Utils.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<LangVersion>latest</LangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.11.0" />
<PackageReference Include="Google.Api.Gax" Version="4.8.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.4" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" />
<PackageReference Include="Google.Api.Gax" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" />
</ItemGroup>
</Project>
18 changes: 8 additions & 10 deletions Google.Api.Generator/Google.Api.Generator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<LangVersion>latest</LangVersion>

<Version>1.5.0</Version>
<Description>Tool used by Google .NET client library maintainers to generate GAPIC libraries. While there is nothing "secret" in this package, it is unlikely to be useful to other developers. It is only published as a matter of convenience for other Google .NET repositories.</Description>
Expand All @@ -16,14 +14,14 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.9.1" />
<PackageReference Include="Google.Api.Gax.Grpc" Version="4.8.0" />
<PackageReference Include="Google.Cloud.Iam.V1" Version="3.3.0" />
<PackageReference Include="Google.Cloud.Location" Version="2.3.0" />
<PackageReference Include="Google.LongRunning" Version="3.3.0" />
<PackageReference Include="System.Collections.Immutable" Version="8.0.0" />
<PackageReference Include="System.Linq.Async" Version="6.0.1" />
<PackageReference Include="YamlDotNet" Version="16.1.0" />
<PackageReference Include="CommandLineParser" />
<PackageReference Include="Google.Api.Gax.Grpc" />
<PackageReference Include="Google.Cloud.Iam.V1" />
<PackageReference Include="Google.Cloud.Location" />
<PackageReference Include="Google.LongRunning" />
<PackageReference Include="System.Collections.Immutable" />
<PackageReference Include="System.Linq.Async" />
<PackageReference Include="YamlDotNet" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit ee91107

Please sign in to comment.