diff --git a/.github/workflows/dotnetcore.yml b/.github/workflows/dotnetcore.yml index c28c5f9c..c7188406 100644 --- a/.github/workflows/dotnetcore.yml +++ b/.github/workflows/dotnetcore.yml @@ -12,9 +12,9 @@ jobs: - uses: actions/checkout@v1 - uses: actions/setup-dotnet@v1 with: - dotnet-version: 3.1.301 + dotnet-version: 3.1.302 - run: dotnet run -p src/build/build.csproj - uses: actions/upload-artifact@v2 with: - name: ${{ matrix.os }}-sharpcompress.nupkg + name: ${{ matrix.os }}-sharpcompress.*nupkg path: artifacts/* diff --git a/SharpCompress.sln b/SharpCompress.sln index c3482a53..5b033547 100644 --- a/SharpCompress.sln +++ b/SharpCompress.sln @@ -13,7 +13,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharpCompress", "src\SharpC EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharpCompress.Test", "tests\SharpCompress.Test\SharpCompress.Test.csproj", "{F2B1A1EB-0FA6-40D0-8908-E13247C7226F}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "build", "src\build\build.csproj", "{D4D613CB-5E94-47FB-85BE-B8423D20C545}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "build", "build\build.csproj", "{D4D613CB-5E94-47FB-85BE-B8423D20C545}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -40,6 +40,5 @@ Global GlobalSection(NestedProjects) = preSolution {FD19DDD8-72B2-4024-8665-0D1F7A2AA998} = {3C5BE746-03E5-4895-9988-0B57F162F86C} {F2B1A1EB-0FA6-40D0-8908-E13247C7226F} = {0F0901FF-E8D9-426A-B5A2-17C7F47C1529} - {D4D613CB-5E94-47FB-85BE-B8423D20C545} = {3C5BE746-03E5-4895-9988-0B57F162F86C} EndGlobalSection EndGlobal diff --git a/src/build/Program.cs b/build/Program.cs similarity index 100% rename from src/build/Program.cs rename to build/Program.cs diff --git a/src/build/build.csproj b/build/build.csproj similarity index 85% rename from src/build/build.csproj rename to build/build.csproj index 897e9515..989c80a8 100644 --- a/src/build/build.csproj +++ b/build/build.csproj @@ -7,7 +7,7 @@ - + diff --git a/global.json b/global.json index c120c811..acb1473a 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "3.1.301" + "version": "3.1.302" } } \ No newline at end of file diff --git a/src/SharpCompress/SharpCompress.csproj b/src/SharpCompress/SharpCompress.csproj index 96182cbe..d9cfb95a 100644 --- a/src/SharpCompress/SharpCompress.csproj +++ b/src/SharpCompress/SharpCompress.csproj @@ -2,9 +2,9 @@ SharpCompress - Pure C# Decompression/Compression en-US - 0.25.1 - 0.25.1 - 0.25.1 + 0.26.0 + 0.26.0 + 0.26.0 Adam Hathcock netstandard2.0;netstandard2.1;net46 netstandard2.0;netstandard2.1 diff --git a/tests/SharpCompress.Test/SharpCompress.Test.csproj b/tests/SharpCompress.Test/SharpCompress.Test.csproj index 47651102..ae2f0d90 100644 --- a/tests/SharpCompress.Test/SharpCompress.Test.csproj +++ b/tests/SharpCompress.Test/SharpCompress.Test.csproj @@ -15,7 +15,7 @@ - + diff --git a/tests/SharpCompress.Test/Tar/TarWriterTests.cs b/tests/SharpCompress.Test/Tar/TarWriterTests.cs index 4b0b2168..d2fb9646 100644 --- a/tests/SharpCompress.Test/Tar/TarWriterTests.cs +++ b/tests/SharpCompress.Test/Tar/TarWriterTests.cs @@ -1,4 +1,5 @@ using System.IO; +using System.Text; using SharpCompress.Common; using SharpCompress.Writers.Tar; using Xunit; @@ -16,19 +17,19 @@ namespace SharpCompress.Test.Tar [Fact] public void Tar_Writer() { - Write(CompressionType.None, "Tar.noEmptyDirs.tar", "Tar.noEmptyDirs.tar"); + Write(CompressionType.None, "Tar.noEmptyDirs.tar", "Tar.noEmptyDirs.tar", Encoding.GetEncoding(866)); } [Fact] public void Tar_BZip2_Writer() { - Write(CompressionType.BZip2, "Tar.noEmptyDirs.tar.bz2", "Tar.noEmptyDirs.tar.bz2"); + Write(CompressionType.BZip2, "Tar.noEmptyDirs.tar.bz2", "Tar.noEmptyDirs.tar.bz2", Encoding.GetEncoding(866)); } [Fact] public void Tar_LZip_Writer() { - Write(CompressionType.LZip, "Tar.noEmptyDirs.tar.lz", "Tar.noEmptyDirs.tar.lz"); + Write(CompressionType.LZip, "Tar.noEmptyDirs.tar.lz", "Tar.noEmptyDirs.tar.lz", Encoding.GetEncoding(866)); } [Fact] diff --git a/tests/SharpCompress.Test/TestBase.cs b/tests/SharpCompress.Test/TestBase.cs index 3267e325..3f310956 100644 --- a/tests/SharpCompress.Test/TestBase.cs +++ b/tests/SharpCompress.Test/TestBase.cs @@ -188,9 +188,9 @@ namespace SharpCompress.Test Assert.Equal(fi1.Attributes, fi2.Attributes); } - protected void CompareArchivesByPath(string file1, string file2) { + protected void CompareArchivesByPath(string file1, string file2, Encoding encoding = null) { ReaderOptions readerOptions = new ReaderOptions { LeaveStreamOpen = false }; - readerOptions.ArchiveEncoding.Default = Encoding.GetEncoding(866); + readerOptions.ArchiveEncoding.Default = encoding ?? Encoding.Default; //don't compare the order. OS X reads files from the file system in a different order therefore makes the archive ordering different var archive1Entries = new List(); diff --git a/tests/SharpCompress.Test/WriterTests.cs b/tests/SharpCompress.Test/WriterTests.cs index 85b65c2c..b4e2d738 100644 --- a/tests/SharpCompress.Test/WriterTests.cs +++ b/tests/SharpCompress.Test/WriterTests.cs @@ -16,15 +16,15 @@ namespace SharpCompress.Test this.type = type; } - protected void Write(CompressionType compressionType, string archive, string archiveToVerifyAgainst) + protected void Write(CompressionType compressionType, string archive, string archiveToVerifyAgainst, Encoding encoding = null) { using (Stream stream = File.OpenWrite(Path.Combine(SCRATCH2_FILES_PATH, archive))) { WriterOptions writerOptions = new WriterOptions(compressionType) { LeaveStreamOpen = true, }; - - writerOptions.ArchiveEncoding.Default = Encoding.GetEncoding(866); + + writerOptions.ArchiveEncoding.Default = encoding ?? Encoding.Default; using (var writer = WriterFactory.Open(stream, type, writerOptions)) { @@ -37,8 +37,8 @@ namespace SharpCompress.Test using (Stream stream = File.OpenRead(Path.Combine(SCRATCH2_FILES_PATH, archive))) { ReaderOptions readerOptions = new ReaderOptions(); - - readerOptions.ArchiveEncoding.Default = Encoding.GetEncoding(866); + + readerOptions.ArchiveEncoding.Default = encoding ?? Encoding.Default; using (var reader = ReaderFactory.Open(new NonDisposingStream(stream), readerOptions)) { diff --git a/tests/SharpCompress.Test/Zip/ZipArchiveTests.cs b/tests/SharpCompress.Test/Zip/ZipArchiveTests.cs index 8493289d..f38c8c8e 100644 --- a/tests/SharpCompress.Test/Zip/ZipArchiveTests.cs +++ b/tests/SharpCompress.Test/Zip/ZipArchiveTests.cs @@ -168,7 +168,7 @@ namespace SharpCompress.Test.Zip archive.SaveTo(scratchPath, writerOptions); } - CompareArchivesByPath(modified, scratchPath); + CompareArchivesByPath(modified, scratchPath, Encoding.GetEncoding(866)); } [Fact] @@ -188,7 +188,7 @@ namespace SharpCompress.Test.Zip archive.SaveTo(scratchPath, writerOptions); } - CompareArchivesByPath(modified, scratchPath); + CompareArchivesByPath(modified, scratchPath, Encoding.GetEncoding(866)); } [Fact] @@ -286,7 +286,7 @@ namespace SharpCompress.Test.Zip archive.SaveTo(scratchPath, writerOptions); } - CompareArchivesByPath(unmodified, scratchPath); + CompareArchivesByPath(unmodified, scratchPath, Encoding.GetEncoding(866)); Directory.Delete(SCRATCH_FILES_PATH, true); }