11# SWCompression
22
3- [ ![ Swift 5.X ] ( https://img.shields.io/badge/Swift-5.X -blue.svg )] ( https://developer.apple.com/swift/ )
3+ [ ![ Swift 5.1+ ] ( https://img.shields.io/badge/Swift-5.1+ -blue.svg )] ( https://developer.apple.com/swift/ )
44[ ![ GitHub license] ( https://img.shields.io/badge/license-MIT-lightgrey.svg )] ( https://raw.githubusercontent.com/tsolomko/SWCompression/master/LICENSE )
55[ ![ Build Status] ( https://dev.azure.com/tsolomko/SWCompression/_apis/build/status/tsolomko.SWCompression?branchName=develop )] ( https://dev.azure.com/tsolomko/SWCompression/_build/latest?definitionId=3&branchName=develop )
66
@@ -18,10 +18,10 @@ It also works on Apple platforms, Linux, __and Windows__.
1818
1919All features are listed in the tables below. "TBD" means that feature is planned but not implemented (yet).
2020
21- | | Deflate | BZip2 | LZMA/LZMA2 |
22- | ------------- | ------- | ----- | ---------- |
23- | Decompression | ✅ | ✅ | ✅ |
24- | Compression | ✅ | ✅ | TBD |
21+ | | Deflate | BZip2 | LZMA/LZMA2 | LZ4 |
22+ | ------------- | ------- | ----- | ---------- | --- |
23+ | Decompression | ✅ | ✅ | ✅ | ✅ |
24+ | Compression | ✅ | ✅ | TBD | ✅ |
2525
2626| | Zlib | GZip | XZ | ZIP | TAR | 7-Zip |
2727| ----- | ---- | ---- | --- | --- | --- | ----- |
@@ -45,7 +45,7 @@ let package = Package(
4545 name : " PackageName" ,
4646 dependencies : [
4747 .package (url : " https://github.com/tsolomko/SWCompression.git" ,
48- from : " 4.6 .0" )
48+ from : " 4.7 .0" )
4949 ],
5050 targets : [
5151 .target (
@@ -60,7 +60,7 @@ More details you can find in [Swift Package Manager's Documentation](https://git
6060
6161### CocoaPods
6262
63- Add ` pod 'SWCompression', '~> 4.6 ' ` and ` use_frameworks! ` lines to your Podfile.
63+ Add ` pod 'SWCompression', '~> 4.7 ' ` and ` use_frameworks! ` lines to your Podfile.
6464
6565To complete installation, run ` pod install ` .
6666
@@ -71,6 +71,7 @@ If you need only some parts of framework, you can install only them using sub-po
7171- SWCompression/Gzip
7272- SWCompression/LZMA
7373- SWCompression/LZMA2
74+ - SWCompression/LZ4
7475- SWCompression/SevenZip
7576- SWCompression/TAR
7677- SWCompression/XZ
@@ -97,13 +98,14 @@ List of "optional dependecies":
9798- For SWCompression/SevenZip:
9899 - SWCompression/BZip2
99100 - SWCompression/Deflate
101+ - SWCompression/LZ4
100102
101103__ Note:__ If you use Swift Package Manager or Carthage you always have everything (ZIP and 7-Zip are built with Deflate,
102- BZip2 and LZMA/LZMA2 support).
104+ BZip2, LZMA/LZMA2 and LZ4 support).
103105
104106### Carthage
105107
106- Add to your Cartfile ` github "tsolomko/SWCompression" ~> 4.6 ` .
108+ Add to your Cartfile ` github "tsolomko/SWCompression" ~> 4.7 ` .
107109
108110Then:
109111
@@ -184,31 +186,40 @@ was created manually and you shouldn't use `swift package generate-xcodeproj` co
184186
185187### Executing tests locally
186188
187- If you want to run tests on your computer, you need to do an additional step after cloning the repository:
189+ If you want to run tests on your computer, you need to do a couple of additional steps after cloning the repository:
188190
189191``` bash
190- ./utils.py prepare-workspace {macos| other}
192+ ./utils.py download-bbd-macos
193+ git submodule update --init --recursive
194+ cd " Tests/Test Files"
195+ cp gitattributes-copy .gitattributes
196+ git lfs pull
197+ git lfs checkout
191198```
192199
193- The argument of this function is an operating system that you're using. This command will download files used in tests,
194- and on macOS it will also try to download BitByteData dependency, which requires having Carthage installed. When using
195- Xcode 12 or later, you should also pass the ` --xcf ` option, or use the
196- [ xconfig workaround] ( https://github.com/Carthage/Carthage/blob/master/Documentation/Xcode12Workaround.md ) .
197- Please also note that when working on SWCompression in Xcode when building the project you may see ld warnings about a
198- directory not being found. These are expected and harmless. Finally, you should keep in mind that support for non-xcframework
199- method of installing dependencies is likely to be dropped in the future major update.
200+ The first command will download the BitByteData dependency, which requires having Carthage installed. When using Xcode
201+ 12 or later, you should also pass the ` --xcf ` option, or use the
202+ [ xconfig workaround] ( https://github.com/Carthage/Carthage/blob/master/Documentation/Xcode12Workaround.md ) . Please note
203+ that when building SWCompression's Xcode project you may see ld warnings about a directory not being found. These are
204+ expected and harmless. Finally, you should keep in mind that support for non-xcframework method of installing
205+ dependencies is likely to be dropped in the future major update.
200206
201- Test files are stored in a [ separate repository ] ( https://github.com/tsolomko/SWCompression-Test-Files ) , using Git LFS.
202- There are two reasons for this complicated setup. Firstly, some of these files can be quite big, and it would be
203- unfortunate if the users of SWCompression had to download them every time during the installation. Secondly, Swift
204- Package Manager and contemporary versions of Xcode don't always work well with git-lfs-enabled repositories. To prevent
205- any potential problems test files were moved into another repository. Additionaly, the custom command line tool ` utils.py `
206- is used to work around issues occuring on certain user systems (see, for example, [ # 9 ] ( https://github.com/tsolomko/SWCompression/issues/9 ) ) .
207+ The remaining commands will download the files used in tests. These files are stored in a
208+ [ separate repository ] ( https://github.com/tsolomko/SWCompression-Test-Files ) , using Git LFS. There are two reasons for
209+ this complicated setup. Firstly, some of these files can be quite big, and it would be unfortunate if the users of
210+ SWCompression had to download them during the installation. Secondly, Swift Package Manager and contemporary versions of
211+ Xcode don't always work well with git-lfs-enabled repositories. To prevent any potential problems test files were moved
212+ into another repository .
207213
208214Please note, that if you want to add a new _ type_ of test files, in addition to running ` git lfs track ` , you have to
209215also copy into the "Tests/Test Files/gitattributes-copy" file a line this command adds to the "Tests/Test Files/.gitattributes"
210216file. __ Do not commit the ".gitattributes" file to the git history. It is git-ignored for a reason!__
211217
218+ Please also be mindful of Git LFS bandwidth quota on GitHub: try to limit downloading lfs'd files using ` git lfs pull ` .
219+ In CI we use some caching techniques to help with the quota, so if you're going to add new tests that require several
220+ new test files you should try to submit them all together to reduce the amount of times CI needs to recreate the cache
221+ (recreating the cache requires to do ` git lfs pull ` for all test files).
222+
212223## Performance
213224
214225Using whole module optimizations is recommended for the best performance. They are enabled by default in the Release build
@@ -256,3 +267,6 @@ completely in Swift without Objective-C, it can also be used on __Linux__.
256267- [ Apache Commons Compress] ( https://commons.apache.org/proper/commons-compress/ )
257268- [ A walk through the SA-IS Suffix Array Construction Algorithm] ( http://zork.net/~st/jottings/sais.html )
258269- [ Wikipedia article about BZip2] ( https://en.wikipedia.org/wiki/Bzip2 )
270+ - [ LZ4 Frame Format Description] ( https://github.com/lz4/lz4/blob/dev/doc/lz4_Frame_format.md )
271+ - [ LZ4 Block Format Description] ( https://github.com/lz4/lz4/blob/dev/doc/lz4_Block_format.md )
272+ - [ xxHash specification] ( https://github.com/Cyan4973/xxHash/blob/dev/doc/xxhash_spec.md )
0 commit comments