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

Update to support net48, net481, netstandard2.0, net6 and net8 #888

Merged
merged 6 commits into from
Jan 16, 2025
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
5 changes: 3 additions & 2 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
"isRoot": true,
"tools": {
"csharpier": {
"version": "0.28.1",
"version": "0.30.6",
"commands": [
"dotnet-csharpier"
]
],
"rollForward": false
}
}
}
16 changes: 8 additions & 8 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<Project>
<ItemGroup>
<PackageVersion Include="Bullseye" Version="5.0.0" />
<PackageVersion Include="FluentAssertions" Version="6.12.0" />
<PackageVersion Include="FluentAssertions" Version="7.0.0" />
<PackageVersion Include="Glob" Version="1.1.9" />
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageVersion Include="Mono.Posix.NETStandard" Version="1.0.0" />
<PackageVersion Include="SimpleExec" Version="12.0.0" />
<PackageVersion Include="System.Buffers" Version="4.6.0" />
<PackageVersion Include="System.Memory" Version="4.5.5" />
<PackageVersion Include="System.Memory" Version="4.6.0" />
<PackageVersion Include="System.Text.Encoding.CodePages" Version="8.0.0" />
<PackageVersion Include="xunit" Version="2.9.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
<PackageVersion Include="xunit.SkippableFact" Version="1.4.13" />
<PackageVersion Include="ZstdSharp.Port" Version="0.8.1" />
<PackageVersion Include="xunit" Version="2.9.3" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.0.1" />
<PackageVersion Include="xunit.SkippableFact" Version="1.5.23" />
<PackageVersion Include="ZstdSharp.Port" Version="0.8.4" />
<GlobalPackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
</ItemGroup>
</Project>
</Project>
2 changes: 1 addition & 1 deletion src/SharpCompress/Algorithms/Adler32.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public static int EvenReduceSum(Vector256<int> accumulator)
4,
3,
2,
1 // tap2
1, // tap2
};
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/SharpCompress/Common/ArchiveType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ public enum ArchiveType
Zip,
Tar,
SevenZip,
GZip
GZip,
}
2 changes: 1 addition & 1 deletion src/SharpCompress/Common/CompressionType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ public enum CompressionType
Reduce2,
Reduce3,
Reduce4,
Explode
Explode,
}
2 changes: 1 addition & 1 deletion src/SharpCompress/Common/Rar/Headers/Flags.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public enum HeaderType : byte
Sign,
NewSub,
EndArchive,
Crypt
Crypt,
}

internal static class HeaderCodeV
Expand Down
2 changes: 1 addition & 1 deletion src/SharpCompress/Common/SevenZip/SevenZipFilePart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ private CompressionType GetCompression()
K_LZMA or K_LZMA2 => CompressionType.LZMA,
K_PPMD => CompressionType.PPMd,
K_B_ZIP2 => CompressionType.BZip2,
_ => throw new NotImplementedException()
_ => throw new NotImplementedException(),
};
}

Expand Down
2 changes: 1 addition & 1 deletion src/SharpCompress/Common/Tar/Headers/EntryType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ internal enum EntryType : byte
LongName = (byte)'L',
SparseFile = (byte)'S',
VolumeHeader = (byte)'V',
GlobalExtendedHeader = (byte)'g'
GlobalExtendedHeader = (byte)'g',
}
2 changes: 1 addition & 1 deletion src/SharpCompress/Common/Tar/Headers/TarHeader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ private static long ReadAsciiInt64(byte[] buffer, int offset, int count)
(byte)' ',
(byte)' ',
(byte)' ',
(byte)' '
(byte)' ',
};

internal static bool checkChecksum(byte[] buf)
Expand Down
2 changes: 1 addition & 1 deletion src/SharpCompress/Common/Zip/Headers/HeaderFlags.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ internal enum HeaderFlags : ushort
EnhancedDeflate = 16,

//Bit 11: Language encoding flag
Efs = 2048
Efs = 2048,
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ internal enum ExtraDataType : ushort
// -Info-ZIP Unicode Path Extra Field
UnicodePathExtraField = 0x7075,
Zip64ExtendedInformationExtraField = 0x0001,
UnixTimeExtraField = 0x5455
UnixTimeExtraField = 0x5455,
}

