Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: split project in wrapper and abstraction #905

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions System.IO.Abstractions.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30128.74
# Visual Studio Version 17
VisualStudioVersion = 17.3.32825.248
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{5F3BDA62-8052-4C37-97A0-94354AA971B0}"
ProjectSection(SolutionItems) = preProject
Expand All @@ -19,7 +19,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.IO.Abstractions.Benc
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{BCEC61BD-4941-41EC-975A-ACEFC7AC1780}"
EndProject
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}"
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}"
EndProject
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}"
EndProject
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}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "images", "images", "{F781892B-7C5D-4C8D-8D3D-3E9E207D686D}"
ProjectSection(SolutionItems) = preProject
Expand Down Expand Up @@ -52,11 +56,20 @@ Global
{7105D748-1253-409F-A624-4879412EF3C2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7105D748-1253-409F-A624-4879412EF3C2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7105D748-1253-409F-A624-4879412EF3C2}.Release|Any CPU.Build.0 = Release|Any CPU
{1B8388D2-58A7-47B8-89EC-C5A94A0FEED5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1B8388D2-58A7-47B8-89EC-C5A94A0FEED5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1B8388D2-58A7-47B8-89EC-C5A94A0FEED5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1B8388D2-58A7-47B8-89EC-C5A94A0FEED5}.Release|Any CPU.Build.0 = Release|Any CPU
{3698BB93-B031-4140-BAEF-D3480A94F531}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3698BB93-B031-4140-BAEF-D3480A94F531}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3698BB93-B031-4140-BAEF-D3480A94F531}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3698BB93-B031-4140-BAEF-D3480A94F531}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{20B02738-952A-40F5-9C10-E2F83013E9FC} = {BCEC61BD-4941-41EC-975A-ACEFC7AC1780}
{7105D748-1253-409F-A624-4879412EF3C2} = {BCEC61BD-4941-41EC-975A-ACEFC7AC1780}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
Expand Down
12 changes: 2 additions & 10 deletions src/System.IO.Abstractions/System.IO.Abstractions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,9 @@
<TargetFrameworks>net6.0;net5.0;netstandard2.1;netstandard2.0;net461</TargetFrameworks>
<PackageIcon>icon_256x256.png</PackageIcon>
</PropertyGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.1' OR '$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="System.IO.FileSystem.AccessControl" Version="5.0.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">
<PackageReference Include="System.IO.FileSystem.AccessControl" Version="5.0.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies.net461" Version="1.0.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<ProjectReference Include="..\TestableIO.System.IO.Abstractions\TestableIO.System.IO.Abstractions.csproj" />
<ProjectReference Include="..\TestableIO.System.IO.Abstractions.Wrappers\TestableIO.System.IO.Abstractions.Wrappers.csproj" />
</ItemGroup>
<ItemGroup>
<None Include="..\..\images\icon_256x256.png" Pack="true" PackagePath="\" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AssemblyName>TestableIO.System.IO.Abstractions.Wrappers</AssemblyName>
<RootNamespace>System.IO.Abstractions</RootNamespace>
<Description>A set of abstractions to help make file system interactions testable.</Description>
<TargetFrameworks>net6.0;net5.0;netstandard2.1;netstandard2.0;net461</TargetFrameworks>
<PackageIcon>icon_256x256.png</PackageIcon>
</PropertyGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.1' OR '$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="System.IO.FileSystem.AccessControl" Version="5.0.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">
<PackageReference Include="System.IO.FileSystem.AccessControl" Version="5.0.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies.net461" Version="1.0.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<None Include="..\..\images\icon_256x256.png" Pack="true" PackagePath="\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\TestableIO.System.IO.Abstractions\TestableIO.System.IO.Abstractions.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace System.IO.Abstractions
public interface IDirectoryInfoFactory
{
/// <summary>
/// Initializes a new instance of the <see cref="DirectoryInfoBase"/> class, which acts as a wrapper for a directory path.
/// Initializes a new instance of the <see cref="IDirectoryInfo"/> class, which acts as a wrapper for a directory path.
/// </summary>
/// <param name="directoryName">The fully qualified name of the new directory, or the relative directory name.</param>
IDirectoryInfo FromDirectoryName(string directoryName);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
namespace System.IO.Abstractions
{
/// <summary>
/// A factory to create all <see cref="DriveInfoBase"/> for a <see cref="IFileSystem"/>.
/// A factory to create all <see cref="IDriveInfo"/> for a <see cref="IFileSystem"/>.
/// </summary>
public interface IDriveInfoFactory
{
/// <summary>
/// Retrieves the drive names of all logical drives on a computer.
/// </summary>
/// <returns>An array of type <see cref="DriveInfoBase"/> that represents the logical drives on a computer.</returns>
/// <returns>An array of type <see cref="IDriveInfo"/> that represents the logical drives on a computer.</returns>
IDriveInfo[] GetDrives();

/// <summary>
/// Initializes a new instance of the <see cref="DriveInfoBase"/> class, which acts as a wrapper for a logical drive.
/// Initializes a new instance of the <see cref="IDriveInfo"/> class, which acts as a wrapper for a logical drive.
/// </summary>
/// <param name="driveName">A valid drive path or drive letter.</param>
IDriveInfo FromDriveName(string driveName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
public interface IFileInfoFactory
{
/// <summary>
/// Initializes a new instance of the <see cref="FileInfoBase"/> class, which acts as a wrapper for a file path.
/// Initializes a new instance of the <see cref="IFileInfo"/> class, which acts as a wrapper for a file path.
/// </summary>
/// <param name="fileName">The fully qualified name of the new file, or the relative file name.</param>
IFileInfo FromFileName(string fileName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@
public interface IFileSystemWatcherFactory
{
/// <summary>
/// Initializes a new instance of the <see cref="FileSystemWatcherBase"/> class, which acts as a wrapper for a FileSystemWatcher
/// Initializes a new instance of the <see cref="IFileSystemWatcher"/> class, which acts as a wrapper for a FileSystemWatcher
/// </summary>
/// <returns></returns>
IFileSystemWatcher CreateNew();

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

/// <summary>
/// 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
/// 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
/// </summary>
/// <param name="path">The directory to monitor, in standard or Universal Naming Convention (UNC) notation.</param>
/// <param name="filter">The type of files to watch. For example, "*.txt" watches for changes to all text files.</param>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#if !FEATURE_SUPPORTED_OS_ATTRIBUTE
namespace System.Runtime.Versioning
{
[AttributeUsage(AttributeTargets.All)]
internal class SupportedOSPlatformAttribute : Attribute
{
public SupportedOSPlatformAttribute(string _)
{
}
}
}
#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
using System;
using System.Runtime.CompilerServices;

[assembly: CLSCompliant(true)]

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AssemblyName>TestableIO.System.IO.Abstractions</AssemblyName>
<RootNamespace>System.IO.Abstractions</RootNamespace>
<Description>A set of abstractions to help make file system interactions testable.</Description>
<TargetFrameworks>net6.0;net5.0;netstandard2.1;netstandard2.0;net461</TargetFrameworks>
<PackageIcon>icon_256x256.png</PackageIcon>
</PropertyGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.1' OR '$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="System.IO.FileSystem.AccessControl" Version="5.0.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">
<PackageReference Include="System.IO.FileSystem.AccessControl" Version="5.0.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies.net461" Version="1.0.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<None Include="..\..\images\icon_256x256.png" Pack="true" PackagePath="\" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<IsTestable>true</IsTestable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="../../src/System.IO.Abstractions/System.IO.Abstractions.csproj" />
<ProjectReference Include="..\..\src\TestableIO.System.IO.Abstractions.Wrappers\TestableIO.System.IO.Abstractions.Wrappers.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="coverlet.collector" Version="3.2.0">
Expand Down