Skip to content

Commit

Permalink
Remove Microsoft.IO.Redist. (#58359)
Browse files Browse the repository at this point in the history
* Remove the Microsoft.IO.Redist package.

* Remove all conditional compilation directives with MS_IO_REDIST.

Co-authored-by: Jeff Handley <[email protected]>
  • Loading branch information
teo-tsirpanis and jeffhandley authored Oct 13, 2021
1 parent 082bb6c commit 09c1a1f
Show file tree
Hide file tree
Showing 33 changed files with 3 additions and 716 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@
using System.IO;
using System.Text;

#if MS_IO_REDIST
namespace Microsoft.IO
#else
namespace System.IO
#endif
{
internal static partial class FileSystem
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@
using System.IO;
using System.Text;

#if MS_IO_REDIST
namespace Microsoft.IO
#else
namespace System.IO
#endif
{
internal static partial class FileSystem
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@

using System.Diagnostics;

#if MS_IO_REDIST
using Microsoft.IO;
#endif

namespace System.IO
{
/// <summary>Contains internal path helpers that are shared between many projects.</summary>
Expand All @@ -28,11 +24,7 @@ internal static bool IsCaseSensitive
{
get
{
#if MS_IO_REDIST
return false; // Windows is always case-insensitive
#else
return !(OperatingSystem.IsWindows() || OperatingSystem.IsMacOS() || OperatingSystem.IsIOS() || OperatingSystem.IsTvOS() || OperatingSystem.IsWatchOS());
#endif
}
}
}
Expand Down
9 changes: 0 additions & 9 deletions src/libraries/Common/src/System/IO/PathInternal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,8 @@ internal static partial class PathInternal
/// </summary>
internal static bool StartsWithDirectorySeparator(ReadOnlySpan<char> path) => path.Length > 0 && IsDirectorySeparator(path[0]);

#if MS_IO_REDIST
internal static string EnsureTrailingSeparator(string path)
=> EndsInDirectorySeparator(path) ? path : path + DirectorySeparatorCharAsString;
#else
internal static string EnsureTrailingSeparator(string path)
=> EndsInDirectorySeparator(path.AsSpan()) ? path : path + DirectorySeparatorCharAsString;
#endif

internal static bool IsRoot(ReadOnlySpan<char> path)
=> path.Length == GetRootLength(path);
Expand Down Expand Up @@ -248,10 +243,6 @@ internal static bool EndsInDirectorySeparator(ReadOnlySpan<char> path) =>

internal static string GetLinkTargetFullPath(string path, string pathToTarget)
=> IsPartiallyQualified(pathToTarget.AsSpan()) ?
#if MS_IO_REDIST
Path.Combine(Path.GetDirectoryName(path), pathToTarget) : pathToTarget;
#else
Path.Join(Path.GetDirectoryName(path.AsSpan()), pathToTarget.AsSpan()) : pathToTarget;
#endif
}
}
42 changes: 0 additions & 42 deletions src/libraries/Microsoft.IO.Redist/Microsoft.IO.Redist.sln

This file was deleted.

Loading

0 comments on commit 09c1a1f

Please sign in to comment.