Skip to content

Commit b295eb3

Browse files
authored
Merge pull request #1343 from json-api-dotnet/centralize-versions
Centralize NuGet package versions
2 parents 091fa28 + 2f93f43 commit b295eb3

File tree

18 files changed

+83
-66
lines changed

18 files changed

+83
-66
lines changed

Build.ps1

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
$versionSuffix="pre"
2+
13
function VerifySuccessExitCode {
24
if ($LastExitCode -ne 0) {
35
throw "Command failed with exit code $LastExitCode."
@@ -6,11 +8,12 @@ function VerifySuccessExitCode {
68

79
Write-Host "$(pwsh --version)"
810
Write-Host "Active .NET SDK: $(dotnet --version)"
11+
Write-Host "Using version suffix: $versionSuffix"
912

1013
dotnet tool restore
1114
VerifySuccessExitCode
1215

13-
dotnet build --configuration Release --version-suffix="pre"
16+
dotnet build --configuration Release /p:VersionSuffix=$versionSuffix
1417
VerifySuccessExitCode
1518

1619
dotnet test --no-build --configuration Release --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.DeterministicReport=true
@@ -19,5 +22,5 @@ VerifySuccessExitCode
1922
dotnet reportgenerator -reports:**\coverage.cobertura.xml -targetdir:artifacts\coverage -filefilters:-*.g.cs
2023
VerifySuccessExitCode
2124

22-
dotnet pack --no-build --configuration Release --output artifacts/packages --version-suffix="pre"
25+
dotnet pack --no-build --configuration Release --output artifacts/packages /p:VersionSuffix=$versionSuffix
2326
VerifySuccessExitCode

Directory.Build.props

Lines changed: 41 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,6 @@
11
<Project>
2-
<PropertyGroup>
3-
<TargetFrameworkName>net6.0</TargetFrameworkName>
4-
<AspNetVersion>6.0.*</AspNetVersion>
5-
<EFCoreVersion>7.0.*</EFCoreVersion>
6-
<EFCorePostgresVersion>7.0.*</EFCorePostgresVersion>
7-
<MicrosoftCodeAnalysisVersion>4.7.*</MicrosoftCodeAnalysisVersion>
8-
<HumanizerVersion>2.14.1</HumanizerVersion>
9-
<JsonApiDotNetCoreVersionPrefix>5.4.1</JsonApiDotNetCoreVersionPrefix>
10-
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)CodingGuidelines.ruleset</CodeAnalysisRuleSet>
11-
<WarningLevel>9999</WarningLevel>
12-
<Nullable>enable</Nullable>
13-
<ImplicitUsings>enable</ImplicitUsings>
14-
<IsPackable>false</IsPackable>
15-
<WarnOnPackingNonPackableProject>false</WarnOnPackingNonPackableProject>
16-
</PropertyGroup>
17-
18-
<ItemGroup>
19-
<PackageReference Include="JetBrains.Annotations" Version="2023.2.0" PrivateAssets="All" />
20-
<PackageReference Include="CSharpGuidelinesAnalyzer" Version="3.8.3" PrivateAssets="All" />
21-
<AdditionalFiles Include="$(MSBuildThisFileDirectory)CSharpGuidelinesAnalyzer.config" Visible="False" />
22-
</ItemGroup>
23-
24-
<PropertyGroup Condition="'$(CI)' != ''">
25-
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
2+
<PropertyGroup Condition="'$(Configuration)'=='Debug'">
3+
<NoWarn>$(NoWarn);AV2210</NoWarn>
264
</PropertyGroup>
275

286
<PropertyGroup Condition="'$(Configuration)'=='Release'">
@@ -31,14 +9,50 @@
319
<GenerateDocumentationFile>true</GenerateDocumentationFile>
3210
</PropertyGroup>
3311

34-
<PropertyGroup Condition="'$(Configuration)'=='Debug'">
35-
<NoWarn>$(NoWarn);AV2210</NoWarn>
12+
<PropertyGroup Condition="'$(CI)' != ''">
13+
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
3614
</PropertyGroup>
3715

38-
<!-- Test Project Dependencies -->
3916
<PropertyGroup>
17+
<!-- Published dependencies (only update on major version change) -->
18+
<TargetFrameworkName>net6.0</TargetFrameworkName>
19+
<CodeAnalysisFrozenVersion>4.1.0</CodeAnalysisFrozenVersion>
20+
<DemystifierFrozenVersion>0.4.1</DemystifierFrozenVersion>
21+
<EntityFrameworkCoreFrozenVersion>6.0.0</EntityFrameworkCoreFrozenVersion>
22+
<HumanizerFrozenVersion>2.14.1</HumanizerFrozenVersion>
23+
24+
<!-- Non-published dependencies (these are safe to update, won't cause a breaking change) -->
25+
<AspNetCoreVersion>6.0.*</AspNetCoreVersion>
26+
<BenchmarkDotNetVersion>0.13.*</BenchmarkDotNetVersion>
27+
<BogusVersion>34.0.*</BogusVersion>
28+
<CSharpGuidelinesAnalyzerVersion>3.8.*</CSharpGuidelinesAnalyzerVersion>
29+
<CodeAnalysisVersion>4.7.*</CodeAnalysisVersion>
4030
<CoverletVersion>6.0.*</CoverletVersion>
31+
<DateOnlyTimeOnlyVersion>2.1.*</DateOnlyTimeOnlyVersion>
32+
<EntityFrameworkCoreVersion>7.0.*</EntityFrameworkCoreVersion>
33+
<FluentAssertionsVersion>6.12.*</FluentAssertionsVersion>
4134
<GitHubActionsTestLoggerVersion>2.3.*</GitHubActionsTestLoggerVersion>
35+
<InheritDocVersion>1.3.*</InheritDocVersion>
36+
<JetBrainsAnnotationsVersion>2023.2.*</JetBrainsAnnotationsVersion>
37+
<NpgsqlVersion>7.0.*</NpgsqlVersion>
38+
<SourceLinkVersion>1.1.*</SourceLinkVersion>
39+
<SystemTextJsonVersion>7.0.*</SystemTextJsonVersion>
4240
<TestSdkVersion>17.7.*</TestSdkVersion>
41+
<XunitVersion>2.5.*</XunitVersion>
42+
</PropertyGroup>
43+
44+
<ItemGroup>
45+
<PackageReference Include="JetBrains.Annotations" Version="$(JetBrainsAnnotationsVersion)" PrivateAssets="All" />
46+
<PackageReference Include="CSharpGuidelinesAnalyzer" Version="$(CSharpGuidelinesAnalyzerVersion)" PrivateAssets="All" />
47+
<AdditionalFiles Include="$(MSBuildThisFileDirectory)CSharpGuidelinesAnalyzer.config" Visible="False" />
48+
</ItemGroup>
49+
50+
<PropertyGroup>
51+
<Nullable>enable</Nullable>
52+
<ImplicitUsings>enable</ImplicitUsings>
53+
<IsPackable>false</IsPackable>
54+
<WarnOnPackingNonPackableProject>false</WarnOnPackingNonPackableProject>
55+
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)CodingGuidelines.ruleset</CodeAnalysisRuleSet>
56+
<JsonApiDotNetCoreVersionPrefix>5.4.1</JsonApiDotNetCoreVersionPrefix>
4357
</PropertyGroup>
4458
</Project>

benchmarks/Benchmarks.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
</ItemGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="BenchmarkDotNet" Version="0.13.*" />
14-
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="$(MicrosoftCodeAnalysisVersion)" PrivateAssets="all">
13+
<PackageReference Include="BenchmarkDotNet" Version="$(BenchmarkDotNetVersion)" />
14+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="$(CodeAnalysisVersion)" PrivateAssets="all">
1515
<!-- This reference solely exists to prevent build warnings for conflicting versions of Microsoft.CodeAnalysis. -->
1616
</PackageReference>
1717
</ItemGroup>

src/Examples/DatabasePerTenantExample/DatabasePerTenantExample.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</ItemGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="$(EFCoreVersion)" />
14-
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="$(EFCorePostgresVersion)" />
13+
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="$(EntityFrameworkCoreVersion)" />
14+
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="$(NpgsqlVersion)" />
1515
</ItemGroup>
1616
</Project>

src/Examples/GettingStarted/GettingStarted.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
</ItemGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="$(EFCoreVersion)" />
13+
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="$(EntityFrameworkCoreVersion)" />
1414
</ItemGroup>
1515
</Project>

src/Examples/JsonApiDotNetCoreExample/JsonApiDotNetCoreExample.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</ItemGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="$(EFCoreVersion)" />
14-
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="$(EFCorePostgresVersion)" />
13+
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="$(EntityFrameworkCoreVersion)" />
14+
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="$(NpgsqlVersion)" />
1515
</ItemGroup>
1616
</Project>

src/Examples/MultiDbContextExample/MultiDbContextExample.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
</ItemGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="$(EFCoreVersion)" />
13+
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="$(EntityFrameworkCoreVersion)" />
1414
</ItemGroup>
1515
</Project>

src/Examples/NoEntityFrameworkExample/NoEntityFrameworkExample.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
</ItemGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="$(EFCoreVersion)" />
13+
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="$(EntityFrameworkCoreVersion)" />
1414
</ItemGroup>
1515
</Project>

src/Examples/ReportsExample/ReportsExample.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</ItemGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="$(EFCoreVersion)" />
14-
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="$(EFCorePostgresVersion)" />
13+
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="$(EntityFrameworkCoreVersion)" />
14+
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="$(NpgsqlVersion)" />
1515
</ItemGroup>
1616
</Project>

src/JsonApiDotNetCore.Annotations/JsonApiDotNetCore.Annotations.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
</ItemGroup>
4747

4848
<ItemGroup>
49-
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
50-
<PackageReference Include="SauceControl.InheritDoc" Version="1.3.0" PrivateAssets="All" />
49+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="$(SourceLinkVersion)" PrivateAssets="All" />
50+
<PackageReference Include="SauceControl.InheritDoc" Version="$(InheritDocVersion)" PrivateAssets="All" />
5151
</ItemGroup>
5252
</Project>

0 commit comments

Comments
 (0)