Skip to content

Commit

Permalink
Merge branch 'main' into bugfix/815-relativeDirectoryPaths
Browse files Browse the repository at this point in the history
  • Loading branch information
fgreinacher authored Dec 5, 2023
2 parents cde5f4f + ef9d4d1 commit e16d3e5
Show file tree
Hide file tree
Showing 20 changed files with 90 additions and 26 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@ jobs:
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
3.1.x
5.0.x
6.0.x
7.0.x
8.0.x
- name: Run tests
run: dotnet test --collect:"XPlat Code Coverage" --logger "GitHubActions"
- name: Upload coverage
Expand All @@ -40,7 +41,7 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
- uses: actions/download-artifact@v3
with:
name: Code coverage ubuntu-latest
Expand All @@ -54,7 +55,7 @@ jobs:
name: Code coverage macos-latest
path: coverage-macos
- name: Generate coverage report
uses: danielpalme/ReportGenerator-GitHub-Action@5.1.26
uses: danielpalme/ReportGenerator-GitHub-Action@5.2.0
with:
reports: "**/coverage.cobertura.xml"
targetdir: "coverage-report"
Expand All @@ -75,7 +76,7 @@ jobs:
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
- name: Create packages
run: dotnet pack --configuration Release --output ./packages
- name: Upload a Build Artifact
Expand All @@ -101,7 +102,7 @@ jobs:
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
- uses: actions/download-artifact@v3
with:
name: NuGet packages
Expand Down
12 changes: 6 additions & 6 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageReadmeFile>README.md</PackageReadmeFile>
<DefineConstants Condition="'$(TargetFramework)' != 'net461'">$(DefineConstants);FEATURE_FILE_SYSTEM_ACL_EXTENSIONS</DefineConstants>
<DefineConstants Condition="'$(TargetFramework)' == 'net7.0' OR '$(TargetFramework)' == 'net6.0' OR '$(TargetFramework)' == 'net5.0' OR '$(TargetFramework)' == 'netcoreapp3.1' OR '$(TargetFramework)' == 'netstandard2.1'">$(DefineConstants);FEATURE_ASYNC_FILE;FEATURE_ENUMERATION_OPTIONS;FEATURE_ADVANCED_PATH_OPERATIONS;FEATURE_PATH_JOIN_WITH_SPAN;FEATURE_SPAN</DefineConstants>
<DefineConstants Condition="'$(TargetFramework)' == 'net7.0' OR '$(TargetFramework)' == 'net6.0' OR '$(TargetFramework)' == 'net5.0'">$(DefineConstants);FEATURE_FILE_MOVE_WITH_OVERWRITE;FEATURE_SUPPORTED_OS_ATTRIBUTE;FEATURE_FILE_SYSTEM_WATCHER_FILTERS;FEATURE_ENDS_IN_DIRECTORY_SEPARATOR;FEATURE_PATH_JOIN_WITH_PARAMS;FEATURE_PATH_JOIN_WITH_FOUR_PATHS</DefineConstants>
<DefineConstants Condition="'$(TargetFramework)' == 'net7.0' OR '$(TargetFramework)' == 'net6.0'">$(DefineConstants);FEATURE_FILE_SYSTEM_INFO_LINK_TARGET;FEATURE_CREATE_SYMBOLIC_LINK;FEATURE_FILESTREAM_OPTIONS</DefineConstants>
<DefineConstants Condition="'$(TargetFramework)' == 'net7.0'">$(DefineConstants);FEATURE_PATH_EXISTS;FEATURE_FILE_SYSTEM_WATCHER_WAIT_WITH_TIMESPAN;FEATURE_FILE_ATTRIBUTES_VIA_HANDLE;FEATURE_CREATE_TEMP_SUBDIRECTORY;FEATURE_READ_LINES_ASYNC;FEATURE_UNIX_FILE_MODE</DefineConstants>
<DefineConstants Condition="'$(TargetFramework)' == 'net8.0' OR '$(TargetFramework)' == 'net7.0' OR '$(TargetFramework)' == 'net6.0' OR '$(TargetFramework)' == 'net5.0' OR '$(TargetFramework)' == 'netcoreapp3.1' OR '$(TargetFramework)' == 'netstandard2.1'">$(DefineConstants);FEATURE_ASYNC_FILE;FEATURE_ENUMERATION_OPTIONS;FEATURE_ADVANCED_PATH_OPERATIONS;FEATURE_PATH_JOIN_WITH_SPAN;FEATURE_SPAN</DefineConstants>
<DefineConstants Condition="'$(TargetFramework)' == 'net8.0' OR '$(TargetFramework)' == 'net7.0' OR '$(TargetFramework)' == 'net6.0' OR '$(TargetFramework)' == 'net5.0'">$(DefineConstants);FEATURE_FILE_MOVE_WITH_OVERWRITE;FEATURE_SUPPORTED_OS_ATTRIBUTE;FEATURE_FILE_SYSTEM_WATCHER_FILTERS;FEATURE_ENDS_IN_DIRECTORY_SEPARATOR;FEATURE_PATH_JOIN_WITH_PARAMS;FEATURE_PATH_JOIN_WITH_FOUR_PATHS</DefineConstants>
<DefineConstants Condition="'$(TargetFramework)' == 'net8.0' OR '$(TargetFramework)' == 'net7.0' OR '$(TargetFramework)' == 'net6.0'">$(DefineConstants);FEATURE_FILE_SYSTEM_INFO_LINK_TARGET;FEATURE_CREATE_SYMBOLIC_LINK;FEATURE_FILESTREAM_OPTIONS</DefineConstants>
<DefineConstants Condition="'$(TargetFramework)' == 'net8.0' OR '$(TargetFramework)' == 'net7.0'">$(DefineConstants);FEATURE_PATH_EXISTS;FEATURE_FILE_SYSTEM_WATCHER_WAIT_WITH_TIMESPAN;FEATURE_FILE_ATTRIBUTES_VIA_HANDLE;FEATURE_CREATE_TEMP_SUBDIRECTORY;FEATURE_READ_LINES_ASYNC;FEATURE_UNIX_FILE_MODE</DefineConstants>
<DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE</DefineConstants>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Version="3.6.133">
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="SauceControl.InheritDoc" Version="1.3.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
<PackageReference Include="SauceControl.InheritDoc" Version="1.4.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "7.0.403",
"version": "8.0.100",
"rollForward": "latestMinor"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<AssemblyName>TestableIO.System.IO.Abstractions.TestingHelpers</AssemblyName>
<RootNamespace>System.IO.Abstractions.TestingHelpers</RootNamespace>
<Description>A set of pre-built mocks to help when testing file system interactions.</Description>
<TargetFrameworks>net7.0;net6.0;net5.0;netstandard2.1;netstandard2.0;net461</TargetFrameworks>
<TargetFrameworks>net8.0;net7.0;net6.0;net5.0;netstandard2.1;netstandard2.0;net461</TargetFrameworks>
<PackageIcon>icon_256x256.png</PackageIcon>
</PropertyGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<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>net7.0;net6.0;net5.0;netstandard2.1;netstandard2.0;net461</TargetFrameworks>
<TargetFrameworks>net8.0;net7.0;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'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
<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>net7.0;net6.0;net5.0;netstandard2.1;netstandard2.0;net461</TargetFrameworks>
<TargetFrameworks>net8.0;net7.0;net6.0;net5.0;netstandard2.1;netstandard2.0;net461</TargetFrameworks>
<PackageIcon>icon_256x256.png</PackageIcon>
<Nullable>enable</Nullable>
<LangVersion>preview</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies.net461" Version="1.0.3">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ public void SerializationBytes()

