Skip to content

Commit 8d50e19

Browse files
Directory.Build.Props inheritance. (#446)
* Directory.Build.Props inheritance. * Moved TreatWarningsAsErrors to root Directory.Build.props
1 parent 4d635e6 commit 8d50e19

File tree

12 files changed

+142
-149
lines changed

12 files changed

+142
-149
lines changed

Directory.Build.props

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<Project>
2+
3+
<PropertyGroup>
4+
<TargetFramework>net10.0</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
</PropertyGroup>
7+
8+
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
9+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
10+
</PropertyGroup>
11+
12+
</Project>

LinkDotNet.Blog.sln

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio Version 17
4-
VisualStudioVersion = 17.0.31903.59
3+
# Visual Studio Version 18
4+
VisualStudioVersion = 18.0.11205.157
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LinkDotNet.Blog.Web", "src\LinkDotNet.Blog.Web\LinkDotNet.Blog.Web.csproj", "{6D6519BF-9265-488D-AA3B-C879F427930F}"
77
EndProject
@@ -17,25 +17,29 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LinkDotNet.Blog.TestUtiliti
1717
EndProject
1818
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{B6AF0B6E-14FB-4737-A69B-13B0D7195E2B}"
1919
ProjectSection(SolutionItems) = preProject
20-
Readme.md = Readme.md
2120
.editorconfig = .editorconfig
22-
MIGRATION.md = MIGRATION.md
21+
Directory.Build.props = Directory.Build.props
2322
Directory.Packages.props = Directory.Packages.props
23+
MIGRATION.md = MIGRATION.md
24+
Readme.md = Readme.md
2425
EndProjectSection
2526
EndProject
2627
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{86FD0EB5-13F9-4F1C-ADA1-072EEFEFF1E9}"
2728
ProjectSection(SolutionItems) = preProject
28-
src\Directory.Build.props = src\Directory.Build.props
2929
src\.editorconfig = src\.editorconfig
30+
src\Directory.Build.props = src\Directory.Build.props
3031
EndProjectSection
3132
EndProject
3233
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{CAD2F4A3-1282-49B5-B0AB-655CDBED0A35}"
3334
ProjectSection(SolutionItems) = preProject
34-
tests\Directory.Build.props = tests\Directory.Build.props
3535
tests\.editorconfig = tests\.editorconfig
36+
tests\Directory.Build.props = tests\Directory.Build.props
3637
EndProjectSection
3738
EndProject
3839
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{A931171C-22A6-4DB5-802B-67286B536BD2}"
40+
ProjectSection(SolutionItems) = preProject
41+
tools\Directory.Build.props = tools\Directory.Build.props
42+
EndProjectSection
3943
EndProject
4044
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LinkDotNet.Blog.CriticalCSS", "tools\LinkDotNet.Blog.CriticalCSS\LinkDotNet.Blog.CriticalCSS.csproj", "{8CB83177-C078-4953-BC27-8968D2A6E0FE}"
4145
EndProject
@@ -77,16 +81,16 @@ Global
7781
GlobalSection(SolutionProperties) = preSolution
7882
HideSolutionNode = FALSE
7983
EndGlobalSection
80-
GlobalSection(ExtensibilityGlobals) = postSolution
81-
SolutionGuid = {FB9B0642-F1F0-4BD8-9EDD-15C95F082180}
82-
EndGlobalSection
8384
GlobalSection(NestedProjects) = preSolution
85+
{6D6519BF-9265-488D-AA3B-C879F427930F} = {86FD0EB5-13F9-4F1C-ADA1-072EEFEFF1E9}
8486
{18F8E09D-FF0B-4FF9-93A9-971A388D0E2A} = {86FD0EB5-13F9-4F1C-ADA1-072EEFEFF1E9}
8587
{E8ED38D2-FCD3-473D-BD78-43EE78E08EE6} = {86FD0EB5-13F9-4F1C-ADA1-072EEFEFF1E9}
86-
{6D6519BF-9265-488D-AA3B-C879F427930F} = {86FD0EB5-13F9-4F1C-ADA1-072EEFEFF1E9}
88+
{5B868911-7C93-4190-AEE4-3A6694F2FFCE} = {CAD2F4A3-1282-49B5-B0AB-655CDBED0A35}
8789
{DEFDA17A-9586-4E50-83FB-8F75AC29D39A} = {CAD2F4A3-1282-49B5-B0AB-655CDBED0A35}
8890
{310ABEE1-C131-43E6-A759-F2DB75A483DD} = {CAD2F4A3-1282-49B5-B0AB-655CDBED0A35}
89-
{5B868911-7C93-4190-AEE4-3A6694F2FFCE} = {CAD2F4A3-1282-49B5-B0AB-655CDBED0A35}
9091
{8CB83177-C078-4953-BC27-8968D2A6E0FE} = {A931171C-22A6-4DB5-802B-67286B536BD2}
9192
EndGlobalSection
93+
GlobalSection(ExtensibilityGlobals) = postSolution
94+
SolutionGuid = {FB9B0642-F1F0-4BD8-9EDD-15C95F082180}
95+
EndGlobalSection
9296
EndGlobal

src/Directory.Build.props

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<PropertyGroup Label="Analyzer settings">
4-
<AnalysisMode>AllEnabledByDefault</AnalysisMode>
5-
<EnableNETAnalyzers>true</EnableNETAnalyzers>
6-
<AnalysisLevel>latest</AnalysisLevel>
7-
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
8-
<NuGetAuditLevel>critical</NuGetAuditLevel>
9-
<Nullable>enable</Nullable>
10-
</PropertyGroup>
3+
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)..\'))" />
4+
5+
<PropertyGroup Label="Analyzer settings">
6+
<AnalysisMode>AllEnabledByDefault</AnalysisMode>
7+
<EnableNETAnalyzers>true</EnableNETAnalyzers>
8+
<AnalysisLevel>latest</AnalysisLevel>
9+
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
10+
<NuGetAuditLevel>critical</NuGetAuditLevel>
11+
<Nullable>enable</Nullable>
12+
</PropertyGroup>
1113

