Skip to content

Commit 788d196

Browse files
authored
refactor: split project in wrapper and abstraction (#905)
1 parent c129e19 commit 788d196

File tree

90 files changed

+95
-22
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+95
-22
lines changed

System.IO.Abstractions.sln

+16-3
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 16
4-
VisualStudioVersion = 16.0.30128.74
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.3.32825.248
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{5F3BDA62-8052-4C37-97A0-94354AA971B0}"
77
ProjectSection(SolutionItems) = preProject
@@ -19,7 +19,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.IO.Abstractions.Benc
1919
EndProject
2020
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{BCEC61BD-4941-41EC-975A-ACEFC7AC1780}"
2121
EndProject
22-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.IO.Abstractions.Tests", "tests\System.IO.Abstractions.Tests\System.IO.Abstractions.Tests.csproj", "{7105D748-1253-409F-A624-4879412EF3C2}"
22+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestableIO.System.IO.Abstractions.Wrappers.Tests", "tests\TestableIO.System.IO.Abstractions.Wrappers.Tests\TestableIO.System.IO.Abstractions.Wrappers.Tests.csproj", "{7105D748-1253-409F-A624-4879412EF3C2}"
23+
EndProject
24+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestableIO.System.IO.Abstractions", "src\TestableIO.System.IO.Abstractions\TestableIO.System.IO.Abstractions.csproj", "{1B8388D2-58A7-47B8-89EC-C5A94A0FEED5}"
25+
EndProject
26+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestableIO.System.IO.Abstractions.Wrappers", "src\TestableIO.System.IO.Abstractions.Wrappers\TestableIO.System.IO.Abstractions.Wrappers.csproj", "{3698BB93-B031-4140-BAEF-D3480A94F531}"
2327
EndProject
2428
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "images", "images", "{F781892B-7C5D-4C8D-8D3D-3E9E207D686D}"
2529
ProjectSection(SolutionItems) = preProject
@@ -52,11 +56,20 @@ Global
5256
{7105D748-1253-409F-A624-4879412EF3C2}.Debug|Any CPU.Build.0 = Debug|Any CPU
5357
{7105D748-1253-409F-A624-4879412EF3C2}.Release|Any CPU.ActiveCfg = Release|Any CPU
5458
{7105D748-1253-409F-A624-4879412EF3C2}.Release|Any CPU.Build.0 = Release|Any CPU
59+
{1B8388D2-58A7-47B8-89EC-C5A94A0FEED5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
60+
{1B8388D2-58A7-47B8-89EC-C5A94A0FEED5}.Debug|Any CPU.Build.0 = Debug|Any CPU
61+
{1B8388D2-58A7-47B8-89EC-C5A94A0FEED5}.Release|Any CPU.ActiveCfg = Release|Any CPU
62+
{1B8388D2-58A7-47B8-89EC-C5A94A0FEED5}.Release|Any CPU.Build.0 = Release|Any CPU
63+
{3698BB93-B031-4140-BAEF-D3480A94F531}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
64+
{3698BB93-B031-4140-BAEF-D3480A94F531}.Debug|Any CPU.Build.0 = Debug|Any CPU
65+
{3698BB93-B031-4140-BAEF-D3480A94F531}.Release|Any CPU.ActiveCfg = Release|Any CPU
66+
{3698BB93-B031-4140-BAEF-D3480A94F531}.Release|Any CPU.Build.0 = Release|Any CPU
5567
EndGlobalSection
5668
GlobalSection(SolutionProperties) = preSolution
5769
HideSolutionNode = FALSE
5870
EndGlobalSection
5971
GlobalSection(NestedProjects) = preSolution
72+
{20B02738-952A-40F5-9C10-E2F83013E9FC} = {BCEC61BD-4941-41EC-975A-ACEFC7AC1780}
6073
{7105D748-1253-409F-A624-4879412EF3C2} = {BCEC61BD-4941-41EC-975A-ACEFC7AC1780}
6174
EndGlobalSection
6275
GlobalSection(ExtensibilityGlobals) = postSolution

src/System.IO.Abstractions/System.IO.Abstractions.csproj

+2-10
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,9 @@
66
<TargetFrameworks>net6.0;net5.0;netstandard2.1;netstandard2.0;net461</TargetFrameworks>
77
<PackageIcon>icon_256x256.png</PackageIcon>
88
</PropertyGroup>
9-
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.1' OR '$(TargetFramework)' == 'netstandard2.0'">
10-
<PackageReference Include="System.IO.FileSystem.AccessControl" Version="5.0.0" />
11-
</ItemGroup>
12-
<ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">
13-
<PackageReference Include="System.IO.FileSystem.AccessControl" Version="5.0.0" />
14-
</ItemGroup>
159
<ItemGroup>
16-
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies.net461" Version="1.0.3">
17-
<PrivateAssets>all</PrivateAssets>
18-
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
19-
</PackageReference>
10+
<ProjectReference Include="..\TestableIO.System.IO.Abstractions\TestableIO.System.IO.Abstractions.csproj" />
11+
<ProjectReference Include="..\TestableIO.System.IO.Abstractions.Wrappers\TestableIO.System.IO.Abstractions.Wrappers.csproj" />
2012
</ItemGroup>
2113
<ItemGroup>
2214
<None Include="..\..\images\icon_256x256.png" Pack="true" PackagePath="\" />
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<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>net6.0;net5.0;netstandard2.1;netstandard2.0;net461</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" Version="5.0.0" />
11+
</ItemGroup>
12+
<ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">
13+
<PackageReference Include="System.IO.FileSystem.AccessControl" Version="5.0.0" />
14+
</ItemGroup>
15+
<ItemGroup>
16+
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies.net461" Version="1.0.3">
17+
<PrivateAssets>all</PrivateAssets>
18+
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
19+
</PackageReference>
20+
</ItemGroup>
21+
<ItemGroup>
22+
<None Include="..\..\images\icon_256x256.png" Pack="true" PackagePath="\" />
23+
</ItemGroup>
24+
<ItemGroup>
25+
<ProjectReference Include="..\TestableIO.System.IO.Abstractions\TestableIO.System.IO.Abstractions.csproj" />
26+
</ItemGroup>
27+
</Project>

src/System.IO.Abstractions/IDirectoryInfoFactory.cs src/TestableIO.System.IO.Abstractions/IDirectoryInfoFactory.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ namespace System.IO.Abstractions
44
public interface IDirectoryInfoFactory
55
{
66
/// <summary>
7-
/// Initializes a new instance of the <see cref="DirectoryInfoBase"/> class, which acts as a wrapper for a directory path.
7+
/// Initializes a new instance of the <see cref="IDirectoryInfo"/> class, which acts as a wrapper for a directory path.
88
/// </summary>
99
/// <param name="directoryName">The fully qualified name of the new directory, or the relative directory name.</param>
1010
IDirectoryInfo FromDirectoryName(string directoryName);

src/System.IO.Abstractions/IDriveInfoFactory.cs src/TestableIO.System.IO.Abstractions/IDriveInfoFactory.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
namespace System.IO.Abstractions
22
{
33
/// <summary>
4-
/// A factory to create all <see cref="DriveInfoBase"/> for a <see cref="IFileSystem"/>.
4+
/// A factory to create all <see cref="IDriveInfo"/> for a <see cref="IFileSystem"/>.
55
/// </summary>
66
public interface IDriveInfoFactory
77
{
88
/// <summary>
99
/// Retrieves the drive names of all logical drives on a computer.
1010
/// </summary>
11-
/// <returns>An array of type <see cref="DriveInfoBase"/> that represents the logical drives on a computer.</returns>
11+
/// <returns>An array of type <see cref="IDriveInfo"/> that represents the logical drives on a computer.</returns>
1212
IDriveInfo[] GetDrives();
1313

1414
/// <summary>
15-
/// Initializes a new instance of the <see cref="DriveInfoBase"/> class, which acts as a wrapper for a logical drive.
15+
/// Initializes a new instance of the <see cref="IDriveInfo"/> class, which acts as a wrapper for a logical drive.
1616
/// </summary>
1717
/// <param name="driveName">A valid drive path or drive letter.</param>
1818
IDriveInfo FromDriveName(string driveName);

src/System.IO.Abstractions/IFileInfoFactory.cs src/TestableIO.System.IO.Abstractions/IFileInfoFactory.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
public interface IFileInfoFactory
77
{
88
/// <summary>
9-
/// Initializes a new instance of the <see cref="FileInfoBase"/> class, which acts as a wrapper for a file path.
9+
/// Initializes a new instance of the <see cref="IFileInfo"/> class, which acts as a wrapper for a file path.
1010
/// </summary>
1111
/// <param name="fileName">The fully qualified name of the new file, or the relative file name.</param>
1212
IFileInfo FromFileName(string fileName);

src/System.IO.Abstractions/IFileSystemWatcherFactory.cs src/TestableIO.System.IO.Abstractions/IFileSystemWatcherFactory.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@
66
public interface IFileSystemWatcherFactory
77
{
88
/// <summary>
9-
/// Initializes a new instance of the <see cref="FileSystemWatcherBase"/> class, which acts as a wrapper for a FileSystemWatcher
9+
/// Initializes a new instance of the <see cref="IFileSystemWatcher"/> class, which acts as a wrapper for a FileSystemWatcher
1010
/// </summary>
1111
/// <returns></returns>
1212
IFileSystemWatcher CreateNew();
1313

1414
/// <summary>
15-
/// Initializes a new instance of the <see cref="FileSystemWatcherBase"/> class, given the specified directory to monitor, which acts as a wrapper for a FileSystemWatcher
15+
/// Initializes a new instance of the <see cref="IFileSystemWatcher"/> class, given the specified directory to monitor, which acts as a wrapper for a FileSystemWatcher
1616
/// </summary>
1717
/// <param name="path">The directory to monitor, in standard or Universal Naming Convention (UNC) notation.</param>
1818
/// <returns></returns>
1919
IFileSystemWatcher CreateNew(string path);
2020

2121
/// <summary>
22-
/// Initializes a new instance of the <see cref="FileSystemWatcherBase"/> class, given the specified directory and type of files to monitor, which acts as a wrapper for a FileSystemWatcher
22+
/// Initializes a new instance of the <see cref="IFileSystemWatcher"/> class, given the specified directory and type of files to monitor, which acts as a wrapper for a FileSystemWatcher
2323
/// </summary>
2424
/// <param name="path">The directory to monitor, in standard or Universal Naming Convention (UNC) notation.</param>
2525
/// <param name="filter">The type of files to watch. For example, "*.txt" watches for changes to all text files.</param>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#if !FEATURE_SUPPORTED_OS_ATTRIBUTE
2+
namespace System.Runtime.Versioning
3+
{
4+
[AttributeUsage(AttributeTargets.All)]
5+
internal class SupportedOSPlatformAttribute : Attribute
6+
{
7+
public SupportedOSPlatformAttribute(string _)
8+
{
9+
}
10+
}
11+
}
12+
#endif
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
using System;
2+
using System.Runtime.CompilerServices;
3+
4+
[assembly: CLSCompliant(true)]
5+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<AssemblyName>TestableIO.System.IO.Abstractions</AssemblyName>
4+
<RootNamespace>System.IO.Abstractions</RootNamespace>
5+
<Description>A set of abstractions to help make file system interactions testable.</Description>
6+
<TargetFrameworks>net6.0;net5.0;netstandard2.1;netstandard2.0;net461</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" Version="5.0.0" />
11+
</ItemGroup>
12+
<ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">
13+
<PackageReference Include="System.IO.FileSystem.AccessControl" Version="5.0.0" />
14+
</ItemGroup>
15+
<ItemGroup>
16+
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies.net461" Version="1.0.3">
17+
<PrivateAssets>all</PrivateAssets>
18+
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
19+
</PackageReference>
20+
</ItemGroup>
21+
<ItemGroup>
22+
<None Include="..\..\images\icon_256x256.png" Pack="true" PackagePath="\" />
23+
</ItemGroup>
24+
</Project>

tests/System.IO.Abstractions.Tests/System.IO.Abstractions.Tests.csproj tests/TestableIO.System.IO.Abstractions.Wrappers.Tests/TestableIO.System.IO.Abstractions.Wrappers.Tests.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<IsTestable>true</IsTestable>
1010
</PropertyGroup>
1111
<ItemGroup>
12-
<ProjectReference Include="../../src/System.IO.Abstractions/System.IO.Abstractions.csproj" />
12+
<ProjectReference Include="..\..\src\TestableIO.System.IO.Abstractions.Wrappers\TestableIO.System.IO.Abstractions.Wrappers.csproj" />
1313
</ItemGroup>
1414
<ItemGroup>
1515
<PackageReference Include="coverlet.collector" Version="3.2.0">

0 commit comments

Comments
 (0)