Skip to content

Commit f5db2e2

Browse files
authored
refactor: consolidate project settings in Directory.Build.props (#1211)
Move common settings to the `Directory.Build.props` file.
1 parent 9371d4b commit f5db2e2

File tree

5 files changed

+56
-38
lines changed

5 files changed

+56
-38
lines changed

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project>
22
<PropertyGroup>
33
<Product>System.IO.Abstractions</Product>
4-
<Copyright>Copyright © Tatham Oddie &amp; friends 2010-2024</Copyright>
4+
<Copyright>Copyright © Tatham Oddie &amp; friends 2010-$([System.DateTime]::Now.ToString('yyyy'))</Copyright>
55
<Authors>Tatham Oddie &amp; friends</Authors>
66
<SignAssembly Condition="'$(Configuration)' == 'Release'">True</SignAssembly>
77
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)StrongName.snk</AssemblyOriginatorKeyFile>

System.IO.Abstractions.sln

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{
4040
.github\workflows\pr.yml = .github\workflows\pr.yml
4141
EndProjectSection
4242
EndProject
43+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{B66A0B3F-6A00-482E-99E2-27D8DECB075E}"
44+
ProjectSection(SolutionItems) = preProject
45+
src\Directory.Build.props = src\Directory.Build.props
46+
EndProjectSection
47+
EndProject
4348
Global
4449
GlobalSection(SolutionConfigurationPlatforms) = preSolution
4550
Debug|Any CPU = Debug|Any CPU
@@ -91,6 +96,7 @@ Global
9196
{2BE9161B-A3F3-4511-81DB-DB1DCB6375C9} = {BBF7AD8D-5522-48C0-A906-00CBB72308A0}
9297
{D905E09D-6DC3-4F7C-8E83-82FADAE2C9E5} = {2BE9161B-A3F3-4511-81DB-DB1DCB6375C9}
9398
{1B8388D2-58A7-47B8-89EC-C5A94A0FEED5} = {C078E0B6-9747-475F-A999-B9E775DF6643}
99+
{B66A0B3F-6A00-482E-99E2-27D8DECB075E} = {BBF7AD8D-5522-48C0-A906-00CBB72308A0}
94100
EndGlobalSection
95101
GlobalSection(ExtensibilityGlobals) = postSolution
96102
SolutionGuid = {8885C59C-F6A0-4C2F-A3BC-B720E9BD161F}

src/Directory.Build.props

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,32 @@
11
<Project>
2-
<Import Project="../Directory.Build.props" />
3-
<PropertyGroup>
4-
<PublishRepositoryUrl>true</PublishRepositoryUrl>
5-
<IncludeSymbols>true</IncludeSymbols>
6-
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
7-
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
8-
<GenerateDocumentationFile >true</GenerateDocumentationFile>
9-
</PropertyGroup>
2+
3+
<Import Project="$(MSBuildThisFileDirectory)/../Directory.Build.props"
4+
Condition="Exists('$(MSBuildThisFileDirectory)/../Directory.Build.props')"/>
5+
6+
<PropertyGroup>
7+
<TargetFrameworks>net472;netstandard2.0;netstandard2.1;net6.0;net8.0;net9.0</TargetFrameworks>
8+
</PropertyGroup>
9+
10+
<PropertyGroup>
11+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
12+
<IncludeSymbols>true</IncludeSymbols>
13+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
14+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
15+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
16+
</PropertyGroup>
17+
18+
<PropertyGroup>
19+
<PackageIcon>icon_256x256.png</PackageIcon>
20+
</PropertyGroup>
21+
<ItemGroup>
22+
<None Include="..\..\images\icon_256x256.png" Pack="true" PackagePath="\"/>
23+
</ItemGroup>
24+
25+
<ItemGroup>
26+
<PackageReference Include="IsExternalInit">
27+
<PrivateAssets>all</PrivateAssets>
28+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
29+
</PackageReference>
30+
</ItemGroup>
31+
1032
</Project>
Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,14 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2+
23
<PropertyGroup>
34
<AssemblyName>TestableIO.System.IO.Abstractions.TestingHelpers</AssemblyName>
45
<RootNamespace>System.IO.Abstractions.TestingHelpers</RootNamespace>
56
<Description>A set of pre-built mocks to help when testing file system interactions.</Description>
6-
<TargetFrameworks>net9.0;net8.0;net6.0;netstandard2.1;netstandard2.0;net472</TargetFrameworks>
7-
<PackageIcon>icon_256x256.png</PackageIcon>
87
</PropertyGroup>
8+
99
<ItemGroup>
10-
<PackageReference Include="Testably.Abstractions.FileSystem.Interface" />
11-
<ProjectReference Include="../TestableIO.System.IO.Abstractions.Wrappers/TestableIO.System.IO.Abstractions.Wrappers.csproj" />
12-
</ItemGroup>
13-
<ItemGroup>
14-
<PackageReference Include="IsExternalInit">
15-
<PrivateAssets>all</PrivateAssets>
16-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
17-
</PackageReference>
18-
</ItemGroup>
19-
<ItemGroup>
20-
<None Include="..\..\images\icon_256x256.png" Pack="true" PackagePath="\" />
10+
<PackageReference Include="Testably.Abstractions.FileSystem.Interface"/>
11+
<ProjectReference Include="../TestableIO.System.IO.Abstractions.Wrappers/TestableIO.System.IO.Abstractions.Wrappers.csproj"/>
2112
</ItemGroup>
13+
2214
</Project>
Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
<PropertyGroup>
3-
<AssemblyName>TestableIO.System.IO.Abstractions.Wrappers</AssemblyName>
4-
<RootNamespace>System.IO.Abstractions</RootNamespace>
5-
<Description>A set of abstractions to help make file system interactions testable.</Description>
6-
<TargetFrameworks>net9.0;net8.0;net6.0;netstandard2.1;netstandard2.0;net472</TargetFrameworks>
7-
<PackageIcon>icon_256x256.png</PackageIcon>
8-
</PropertyGroup>
9-
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.1' OR '$(TargetFramework)' == 'netstandard2.0'">
10-
<PackageReference Include="System.IO.FileSystem.AccessControl" />
11-
</ItemGroup>
12-
<ItemGroup>
13-
<None Include="..\..\images\icon_256x256.png" Pack="true" PackagePath="\" />
14-
</ItemGroup>
15-
<ItemGroup>
16-
<PackageReference Include="Testably.Abstractions.FileSystem.Interface" />
17-
</ItemGroup>
2+
3+
<PropertyGroup>
4+
<AssemblyName>TestableIO.System.IO.Abstractions.Wrappers</AssemblyName>
5+
<RootNamespace>System.IO.Abstractions</RootNamespace>
6+
<Description>A set of abstractions to help make file system interactions testable.</Description>
7+
</PropertyGroup>
8+
9+
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.1' OR '$(TargetFramework)' == 'netstandard2.0'">
10+
<PackageReference Include="System.IO.FileSystem.AccessControl"/>
11+
</ItemGroup>
12+
<ItemGroup>
13+
<PackageReference Include="Testably.Abstractions.FileSystem.Interface"/>
14+
</ItemGroup>
15+
1816
</Project>

0 commit comments

Comments
 (0)