internal class ExtraData
Expand Down Expand Up @@ -229,7 +229,7 @@ private enum RecordedTimeFlag
None = 0,
LastModified = 1,
LastAccessed = 2,
Created = 4
Created = 4,
}
}

Expand All @@ -238,11 +238,14 @@ internal static class LocalEntryHeaderExtraFactory
internal static ExtraData Create(ExtraDataType type, ushort length, byte[] extraData) =>
type switch
{
ExtraDataType.UnicodePathExtraField
=> new ExtraUnicodePathExtraField(type, length, extraData),
ExtraDataType.Zip64ExtendedInformationExtraField
=> new Zip64ExtendedInformationExtraField(type, length, extraData),
ExtraDataType.UnicodePathExtraField => new ExtraUnicodePathExtraField(
type,
length,
extraData
),
ExtraDataType.Zip64ExtendedInformationExtraField =>
new Zip64ExtendedInformationExtraField(type, length, extraData),
ExtraDataType.UnixTimeExtraField => new UnixTimeExtraField(type, length, extraData),
_ => new ExtraData(type, length, extraData)
_ => new ExtraData(type, length, extraData),
};
}
2 changes: 1 addition & 1 deletion src/SharpCompress/Common/Zip/Headers/ZipHeaderType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ internal enum ZipHeaderType
DirectoryEnd,
Split,
Zip64DirectoryEnd,
Zip64DirectoryEndLocator
Zip64DirectoryEndLocator,
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace SharpCompress.Common.Zip;
internal enum CryptoMode
{
Encrypt,
Decrypt
Decrypt,
}

internal class PkwareTraditionalCryptoStream : Stream
Expand Down
2 changes: 1 addition & 1 deletion src/SharpCompress/Common/Zip/WinzipAesKeySize.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ internal enum WinzipAesKeySize
{
KeySize128 = 1,
KeySize192 = 2,
KeySize256 = 3
KeySize256 = 3,
}
2 changes: 1 addition & 1 deletion src/SharpCompress/Common/Zip/ZipCompressionMethod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ internal enum ZipCompressionMethod
ZStd = 93,
Xz = 95,
PPMd = 98,
WinzipAes = 0x63 //http://www.winzip.com/aes_info.htm
WinzipAes = 0x63, //http://www.winzip.com/aes_info.htm
}
2 changes: 1 addition & 1 deletion src/SharpCompress/Common/Zip/ZipEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ internal ZipEntry(ZipFilePart? filePart)
ZipCompressionMethod.Reduce3 => CompressionType.Reduce3,
ZipCompressionMethod.Reduce4 => CompressionType.Reduce4,
ZipCompressionMethod.Explode => CompressionType.Explode,
_ => CompressionType.Unknown
_ => CompressionType.Unknown,
};

public override long Crc => _filePart?.Header.Crc ?? 0;
Expand Down
2 changes: 1 addition & 1 deletion src/SharpCompress/Compressors/BZip2/BZip2Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,6 @@ internal class BZip2Constants
858,
364,
936,
638
638,
};
}
2 changes: 1 addition & 1 deletion src/SharpCompress/Compressors/BZip2/CBZip2OutputStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1829,7 +1829,7 @@ because the number of elems to sort is
88573,
265720,
797161,
2391484
2391484,
};

private void AllocateCompressStructures()
Expand Down
2 changes: 1 addition & 1 deletion src/SharpCompress/Compressors/BZip2/CRC.cs
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ internal class CRC
unchecked((int)0xbcb4666d),
unchecked((int)0xb8757bda),
unchecked((int)0xb5365d03),
unchecked((int)0xb1f740b4)
unchecked((int)0xb1f740b4),
};

public CRC() => InitialiseCRC();
Expand Down
2 changes: 1 addition & 1 deletion src/SharpCompress/Compressors/CompressionMode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ namespace SharpCompress.Compressors;
public enum CompressionMode
{
Compress = 0,
Decompress = 1
Decompress = 1,
}
14 changes: 7 additions & 7 deletions src/SharpCompress/Compressors/Deflate/DeflateManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ internal sealed partial class DeflateManager
5,
5,
5,
0
0,
};

// extra bits for each distance code
Expand Down Expand Up @@ -141,22 +141,22 @@ internal sealed partial class DeflateManager
12,
12,
13,
13
13,
};

