Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
e4338d4
Drop support for Swift 5.3 and 5.4
tsolomko Apr 21, 2024
ed03f64
[CI] Remove a redundant flag from macos builds
tsolomko Apr 21, 2024
7427a29
Fix podspec settings for the PrivacyInfo file
tsolomko Apr 21, 2024
891848f
[swcomp] Remove redundant compiler check
tsolomko Apr 21, 2024
ffa0ba3
Upgrade Xcode project format
tsolomko Apr 21, 2024
2927e6e
Increase minimum deployment targets on Apple platforms
tsolomko Apr 21, 2024
fa4af58
[TAR] Remove compatibility functions for FileHandle
tsolomko Apr 21, 2024
60b76e6
[swcomp] Enable swcomp in the SPM manifest only on macOS
tsolomko Apr 21, 2024
81cfa82
Drop support for Swift 5.5 and 5.6
tsolomko Dec 14, 2024
0a8ad04
Remove mention of xcode 12 workaround for testing from README
tsolomko Dec 14, 2024
ce59675
Mention that swcomp is only available on macos
tsolomko Dec 14, 2024
c0b07cf
Use non-deprecated methods in SPM manifest
tsolomko Dec 15, 2024
5ff7317
[Tests] Fix modifying data in memory crashes on Swift 5.9+
tsolomko Dec 15, 2024
17c0a1e
[CI] Update ios simulators for Swift 5.9 and 5.10
tsolomko Dec 15, 2024
e71c7d8
[CI] Use docker for broken windows builds
tsolomko Dec 15, 2024
ea9aacc
Update copyright year to 2026
tsolomko Jan 31, 2026
ec180c3
Add a note to README about CocoaPods deprecation
tsolomko Jan 31, 2026
0a4edd5
Update xcode project
tsolomko Jan 31, 2026
5b57ac0
Drop support for Swift 5.7 and 5.8
tsolomko Jan 31, 2026
33e5716
Increase minimum deployment targets on Apple platforms
tsolomko Jan 31, 2026
9c22e43
[CI] Add builds on Swift 6.1 and 6.2
tsolomko Jan 31, 2026
f498c08
[CI] Change Swift 5.9 build on Windows to use Docker image
tsolomko Jan 31, 2026
38ac3e6
[CI] Fix macOS version for Swift 5.10 build
tsolomko Jan 31, 2026
44476e4
[CI] Disable Swift 5.10 build on Windows
tsolomko Jan 31, 2026
713ae2c
Remove mention of generate-xcodeproj command in README
tsolomko Jan 31, 2026
718bdfa
utils.py: add an option to build BBD only for macOS
tsolomko Jan 31, 2026
cd116a9
[CI] Add a step for installing Darwin platforms
tsolomko Jan 31, 2026
eb83e09
Fix framework search paths in Xcode project
tsolomko Feb 2, 2026
f1b6350
Add BitByteData as a package dependency in Xcode project
tsolomko Feb 2, 2026
29697ca
Remove from Xcode project settings for embedding BBD built with Carthage
tsolomko Feb 2, 2026
5b3840f
utils.py: remove download-bbd-macos command
tsolomko Feb 2, 2026
8a90134
Remove Cartfile
tsolomko Feb 2, 2026
ad4a957
Remove podspec
tsolomko Feb 2, 2026
1566b49
[7-Zip][ZIP] Remove support for CocoaPods optional dependencies
tsolomko Feb 2, 2026
b5a0a02
Remove installation instructions with CocoaPods and Carthage from README
tsolomko Feb 2, 2026
9916541
utils.py: change OS X to macOS
tsolomko Feb 2, 2026
33341b6
[LZ4] Code comments grammar and wording improvements
tsolomko Feb 2, 2026
e7c4c13
[BZip2] Code comments clarification
tsolomko Feb 3, 2026
60283d4
Reorder PrivacyInfo file in Xcode project
tsolomko Feb 3, 2026
d8c4527
[BZip2] Slightly optimize MTF transform of selectors during compression
tsolomko Feb 4, 2026
5d27f1b
[swcomp] Print benchmark metadatas in normal order
tsolomko Feb 5, 2026
5a0eb81
[XZ] Rename a file for consistency
tsolomko Feb 7, 2026
5e8f568
[swcomp] Save and show benchmark warmup iteration
tsolomko Feb 11, 2026
3537e0a
[swcomp] Save raw benchmark data for posterity
tsolomko Feb 11, 2026
e236b50
[swcomp] Improve benchmark show output for multi-way comparsions
tsolomko Feb 11, 2026
6b701e0
[swcomp] Add --print-uuid option to benchmark show command
tsolomko Feb 11, 2026
c05b37d
[swcomp] Add --metadata-only option to benchmark show command
tsolomko Feb 11, 2026
5618fea
[swcomp] Add --self-compare option to benchmark show command
tsolomko Feb 11, 2026
871b5db
[swcomp] Add benchmark remove-run subcommand
tsolomko Feb 11, 2026
b2b4e18
[swcomp] Remove redundant import statements
tsolomko Feb 11, 2026
3f5694a
[swcomp] Rename SaveFile to OldSaveFile
tsolomko Feb 11, 2026
98b5ee3
[swcomp] Save results file JSON with keys sorted
tsolomko Feb 12, 2026
20d33b0
[swcomp] Add a new benchmark save file format
tsolomko Feb 12, 2026
4ec437e
[swcomp] Add benchmark convert command
tsolomko Feb 12, 2026
8847fe9
[swcomp] SaveFile.load now auto-converts from old format
tsolomko Feb 12, 2026
515c11f
[swcomp] Support new format in benchmark remove-run command
tsolomko Feb 12, 2026
52961ea
[swcomp] Update benchmark show command to use new format
tsolomko Feb 12, 2026
d76351c
[swcomp] Update benchmark run command to use new format
tsolomko Feb 12, 2026
f5b8a39
Cleanup gitignore
tsolomko Feb 13, 2026
ce1736a
[Huffman] Add HuffmanCodes typealias for clarity
tsolomko Feb 17, 2026
5b5b20f
[Huffman] Remove codes argument label from EncodingTree.init
tsolomko Feb 17, 2026
273b6ed
Remove redundant imports
tsolomko Feb 18, 2026
35bbf0c
[BZip2] Improve encoding performance of code lengths deltas
tsolomko Feb 18, 2026
022d76a
[BZip2] Use UInt8 arrays instead of Data
tsolomko Feb 18, 2026
49d783e
[BZip2] Use better versions of bit writer functions
tsolomko Feb 18, 2026
2318633
[BZip2] Change a couple of guard/if-checks to assertions
tsolomko Feb 18, 2026
52669c1
[LZMA] Remove LZMARangeDecoder.isCorrupted property
tsolomko Feb 18, 2026
d10edc9
[swcomp] Remove empty warmupIteration function from comp-ratio benchm…
tsolomko Feb 19, 2026
13d5097
[Deflate] Optimize creation of uncompressed blocks
tsolomko Feb 19, 2026
16028af
Add AES-256 decryption support for encrypted 7z archives
Feb 21, 2026
aaa7958
Merge: Add AES-256 decryption support for encrypted 7z archives
Feb 21, 2026
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
51 changes: 3 additions & 48 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