//Act
var memoryStream = new MemoryStream();
#pragma warning disable SYSLIB0011
var serializer = new Runtime.Serialization.Formatters.Binary.BinaryFormatter();

#pragma warning disable SYSLIB0011
serializer.Serialize(memoryStream, fileSystem);
memoryStream.Flush();
memoryStream.Position = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,9 @@ public void MockFileSystem_ByDefault_IsSerializable()
});
var memoryStream = new MemoryStream();

#pragma warning disable SYSLIB0011
var serializer = new Runtime.Serialization.Formatters.Binary.BinaryFormatter();

#pragma warning disable SYSLIB0011
serializer.Serialize(memoryStream, fileSystem);
#pragma warning restore SYSLIB0011

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -541,10 +541,10 @@ public void Serializable_works()
MockFileData data = new MockFileData("Text Contents");

//Act
#pragma warning disable SYSLIB0011
IFormatter formatter = new BinaryFormatter();
Stream stream = new MemoryStream();

#pragma warning disable SYSLIB0011
formatter.Serialize(stream, data);
#pragma warning restore SYSLIB0011

Expand All @@ -561,9 +561,9 @@ public void Serializable_can_deserialize()
//Act
MockFileData data = new MockFileData(textContentStr);

#pragma warning disable SYSLIB0011
IFormatter formatter = new BinaryFormatter();
Stream stream = new MemoryStream();
#pragma warning disable SYSLIB0011
formatter.Serialize(stream, data);