internal enum BlockState
{
NeedMore = 0, // block not completed, need more input or more output
BlockDone, // block flush performed
FinishStarted, // finish started, need only more output at next deflate
FinishDone // finish done, accept no more input or output
FinishDone, // finish done, accept no more input or output
}

internal enum DeflateFlavor
{
Store,
Fast,
Slow
Slow,
}

private const int MEM_LEVEL_MAX = 9;
Expand Down Expand Up @@ -214,7 +214,7 @@ static Config() =>
new Config(8, 16, 128, 128, DeflateFlavor.Slow),
new Config(8, 32, 128, 256, DeflateFlavor.Slow),
new Config(32, 128, 258, 1024, DeflateFlavor.Slow),
new Config(32, 258, 258, 4096, DeflateFlavor.Slow)
new Config(32, 258, 258, 4096, DeflateFlavor.Slow),
};

private static readonly Config[] Table;
Expand All @@ -233,7 +233,7 @@ static Config() =>
"insufficient memory",
"buffer error",
"incompatible version",
""
"",
};

// preset dictionary flag in zlib header
Expand Down Expand Up @@ -1793,7 +1793,7 @@ private void SetDeflater() =>
DeflateFlavor.Store => DeflateNone,
DeflateFlavor.Fast => DeflateFast,
DeflateFlavor.Slow => DeflateSlow,
_ => DeflateFunction
_ => DeflateFunction,
};

internal int SetParams(CompressionLevel level, CompressionStrategy strategy)
Expand Down
2 changes: 1 addition & 1 deletion src/SharpCompress/Compressors/Deflate/FlushType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ public enum FlushType
Full,

/// <summary>Signals the end of the compression/decompression stream.</summary>
Finish
Finish,
}
12 changes: 6 additions & 6 deletions src/SharpCompress/Compressors/Deflate/InfTree.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1615,7 +1615,7 @@ internal sealed class InfTree
79,
0,
9,
255
255,
};

//UPGRADE_NOTE: Final was removed from the declaration of 'fixed_td'. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'"
Expand Down Expand Up @@ -1716,7 +1716,7 @@ internal sealed class InfTree
193,
192,
5,
24577
24577,
};

// Tables for deflate from PKZIP's appnote.txt.
Expand Down Expand Up @@ -1753,7 +1753,7 @@ internal sealed class InfTree
227,
258,
0,
0
0,
};

// see note #13 above about 258
Expand Down Expand Up @@ -1790,7 +1790,7 @@ internal sealed class InfTree
5,
0,
112,
112
112,
};

//UPGRADE_NOTE: Final was removed from the declaration of 'cpdist'. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'"
Expand Down Expand Up @@ -1825,7 +1825,7 @@ internal sealed class InfTree
8193,
12289,
16385,
24577
24577,
};

//UPGRADE_NOTE: Final was removed from the declaration of 'cpdext'. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'"
Expand Down Expand Up @@ -1860,7 +1860,7 @@ internal sealed class InfTree
12,
12,
13,
13
13,
};

// If BMAX needs to be larger than 16, then h and x[] should be uLong.
Expand Down
8 changes: 4 additions & 4 deletions src/SharpCompress/Compressors/Deflate/Inflate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ internal sealed class InflateBlocks
2,
14,
1,
15
15,
};

internal ZlibCodec _codec; // pointer back to this zlib stream
Expand Down Expand Up @@ -815,7 +815,7 @@ private enum InflateBlockMode
CODES = 6, // processing fixed or dynamic block
DRY = 7, // output remaining window bytes
DONE = 8, // finished last block, done
BAD = 9 // ot a data error--stuck here
BAD = 9, // ot a data error--stuck here
}

#endregion
Expand All @@ -842,7 +842,7 @@ internal static class InternalInflateConstants
0x00001fff,
0x00003fff,
0x00007fff,
0x0000ffff
0x0000ffff,
};
}

Expand Down Expand Up @@ -2054,7 +2054,7 @@ private enum InflateManagerMode
CHECK2 = 10, // two check bytes to go
CHECK1 = 11, // one check byte to go
DONE = 12, // finished check, done
BAD = 13 // got an error--stay here
BAD = 13, // got an error--stay here
}

#endregion
Expand Down
Loading
Loading