1214
<ItemGroup Label="Code Analyzers">
1315
<PackageReference Include="IDisposableAnalyzers" PrivateAssets="All" IncludeAssets="Runtime;Build;Native;contentFiles;Analyzers" />
1416
</ItemGroup>
1517

16-
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
17-
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
18-
</PropertyGroup>
19-
2018
</Project>
Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<PropertyGroup>
4-
<TargetFramework>net10.0</TargetFramework>
5-
<Nullable>enable</Nullable>
6-
<AssemblyName>LinkDotNet.Blog.Domain</AssemblyName>
7-
<RootNamespace>LinkDotNet.Blog.Domain</RootNamespace>
8-
</PropertyGroup>
3+
<PropertyGroup>
4+
<AssemblyName>LinkDotNet.Blog.Domain</AssemblyName>
5+
<RootNamespace>LinkDotNet.Blog.Domain</RootNamespace>
6+
</PropertyGroup>
7+
98
</Project>
Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<PropertyGroup>
4-
<TargetFramework>net10.0</TargetFramework>
5-
<AssemblyName>LinkDotNet.Blog.Infrastructure</AssemblyName>
6-
<RootNamespace>LinkDotNet.Blog.Infrastructure</RootNamespace>
7-
<Nullable>enable</Nullable>
8-
</PropertyGroup>
3+
<PropertyGroup>
4+
<AssemblyName>LinkDotNet.Blog.Infrastructure</AssemblyName>
5+
<RootNamespace>LinkDotNet.Blog.Infrastructure</RootNamespace>
6+
</PropertyGroup>
97

10-
<ItemGroup>
11-
<PackageReference Include="Microsoft.EntityFrameworkCore" />
12-
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" />
13-
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" />
14-
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions" />
15-
<PackageReference Include="MongoDB.Driver" />
16-
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" />
17-
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL"/>
18-
<PackageReference Include="RavenDB.Client" />
19-
</ItemGroup>
8+
<ItemGroup>
9+
<PackageReference Include="Microsoft.EntityFrameworkCore" />
10+
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" />
11+
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" />
12+
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions" />
13+
<PackageReference Include="MongoDB.Driver" />
14+
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" />
15+
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL"/>
16+
<PackageReference Include="RavenDB.Client" />
17+
</ItemGroup>
18+
19+
<ItemGroup>
20+
<ProjectReference Include="..\LinkDotNet.Blog.Domain\LinkDotNet.Blog.Domain.csproj" />
21+
</ItemGroup>
2022