stream.Seek(0, SeekOrigin.Begin);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net7.0;net6.0;net5.0;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net8.0;net7.0;net6.0;net5.0;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks Condition="!$([MSBuild]::IsOsUnixLike())">$(TargetFrameworks);net461</TargetFrameworks>
<Description>The unit tests for our pre-built mocks</Description>
<AssemblyName>System.IO.Abstractions.TestingHelpers.Tests</AssemblyName>
Expand Down Expand Up @@ -32,8 +32,8 @@
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="Moq" Version="4.20.69" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Moq" Version="4.20.70" />
<PackageReference Include="nunit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ public ApiDiff(IEnumerable<string> extraMembers, IEnumerable<string> missingMemb
private const string snapshotSuffix = ".NET 6.0";
#elif NET7_0
private const string snapshotSuffix = ".NET 7.0";
#elif NET8_0
private const string snapshotSuffix = ".NET 8.0";
#else
#error Unknown target framework.
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ public void Is_Serializable()
var fileSystem = new FileSystem();
var memoryStream = new MemoryStream();

#pragma warning disable SYSLIB0011
var serializer = new Runtime.Serialization.Formatters.Binary.BinaryFormatter();

#pragma warning disable SYSLIB0011
serializer.Serialize(memoryStream, fileSystem);
#pragma warning restore SYSLIB0011

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net7.0;net6.0;net5.0;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net8.0;net7.0;net6.0;net5.0;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks Condition="!$([MSBuild]::IsOsUnixLike())">$(TargetFrameworks);net461</TargetFrameworks>
<Description>The unit tests for our the core abstractions</Description>
<AssemblyName>System.IO.Abstractions.Tests</AssemblyName>
Expand All @@ -17,8 +17,8 @@
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="Moq" Version="4.20.69" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Moq" Version="4.20.70" />
<PackageReference Include="nunit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="Snapshooter.NUnit" Version="0.13.0" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"ExtraMembers": [],
"MissingMembers": [
"System.Object GetLifetimeService()",
"System.Object InitializeLifetimeService()",
"Void .ctor(System.String)",
"Void GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"ExtraMembers": [],
"MissingMembers": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"ExtraMembers": [],
"MissingMembers": [
"System.IO.Abstractions.IDriveInfo[] GetDrives()",
"Void .ctor(System.String)"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"ExtraMembers": [],
"MissingMembers": [
"System.Object GetLifetimeService()",
"System.Object InitializeLifetimeService()",
"Void .ctor(System.String)",
"Void GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"ExtraMembers": [
"Void Dispose(Boolean)"
],
"MissingMembers": [
"System.EventHandler Disposed",
"System.Object GetLifetimeService()",
"System.Object InitializeLifetimeService()",
"Void .ctor()",
"Void .ctor(System.String)",
"Void .ctor(System.String, System.String)",
"Void add_Disposed(System.EventHandler)",
"Void remove_Disposed(System.EventHandler)"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"ExtraMembers": [],
"MissingMembers": [
"Microsoft.Win32.SafeHandles.SafeFileHandle OpenHandle(System.String, System.IO.FileMode, System.IO.FileAccess, System.IO.FileShare, System.IO.FileOptions, Int64)"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"ExtraMembers": [
"Char get_AltDirectorySeparatorChar()",
"Char get_DirectorySeparatorChar()",
"Char get_PathSeparator()",
"Char get_VolumeSeparatorChar()",
"Char[] get_InvalidPathChars()"
],
"MissingMembers": []
}

0 comments on commit e16d3e5

Please sign in to comment.