-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## [1.3.9] - 2024-12-18 ### Changed * package: remove contributors from package.json * package: set the minimum Unity version to 2021.3.45 * api: change the accessor of test classes to internal * doc: improve the API documentation of ZipUtility * doc: update example APIs in the manual documentation * refactor: rename editor test assembly to Unity.SharpZipLib.Editor.Tests
- Loading branch information
Unity Technologies
committed
Dec 18, 2024
1 parent
7628720
commit 7d02af3
Showing
32 changed files
with
2,864 additions
and
2,773 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"timestamp":1734595553,"signature":"iKGqWl3fJyULiSStmzV0yYzOiMslJCdk2fzAEqiIjhvnhXSfUn9lAx8gYp+T6U/0ASEurlt2LCPhyp/Z4xDk+4xSb0Y2GCr9nuO7pOmLvYLo9G3i3J3lJmaXm3x85TdBX9U6Tytp/x6eP3bPcStltqZ4NKAbuN9XjuwjUKp/QE2Yf1lGBnUr/KviReQLwKjt9go8yMeO+UhaYRVaxlw2GMqeo8b1cmOinhDFAb8h1j9W7RemQIDuwKfSA3pDbPsKqH2D+kCGuNBN6540H271y+ziTGc/myOWaR5q32kfi9DSa/3uIbm0Kkm7pgdeV1d3ol0cptpySd7v0iLjxIhUxWlmQPka8r4baAQTE8xRgmpqWlDh3Gg/XEpewA4Uvu26XEf+iuMShVPobKGcA2FNKGcigVduxXGcy2wuoZdr9s5KHz8QnZfgZz1/BtOIJxgTWK0M2YA/uwa0GeBdXQEqpSbI8ZRQrDiSGSclTzuTlEX2Mu2WuME3vFIY/fQsmRqn","publicKey":"LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQm9qQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FZOEFNSUlCaWdLQ0FZRUFzdUhXYUhsZ0I1cVF4ZEJjTlJKSAordHR4SmoxcVY1NTdvMlZaRE1XaXhYRVBkRTBEMVFkT1JIRXNSS1RscmplUXlERU83ZlNQS0ZwZ1A3MU5TTnJCCkFHM2NFSU45aHNQVDhOVmllZmdWem5QTkVMenFkVmdEbFhpb2VpUnV6OERKWFgvblpmU1JWKytwbk9ySTRibG4KS0twelJlNW14OTc1SjhxZ1FvRktKT0NNRlpHdkJMR2MxSzZZaEIzOHJFODZCZzgzbUovWjBEYkVmQjBxZm13cgo2ZDVFUXFsd0E5Y3JZT1YyV1VpWXprSnBLNmJZNzRZNmM1TmpBcEFKeGNiaTFOaDlRVEhUcU44N0ZtMDF0R1ZwCjVNd1pXSWZuYVRUemEvTGZLelR5U0pka0tldEZMVGdkYXpMYlpzUEE2aHBSK0FJRTJhc0tLTi84UUk1N3UzU2cKL2xyMnZKS1IvU2l5eEN1Q20vQWJkYnJMbXk0WjlSdm1jMGdpclA4T0lLQWxBRWZ2TzV5Z2hSKy8vd1RpTFlzUQp1SllDM0V2UE16ZGdKUzdGR2FscnFLZzlPTCsxVzROY05yNWdveVdSUUJ0cktKaWlTZEJVWmVxb0RvSUY5NHpCCndGbzJJT1JFdXFqcU51M3diMWZIM3p1dGdtalFra3IxVjJhd3hmcExLWlROQWdNQkFBRT0KLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0tCg"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,6 @@ Based on the used Unity version, please fellow the following steps to install `c | |
![](images/PackageManager.png) | ||
|
||
1. Type in `com.unity.sharp-zip-lib` and click the **Add** button. | ||
1. Type in `com.unity.sharp-zip-lib` and click the **Add** button. | ||
We can also specify a particular version by appending `@<version>`, for example: `[email protected]` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
SharpZipLib copyright © 2024 Unity Technologies ApS | ||
|
||
Licensed under the Unity Companion License for Unity-dependent projects--see [Unity Companion License](http://www.unity3d.com/legal/licenses/Unity_Companion_License). | ||
Licensed under the Unity Companion License for Unity-dependent projects--see [Unity Companion License](http://www.unity3d.com/legal/licenses/Unity_Companion_License). | ||
|
||
Unless expressly provided otherwise, the Software under this license is made available strictly on an “AS IS” BASIS WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. Please review the license for details on these and other terms and conditions. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,66 @@ | ||
|
||
# Latest official docs | ||
- [English](https://docs.unity3d.com/Packages/com.unity.sharp-zip-lib@latest) | ||
|
||
[![](https://badge-proxy.cds.internal.unity3d.com/78081939-b2a0-4fc9-bebf-901b49fd954c)](https://badges.cds.internal.unity3d.com/packages/com.unity.sharp-zip-lib/build-info?branch=master&testWorkflow=package-isolation) | ||
[![](https://badge-proxy.cds.internal.unity3d.com/faf61743-4d21-479c-b01c-ab63561e27d9)](https://badges.cds.internal.unity3d.com/packages/com.unity.sharp-zip-lib/dependencies-info?branch=master&testWorkflow=updated-dependencies) | ||
[![](https://badge-proxy.cds.internal.unity3d.com/e5917bce-0357-4f49-a9c3-c356b9de832c)](https://badges.cds.internal.unity3d.com/packages/com.unity.sharp-zip-lib/dependants-info) | ||
[![](https://badge-proxy.cds.internal.unity3d.com/f2066c51-3423-424d-a58f-24a64683cf57)](https://badges.cds.internal.unity3d.com/packages/com.unity.sharp-zip-lib/warnings-info?branch=master) | ||
|
||
![ReleaseBadge](https://badge-proxy.cds.internal.unity3d.com/3b04c8fe-9005-4b46-848e-cb0199e49a2e) | ||
![ReleaseBadge](https://badge-proxy.cds.internal.unity3d.com/9a481f99-fa9b-4716-8409-69bb63fedbd7) | ||
# com.unity.sharp-zip-lib | ||
|
||
`com.unity.sharp-zip-lib` is a package that wraps [SharpZipLib](https://github.com/icsharpcode/SharpZipLib) to be used inside Unity, | ||
and provides various compression/uncompression utility functions. | ||
|
||
Currently, this package uses [SharpZipLib v1.3.3](https://github.com/icsharpcode/SharpZipLib/releases/tag/v1.3.3). | ||
Currently, this package uses [SharpZipLib v1.3.3](https://github.com/icsharpcode/SharpZipLib/releases/tag/v1.3.3). | ||
Please refer to the [installation](Documentation~/Installation.md) page to install this package. | ||
> The version numbering of this package itself and the version of SharpZipLib used in the package may look similar, | ||
|
||
> The version numbering of this package itself and the version of SharpZipLib used in the package may look similar, | ||
but they are not related. | ||
|
||
|
||
## How to Use | ||
|
||
* All [SharpZipLib](https://github.com/icsharpcode/SharpZipLib) APIs are available under `Unity.SharpZipLib` namespace. For example: | ||
* All [SharpZipLib](https://github.com/icsharpcode/SharpZipLib) APIs are available under `Unity.SharpZipLib` namespace. For example: | ||
```csharp | ||
using System.IO; | ||
using Unity.SharpZipLib.GZip; | ||
|
||
... | ||
public void Foo() { | ||
|
||
public void UseSharpZipLibAPIs() { | ||
MemoryStream ms = new MemoryStream(); | ||
GZipOutputStream outStream = new GZipOutputStream(ms); | ||
... | ||
} | ||
|
||
``` | ||
|
||
Please refer to the API documentation of the [SharpZipLib](https://github.com/icsharpcode/SharpZipLib) version used | ||
Please refer to the API documentation of the [SharpZipLib](https://github.com/icsharpcode/SharpZipLib) version used | ||
in this package for more details. | ||
|
||
* In addition, `com.unity.sharp-zip-lib` also provides additional utility APIs: | ||
* `ZipUtility.CompressFolderToZip()`: Compresses the files in the nominated folder, and creates a zip file on disk. | ||
* `ZipUtility.CompressFolderToZip()`: Creates a zip file on disk containing the contents of the nominated folder. | ||
* `ZipUtility.UncompressFromZip()`: Uncompress the contents of a zip file into the specified folder. | ||
|
||
As an example: | ||
```csharp | ||
|
||
[Test] | ||
public void Foo() { | ||
//Compress | ||
string tempZipPath = FileUtil.GetUniqueTempPathInProject(); | ||
string folderToCompress ="Bar"; | ||
ZipUtility.CompressFolderToZip(tempZipPath,null, folderToCompress); | ||
|
||
static void CompressAndUncompress() { | ||
//Compress | ||
string folderToCompress = "Assets"; | ||
string zipPath = Path.Combine(Application.temporaryCachePath, "UnityAssets.zip"); | ||
ZipUtility.CompressFolderToZip(zipPath,null, folderToCompress); | ||
Debug.Log($"{folderToCompress} folder compressed to: " + zipPath); | ||
|
||
//Uncompress | ||
string tempExtractPath = FileUtil.GetUniqueTempPathInProject(); | ||
Directory.CreateDirectory(tempExtractPath); | ||
ZipUtility.UncompressFromZip(tempZipPath, null, tempExtractPath); | ||
|
||
string extractPath = Path.Combine(Application.temporaryCachePath, "UnityAssetsExtracted"); | ||
ZipUtility.UncompressFromZip(zipPath, null, extractPath); | ||
Debug.Log($"Uncompressed to: " + extractPath); | ||
} | ||
``` | ||
|
||
|
||
## Supported Unity Versions | ||
|
||
* Unity `2018.4.36` or higher. | ||
* Unity `2021.3.45` or higher. | ||
## Steps to update SharpZipLib | ||
|
||
### Windows | ||
|
@@ -83,14 +77,16 @@ but they are not related. | |
1. Download the source from https://github.com/icsharpcode/SharpZipLib/releases | ||
1. Extract the source into a folder, e.g: `Src/SharpZipLib-1.3.3` | ||
1. Open "Developer Command Prompt for VS 2022" | ||
1. Execute `update_sharp-zip-lib.cmd [src_folder]` | ||
* E.g: `update_sharp-zip-lib.cmd Src/SharpZipLib-1.3.3` | ||
* Executing `update_sharp-zip-lib.cmd` without arguments will print the list of acceptable arguments | ||
1. Execute `update_sharp-zip-lib.cmd [src_folder]` | ||
* E.g: `update_sharp-zip-lib.cmd Src/SharpZipLib-1.3.3` | ||
* Executing `update_sharp-zip-lib.cmd` without arguments will print the list of acceptable arguments | ||
1. Open SharpZipLib~ test project, ensure everything compiles and the tests are successful. | ||
* We may need to fix/remove some tests that were copied from the source. | ||
For example: [async tests](https://docs.unity3d.com/Packages/[email protected]/manual/reference-async-tests.html) | ||
which are not supported in Unity 2018 and earlier. | ||
* We may need to fix/remove some tests that were copied from the source. | ||
For example: [async tests](https://docs.unity3d.com/Packages/[email protected]/manual/reference-async-tests.html) | ||
which are not supported in Unity 2018 and earlier. | ||
1. Open a shell / Git Bash / terminal | ||
1. Execute `sh Scripts~/clean_up_cs.sh` to clean up cs source code. | ||
|
||
|
||
|
||
*Auto-generated on Wed Feb 28 05:29:40 UTC 2024* | ||
*Auto-generated on Thu Dec 19 08:01:25 UTC 2024* |
Oops, something went wrong.