21-
<ItemGroup>
22-
<ProjectReference Include="..\LinkDotNet.Blog.Domain\LinkDotNet.Blog.Domain.csproj" />
23-
</ItemGroup>
2423
</Project>

src/LinkDotNet.Blog.Web/LinkDotNet.Blog.Web.csproj

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

3-
<PropertyGroup>
4-
<TargetFramework>net10.0</TargetFramework>
5-
<Nullable>enable</Nullable>
6-
</PropertyGroup>
7-
83
<ItemGroup>
94
<PackageReference Include="AspNetCore.HealthChecks.UI.Client"/>
105
<PackageReference Include="Azure.Storage.Blobs"/>
@@ -27,4 +22,5 @@
2722
<ProjectReference Include="..\LinkDotNet.Blog.Domain\LinkDotNet.Blog.Domain.csproj"/>
2823
<ProjectReference Include="..\LinkDotNet.Blog.Infrastructure\LinkDotNet.Blog.Infrastructure.csproj"/>
2924
</ItemGroup>
25+
3026
</Project>

tests/Directory.Build.props

Lines changed: 37 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,44 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
4-
<PropertyGroup>
5-
<NuGetAuditLevel>critical</NuGetAuditLevel>
6-
<InterceptorsPreviewNamespaces>$(InterceptorsPreviewNamespaces);Bunit</InterceptorsPreviewNamespaces>
7-
</PropertyGroup>
8-
9-
<ItemGroup Condition="$(MSBuildProjectName) != 'LinkDotNet.Blog.TestUtilities'">
10-
<PackageReference Include="Microsoft.NET.Test.Sdk" />
11-
<PackageReference Include="xunit.v3" />
12-
<PackageReference Include="xunit.runner.visualstudio">
13-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
14-
<PrivateAssets>all</PrivateAssets>
15-
</PackageReference>
16-
</ItemGroup>
3+
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)..\'))" />
174

18-
<ItemGroup>
19-
<PackageReference Include="bunit" />
20-
<PackageReference Include="Shouldly" />
21-
<PackageReference Include="NSubstitute" />
22-
<PackageReference Include="coverlet.collector">
23-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
24-
<PrivateAssets>all</PrivateAssets>
25-
</PackageReference>
26-
<PackageReference Include="coverlet.msbuild">
27-
<PrivateAssets>all</PrivateAssets>
28-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
29-
</PackageReference>
30-
</ItemGroup>
31-
32-
<ItemGroup Condition="$(MSBuildProjectName) != 'LinkDotNet.Blog.TestUtilities'">
33-
<Using Include="Xunit" />
34-
</ItemGroup>
5+
<PropertyGroup>
6+
<NuGetAuditLevel>critical</NuGetAuditLevel>
7+
<InterceptorsPreviewNamespaces>$(InterceptorsPreviewNamespaces);Bunit</InterceptorsPreviewNamespaces>
8+
</PropertyGroup>
359

36-
<ItemGroup Label="Implicit usings">
37-
<Using Include="Shouldly" />
38-
<Using Include="NSubstitute" />
39-
<Using Include="Bunit" />
40-
<Using Include="Bunit.TestDoubles" />
41-
</ItemGroup>
10+
<ItemGroup Condition="$(MSBuildProjectName) != 'LinkDotNet.Blog.TestUtilities'">
11+
<PackageReference Include="Microsoft.NET.Test.Sdk" />
12+
<PackageReference Include="xunit.v3" />
13+
<PackageReference Include="xunit.runner.visualstudio">
14+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
15+
<PrivateAssets>all</PrivateAssets>
16+
</PackageReference>
17+
</ItemGroup>
4218

