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

Add System.IO.Hashing ref csproj #77856

Merged
merged 2 commits into from
Nov 4, 2022
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
1 change: 1 addition & 0 deletions eng/ApiCompatExcludeAttributes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ T:System.Diagnostics.CodeAnalysis.MemberNotNullAttribute
T:System.Diagnostics.DebuggerGuidedStepThroughAttribute
T:System.Runtime.CompilerServices.EagerStaticClassConstructionAttribute
T:System.Runtime.CompilerServices.NativeIntegerAttribute
T:System.Runtime.CompilerServices.SkipLocalsInitAttribute
stephentoub marked this conversation as resolved.
Show resolved Hide resolved
9 changes: 9 additions & 0 deletions src/libraries/System.IO.Hashing/System.IO.Hashing.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Microsoft Visual Studio Solution File, Format Version 12.00
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestUtilities", "..\Common\tests\TestUtilities\TestUtilities.csproj", "{F94DE827-A426-45CB-AE6E-4E1C154B5386}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.IO.Hashing", "ref\System.IO.Hashing.csproj", "{259A1DB6-EF7E-4D45-96EF-035E0605BB55}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.IO.Hashing", "src\System.IO.Hashing.csproj", "{A078A4EB-27E8-42B1-BD44-3807732A4560}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.IO.Hashing.Tests", "tests\System.IO.Hashing.Tests.csproj", "{2E6DAC1B-9054-40AF-AF72-4C2DD7BD9294}"
Expand All @@ -9,6 +11,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LibraryImportGenerator", ".
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Interop.SourceGeneration", "..\System.Runtime.InteropServices\gen\Microsoft.Interop.SourceGeneration\Microsoft.Interop.SourceGeneration.csproj", "{A60C1BBE-8CD7-4B6A-AD3C-FF1209857C39}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ref", "ref", "{46BA9FAE-9204-455A-BB2D-518E5B5C3E4C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{1E78399D-326B-4C9F-B8A9-A7E684EEA349}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{F2826BE8-9FA1-40C8-8FD4-E98A4644733E}"
Expand All @@ -25,6 +29,10 @@ Global
{F94DE827-A426-45CB-AE6E-4E1C154B5386}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F94DE827-A426-45CB-AE6E-4E1C154B5386}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F94DE827-A426-45CB-AE6E-4E1C154B5386}.Release|Any CPU.Build.0 = Release|Any CPU
{259A1DB6-EF7E-4D45-96EF-035E0605BB55}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{259A1DB6-EF7E-4D45-96EF-035E0605BB55}.Debug|Any CPU.Build.0 = Debug|Any CPU
{259A1DB6-EF7E-4D45-96EF-035E0605BB55}.Release|Any CPU.ActiveCfg = Release|Any CPU
{259A1DB6-EF7E-4D45-96EF-035E0605BB55}.Release|Any CPU.Build.0 = Release|Any CPU
{A078A4EB-27E8-42B1-BD44-3807732A4560}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A078A4EB-27E8-42B1-BD44-3807732A4560}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A078A4EB-27E8-42B1-BD44-3807732A4560}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand All @@ -48,6 +56,7 @@ Global
GlobalSection(NestedProjects) = preSolution
{F94DE827-A426-45CB-AE6E-4E1C154B5386} = {1E78399D-326B-4C9F-B8A9-A7E684EEA349}
{2E6DAC1B-9054-40AF-AF72-4C2DD7BD9294} = {1E78399D-326B-4C9F-B8A9-A7E684EEA349}
{259A1DB6-EF7E-4D45-96EF-035E0605BB55} = {46BA9FAE-9204-455A-BB2D-518E5B5C3E4C}
{A078A4EB-27E8-42B1-BD44-3807732A4560} = {F2826BE8-9FA1-40C8-8FD4-E98A4644733E}
{0EBDAC1E-7132-406B-96B4-F8875A689C99} = {26D7BA38-5978-4423-814C-0C8D9F38C1A3}
{A60C1BBE-8CD7-4B6A-AD3C-FF1209857C39} = {26D7BA38-5978-4423-814C-0C8D9F38C1A3}
Expand Down
15 changes: 15 additions & 0 deletions src/libraries/System.IO.Hashing/ref/System.IO.Hashing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,26 @@ public void Append(System.IO.Stream stream) { }
public byte[] GetHashAndReset() { throw null; }
public int GetHashAndReset(System.Span<byte> destination) { throw null; }
protected virtual void GetHashAndResetCore(System.Span<byte> destination) { }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.ObsoleteAttribute("Use GetCurrentHash() to retrieve the computed hash code.", true)]
public override int GetHashCode() { throw null; }
public abstract void Reset();
public bool TryGetCurrentHash(System.Span<byte> destination, out int bytesWritten) { throw null; }
public bool TryGetHashAndReset(System.Span<byte> destination, out int bytesWritten) { throw null; }
}
public sealed partial class XxHash3 : System.IO.Hashing.NonCryptographicHashAlgorithm
{
public XxHash3() : base (default(int)) { }
public XxHash3(long seed) : base (default(int)) { }
public override void Append(System.ReadOnlySpan<byte> source) { }
protected override void GetCurrentHashCore(System.Span<byte> destination) { }
public static byte[] Hash(byte[] source) { throw null; }
public static byte[] Hash(byte[] source, long seed) { throw null; }
public static byte[] Hash(System.ReadOnlySpan<byte> source, long seed = (long)0) { throw null; }
public static int Hash(System.ReadOnlySpan<byte> source, System.Span<byte> destination, long seed = (long)0) { throw null; }
public override void Reset() { }
public static bool TryHash(System.ReadOnlySpan<byte> source, System.Span<byte> destination, out int bytesWritten, long seed = (long)0) { throw null; }
}
public sealed partial class XxHash32 : System.IO.Hashing.NonCryptographicHashAlgorithm
{
public XxHash32() : base (default(int)) { }
Expand Down
14 changes: 14 additions & 0 deletions src/libraries/System.IO.Hashing/ref/System.IO.Hashing.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>$(NetCoreAppCurrent);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum)</TargetFrameworks>
<NoWarn>$(NoWarn);CS0809</NoWarn>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: add an xml comment to explain why this NoWarn is required.

</PropertyGroup>

<ItemGroup>
<Compile Include="System.IO.Hashing.cs" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'">
<PackageReference Include="System.Memory" Version="$(SystemMemoryVersion)" />
</ItemGroup>
</Project>