## Custom
Tests/temp

## Build generated
build/
DerivedData/
Expand All @@ -26,58 +23,16 @@ xcuserdata/
*.xccheckout
*.xcscmblueprint

## Obj-C/Swift specific
*.hmap
*.ipa
*.dSYM.zip
*.dSYM

## Playgrounds
timeline.xctimeline
playground.xcworkspace

# Swift Package Manager
#
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
.build/
Package.pins

# CocoaPods
Pods/

# Carthage
# Avoid checking in source code from Carthage dependencies.
Carthage/Checkouts
Carthage/Build
Cartfile.resolved

# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md

fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output

# Symbolic link to swcomp executable built by SPM
/swcomp

# Package.resolved, because we don't want to fix dependencies' versions
Package.resolved
.build/

# Docs generated by SourceKitten
# Ignore docs generated by SourceKitten
docs.json

# Docs generated by Jazzy
# Ignore docs generated by Jazzy
docs/

# Vscode launch.json generated by Swift extension
.vscode/launch.json

# API baselines generate by swift package diagnose-api-breaking-changes
api_baseline/
2 changes: 1 addition & 1 deletion .jazzy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ clean: false
author: Timofey Solomko
module: SWCompression
module_version: 4.8.6
copyright: '© 2024 Timofey Solomko'
copyright: '© 2026 Timofey Solomko'
readme: README.md
github_url: https://github.com/tsolomko/SWCompression
github_file_prefix: https://github.com/tsolomko/SWCompression/tree/4.8.6
Expand Down
1 change: 0 additions & 1 deletion Cartfile

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 Timofey Solomko
Copyright (c) 2026 Timofey Solomko

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
33 changes: 15 additions & 18 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
// swift-tools-version:5.3
// swift-tools-version:5.9
import PackageDescription