43-
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
44-
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
45-
</PropertyGroup>
19+
<ItemGroup>
20+
<PackageReference Include="bunit" />
21+
<PackageReference Include="Shouldly" />
22+
<PackageReference Include="NSubstitute" />
23+
<PackageReference Include="coverlet.collector">
24+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
25+
<PrivateAssets>all</PrivateAssets>
26+
</PackageReference>
27+
<PackageReference Include="coverlet.msbuild">
28+
<PrivateAssets>all</PrivateAssets>
29+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
30+
</PackageReference>
31+
</ItemGroup>
32+
33+
<ItemGroup Condition="$(MSBuildProjectName) != 'LinkDotNet.Blog.TestUtilities'">
34+
<Using Include="Xunit" />
35+
</ItemGroup>
36+
37+
<ItemGroup Label="Implicit usings">
38+
<Using Include="Shouldly" />
39+
<Using Include="NSubstitute" />
40+
<Using Include="Bunit" />
41+
<Using Include="Bunit.TestDoubles" />
42+
</ItemGroup>
4643

4744
</Project>
Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<PropertyGroup>
4-
<TargetFramework>net10.0</TargetFramework>
5-
<OutputType>Exe</OutputType>
6-
<Nullable>enable</Nullable>
7-
<IsPackable>false</IsPackable>
8-
</PropertyGroup>
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<IsPackable>false</IsPackable>
6+
</PropertyGroup>
97

10-
<ItemGroup>
11-
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" />
12-
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" />
13-
<PackageReference Include="RavenDB.TestDriver" />
14-
</ItemGroup>
8+
<ItemGroup>
9+
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" />
10+
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" />
11+
<PackageReference Include="RavenDB.TestDriver" />
12+
</ItemGroup>
1513

16-
<ItemGroup>
17-
<ProjectReference Include="..\LinkDotNet.Blog.TestUtilities\LinkDotNet.Blog.TestUtilities.csproj" />
18-
<ProjectReference Include="..\..\src\LinkDotNet.Blog.Web\LinkDotNet.Blog.Web.csproj" />
19-
<ProjectReference Include="..\..\src\LinkDotNet.Blog.Infrastructure\LinkDotNet.Blog.Infrastructure.csproj" />
20-
</ItemGroup>
14+
<ItemGroup>
15+
<ProjectReference Include="..\LinkDotNet.Blog.TestUtilities\LinkDotNet.Blog.TestUtilities.csproj" />
16+
<ProjectReference Include="..\..\src\LinkDotNet.Blog.Web\LinkDotNet.Blog.Web.csproj" />
17+
<ProjectReference Include="..\..\src\LinkDotNet.Blog.Infrastructure\LinkDotNet.Blog.Infrastructure.csproj" />
18+
</ItemGroup>
2119

2220
</Project>
Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<PropertyGroup>
4-
<TargetFramework>net10.0</TargetFramework>
5-
<Nullable>enable</Nullable>
6-
</PropertyGroup>
7-
8-
<ItemGroup>
9-
<ProjectReference Include="..\..\src\LinkDotNet.Blog.Domain\LinkDotNet.Blog.Domain.csproj" />
10-
<ProjectReference Include="..\..\src\LinkDotNet.Blog.Web\LinkDotNet.Blog.Web.csproj" />
11-
</ItemGroup>
3+
<ItemGroup>
4+
<ProjectReference Include="..\..\src\LinkDotNet.Blog.Domain\LinkDotNet.Blog.Domain.csproj" />
5+
<ProjectReference Include="..\..\src\LinkDotNet.Blog.Web\LinkDotNet.Blog.Web.csproj" />
6+
</ItemGroup>
127

138
</Project>
Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<PropertyGroup>
4-
<TargetFramework>net10.0</TargetFramework>
5-
<OutputType>Exe</OutputType>
6-
<Nullable>enable</Nullable>
7-
<IsPackable>false</IsPackable>
8-
</PropertyGroup>
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<IsPackable>false</IsPackable>
6+
</PropertyGroup>
7+
8+
<ItemGroup>
9+
<ProjectReference Include="..\LinkDotNet.Blog.TestUtilities\LinkDotNet.Blog.TestUtilities.csproj" />
10+
<ProjectReference Include="..\..\src\LinkDotNet.Blog.Web\LinkDotNet.Blog.Web.csproj" />
11+
</ItemGroup>
912

10-
<ItemGroup>
11-
<ProjectReference Include="..\LinkDotNet.Blog.TestUtilities\LinkDotNet.Blog.TestUtilities.csproj" />
12-
<ProjectReference Include="..\..\src\LinkDotNet.Blog.Web\LinkDotNet.Blog.Web.csproj" />
13-
</ItemGroup>
1413
</Project>

0 commit comments

Comments
 (0)