Skip to content

Commit

Permalink
Target .net 8
Browse files Browse the repository at this point in the history
  • Loading branch information
xt0rted committed Apr 10, 2024
1 parent c309762 commit 7a2fae0
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 95 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,18 @@ jobs:

- name: Set up .NET
uses: xt0rted/setup-dotnet@v1.5.0
if: startsWith(matrix.os, 'macos') == false
with:
source-url: https://nuget.pkg.github.com/xt0rted/index.json
nuget_auth_token: ${{ secrets.GITHUB_TOKEN }}

- name: Set up .NET
uses: xt0rted/setup-dotnet@v1.5.0
if: startsWith(matrix.os, 'macos') == true
with:
source-url: https://nuget.pkg.github.com/xt0rted/index.json
nuget_auth_token: ${{ secrets.GITHUB_TOKEN }}
dotnet-version: |
3.1.x
5.0.x
6.0.x
8.0.x
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ jobs:
with:
source-url: https://nuget.pkg.github.com/xt0rted/index.json
nuget_auth_token: ${{ secrets.GITHUB_TOKEN }}
dotnet-version: |
3.1.x
5.0.x
6.0.x

- name: Get changelog entry
uses: mindsers/changelog-reader-action@v2.2.3
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

## Unreleased

### Added

- Added support for .NET 8

### Removed

- Dropped support for .NET Core 3.1
- Dropped support for .NET 5
- Dropped support for .NET 6

### Fixed

- Fixed console color output check
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
Expand Down
11 changes: 4 additions & 7 deletions global.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@
"version": "8.0.203"
},
"scripts": {
"clean": "dotnet rimraf artifacts .coverage",
"clean": "dotnet rimraf artifacts",
"clean:bin": "dotnet rimraf **/bin **/obj",

"prebuild": "dotnet r clean",
"build": "dotnet build",
"test": "dotnet test --no-build --logger \"trx\" --results-directory \"./.coverage\"",
"test:31": "dotnet r test -- --framework netcoreapp3.1",
"test:5": "dotnet r test -- --framework net5.0",
"test:6": "dotnet r test -- --framework net6.0",
"pack": "dotnet pack --no-build --output ./artifacts",
"test": "dotnet test",
"prepack": "dotnet r clean",
"pack": "dotnet pack --output ./artifacts",

"build:release": "dotnet r build -- --configuration Release",
"test:release": "dotnet r test -- --configuration Release",
Expand Down
10 changes: 3 additions & 7 deletions src/GlobPath.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ internal class GlobPath

[UnsupportedOSPlatform("windows")]
[SupportedOSPlatformGuard("windows5.1.2600")]
#if NETCOREAPP3_1
private readonly bool _isWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
#else
private readonly bool _isWindows = OperatingSystem.IsWindows();
#endif

private readonly IConsoleWriter _console;
private readonly IFileProvider _rootDirectory;
Expand Down Expand Up @@ -74,12 +70,12 @@ public void EnumerateFolderContents(

if (item.IsDirectory)
{
var directory = _fileSystem.DirectoryInfo.FromDirectoryName(item.PhysicalPath);
var directory = _fileSystem.DirectoryInfo.New(item.PhysicalPath);
RemoveDirectoryInfoItem(directory, preserveRoot, dryRun, cancellationToken);
}
else
{
var file = _fileSystem.FileInfo.FromFileName(item.PhysicalPath);
var file = _fileSystem.FileInfo.New(item.PhysicalPath);
RemoveFileSystemItem(file, dryRun);
}

Expand Down Expand Up @@ -116,7 +112,7 @@ public void EnumerateFolderContents(
/// <exception cref="IOException" />
public void RemoveDirectoryInfoItem(IDirectoryInfo directory, bool keepSelf, bool dryRun, CancellationToken cancellationToken)
{
if (directory is null) throw new ArgumentNullException(nameof(directory));
ArgumentNullException.ThrowIfNull(directory);

if (IsReparsePointLikeSymlink(directory))
{
Expand Down
13 changes: 0 additions & 13 deletions src/PathInternal.cs

This file was deleted.

42 changes: 0 additions & 42 deletions src/PlatformAttributes.cs

This file was deleted.

2 changes: 1 addition & 1 deletion src/RimRafCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public int Invoke(InvocationContext context)

public Task<int> InvokeAsync(InvocationContext context)
{
if (context is null) throw new ArgumentNullException(nameof(context));
ArgumentNullException.ThrowIfNull(context);

var verbose = context.ParseResult.GetValueForOption(ToolOptions.Verbose);
var dryRun = context.ParseResult.GetValueForOption(ToolOptions.DryRun);
Expand Down
6 changes: 1 addition & 5 deletions src/rimraf.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,7 @@

<ItemGroup>
<PackageReference Include="DotNet.Glob" Version="3.1.3" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Physical" Version="6.0.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.FileProviders.Physical" Version="8.0.0" />
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.1.635-beta">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
Expand Down
5 changes: 0 additions & 5 deletions test/TestHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ public static void LoadFileSystem(int depth, int files, int folders, string targ
}
}

#if NET6_0_OR_GREATER
private static void CreateFileSymbolicLink(string path, string pathToTarget)
=> File.CreateSymbolicLink(path, pathToTarget);
#else
private static void CreateFileSymbolicLink(string path, string pathToTarget)
=> Emet.FileSystems.FileSystem.CreateSymbolicLink(pathToTarget, path, Emet.FileSystems.FileType.File);
#endif
}
8 changes: 0 additions & 8 deletions test/Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,6 @@
<Using Include="Xunit" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1' ">
<PackageReference Include="Emet.FileSystems" Version="0.0.5" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net5.0' ">
<PackageReference Include="Emet.FileSystems" Version="0.0.5" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="FakeItEasy" Version="7.4.0" />
<PackageReference Include="FakeItEasy.Analyzer.CSharp" Version="6.1.1">
Expand Down

0 comments on commit 7a2fae0

Please sign in to comment.