let package = Package(
var package = Package(
name: "SWCompression",
platforms: [
.macOS(.v10_13),
.iOS(.v11),
.tvOS(.v11),
.watchOS(.v4),
// TODO: Enable after upgrading to Swift 5.9.
// .visionOS(.v1)
.macOS(.v14),
.iOS(.v17),
.tvOS(.v17),
.watchOS(.v10),
.visionOS(.v1)
],
products: [
.library(
name: "SWCompression",
targets: ["SWCompression"]),
],
dependencies: [
.package(name: "BitByteData", url: "https://github.com/tsolomko/BitByteData",
from: "2.0.0"),
.package(name: "SwiftCLI", url: "https://github.com/jakeheis/SwiftCLI",
from: "6.0.0"),
.package(url: "https://github.com/tsolomko/BitByteData", from: "2.0.0"),
],
targets: [
.target(
Expand All @@ -30,12 +26,13 @@ let package = Package(
exclude: ["swcomp"],
sources: ["Common", "7-Zip", "BZip2", "Deflate", "GZip", "LZ4", "LZMA", "LZMA2", "TAR", "XZ", "ZIP", "Zlib"],
resources: [.copy("PrivacyInfo.xcprivacy")]),
.target(
name: "swcomp",
dependencies: ["SWCompression", "SwiftCLI"],
path: "Sources",
exclude: ["Common", "7-Zip", "BZip2", "Deflate", "GZip", "LZ4", "LZMA", "LZMA2", "TAR", "XZ", "ZIP", "Zlib", "PrivacyInfo.xcprivacy"],
sources: ["swcomp"]),
],
swiftLanguageVersions: [.v5]
)

#if os(macOS)
package.dependencies.append(.package(url: "https://github.com/jakeheis/SwiftCLI", from: "6.0.0"))
package.targets.append(.executableTarget(name: "swcomp", dependencies: ["SWCompression", "SwiftCLI"], path: "Sources",
exclude: ["Common", "7-Zip", "BZip2", "Deflate", "GZip", "LZ4", "LZMA", "LZMA2", "TAR", "XZ", "ZIP", "Zlib", "PrivacyInfo.xcprivacy"],
sources: ["swcomp"]))
#endif
77 changes: 8 additions & 69 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SWCompression

[![Swift 5.3+](https://img.shields.io/badge/Swift-5.3+-blue.svg)](https://developer.apple.com/swift/)
[![Swift 5.9+](https://img.shields.io/badge/Swift-5.9+-blue.svg)](https://developer.apple.com/swift/)
[![GitHub license](https://img.shields.io/badge/license-MIT-lightgrey.svg)](https://raw.githubusercontent.com/tsolomko/SWCompression/master/LICENSE)
[![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)

Expand Down Expand Up @@ -32,11 +32,12 @@ Also, SWCompression is _written with Swift only._

## Installation

SWCompression can be integrated into your project using Swift Package Manager, CocoaPods, or Carthage.
SWCompression can be integrated into your project using Swift Package Manager.

### Swift Package Manager
__Note:__ SWCompression versions 4.8.6 and earlier were also made available via CocoaPods or Carthage.

To install using SPM, add SWCompression to you package dependencies and specify it as a dependency for your target, e.g.:
To install with Swift Package manager, add SWCompression to you package dependencies and specify it as a dependency for
your target, e.g.:

```swift
import PackageDescription
Expand All @@ -58,59 +59,6 @@ let package = Package(

More details you can find in [Swift Package Manager's Documentation](https://github.com/apple/swift-package-manager/tree/main/Documentation).

### CocoaPods

Add `pod 'SWCompression', '~> 4.8'` and `use_frameworks!` lines to your Podfile.

To complete installation, run `pod install`.

If you need only some parts of framework, you can install only them using sub-podspecs. Available subspecs:

- SWCompression/BZip2
- SWCompression/Deflate
- SWCompression/Gzip
- SWCompression/LZMA
- SWCompression/LZMA2
- SWCompression/LZ4
- SWCompression/SevenZip
- SWCompression/TAR
- SWCompression/XZ
- SWCompression/Zlib
- SWCompression/ZIP

#### "Optional Dependencies"

For both ZIP and 7-Zip there is the most commonly used compression method: Deflate and LZMA/LZMA2 correspondingly. Thus,
SWCompression/ZIP subspec has SWCompression/Deflate subspec as a dependency and SWCompression/LZMA subspec is a
dependency for SWCompression/SevenZip.

But both of these formats also support other compression methods, and some of them are implemented in SWCompression.
For CocoaPods configurations there are some sort of 'optional dependencies' for such compression methods.

"Optional dependency" in this context means that SWCompression/ZIP or SWCompression/7-Zip will support a compression
method only if a corresponding subspec is expicitly specified in your Podfile and installed.

List of "optional dependecies":

- For SWCompression/ZIP:
- SWCompression/BZip2
- SWCompression/LZMA
- For SWCompression/SevenZip:
- SWCompression/BZip2
- SWCompression/Deflate
- SWCompression/LZ4

__Note:__ If you use Swift Package Manager or Carthage you always have everything (ZIP and 7-Zip are built with Deflate,
BZip2, LZMA/LZMA2 and LZ4 support).

### Carthage

Add to your Cartfile `github "tsolomko/SWCompression" ~> 4.8`.

Then you should run `carthage update --use-xcframeworks`. After that drag and drop both `SWCompression.xcframework` and
`BitByteData.xcframework` files from from the `Carthage/Build/` directory into the "Frameworks, Libraries, and Embedded
Content" section of your target's "General" tab in Xcode.

## Usage

### Basic Example
Expand Down Expand Up @@ -157,7 +105,7 @@ Every function or type of SWCompression's public API is documented. This documen
### Sophisticated example

There is a small command-line program, "swcomp", which is included in this repository in "Sources/swcomp". It can be
built using Swift Package Manager.
built using Swift Package Manager (only available on macOS).

__IMPORTANT:__ The "swcomp" command-line tool is NOT intended for general use.

Expand All @@ -171,9 +119,6 @@ In the case of a bug, it will be especially helpful if you attach a file (archiv

If you'd like to contribute, please [create a pull request](https://github.com/tsolomko/SWCompression/pulls) on GitHub.

__Note:__ If you are considering working on SWCompression, please note that Xcode project (SWCompression.xcodeproj)
was created manually and you shouldn't use `swift package generate-xcodeproj` command.

### Executing tests locally

If you want to run tests on your computer, you need to do a couple of additional steps after cloning the repository:
Expand All @@ -187,14 +132,8 @@ git lfs pull
git lfs checkout
```

The first command will download the BitByteData dependency, which requires having Carthage installed. When using Xcode
12 or later, you should also pass the `--xcf` option, or use the
[xconfig workaround](https://github.com/Carthage/Carthage/blob/master/Documentation/Xcode12Workaround.md). Please note
that when building SWCompression's Xcode project you may see ld warnings about a directory not being found. These are
expected and harmless. Finally, you should keep in mind that support for non-xcframework method of installing
dependencies is likely to be dropped in the future major update.

The remaining commands will download the files used in tests. These files are stored in a
The first command will download the BitByteData dependency, which requires having Carthage installed. The remaining
commands will download the files used in tests. These files are stored in a
[separate repository](https://github.com/tsolomko/SWCompression-Test-Files), using Git LFS. There are two reasons for
this complicated setup. Firstly, some of these files can be quite big, and it would be unfortunate if the users of
SWCompression had to download them during the installation. Secondly, Swift Package Manager and contemporary versions of
Expand Down
95 changes: 0 additions & 95 deletions SWCompression.podspec

This file was deleted.

2 changes: 1 addition & 1 deletion SWCompression.xcodeproj/SWCompression.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
<key>CFBundleVersion</key>
<string>91</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2024 Timofey Solomko</string>
<string>Copyright © 2026 Timofey Solomko</string>
</dict>
</plist>
Loading
Loading