CLI tool, built on top of Swift Argument Parser, that provides information about a given Swift Package product, such as a measurement of its binary size impact.
Binary size calculation is also available as a library via the SwiftPackageInfo package product.
- Run a complete analysis
swift-package-info --for https://github.com/ReactiveX/RxSwift -v 6.0.0 --product RxSwift- Check supported platforms (sub command)
swift-package-info platforms --for https://github.com/krzyzanowskim/CryptoSwift -v 1.3.8 --product CryptoSwift- See the binary size of a local package (e.g., under development framework)
swift-package-info binary-size --path ../project/my-frameworkswift-package-info --for https://github.com/ReactiveX/RxSwift -v 6.0.0 --product RxSwift+------------------------------------------------+
| Swift Package Info |
| |
| RxSwift, 6.0.0 |
+--------------+---------------------------------+
| Provider | Results |
+--------------+---------------------------------+
| Binary Size | Binary size increases by 963 KB |
| Platforms | System default |
| Dependencies | No third-party dependencies :) |
+--------------+---------------------------------+
> Total of 3 providers used.
A custom report strategy can be passed via the report argument (check --help for supported values)
swift-package-info --for https://github.com/ReactiveX/RxSwift -v 6.0.0 --product RxSwift --report jsonDump{
"binarySize" : {
"amount" : 962560,
"formatted" : "963 KB"
},
"dependencies" : [
],
"platforms" : {
}
}- Swift >= 6.1
- Xcode >= 16.4
- Install mint
- Optionally add mint to your $PATH
- Run:
mint install marinofelipe/swift-package-infoto install the latest version
mint run swift-package-info- or simply,
swift-package-infoin case it was symlinked
Its methodology is inspired by cocoapods-size, and thus works by comparing archives with no bitcode and ARM64 arch. Such a strategy has proven consistent with the size of iOS apps downloaded and installed via TestFlight.
Special thanks to @unnamedd for sharing his experience with swift-tools-support-core and on how to build a pretty 👌 report.
Check the CONTRIBUTING.md file.