Hey there! This is a repo with a bunch of utility scripts for SPM compiled to a ruby gem. I really like working with SPM nowadays, but I needed to automate some things that I could reuse both on my local computer and also on the CI - maybe you want to use them too! If you have an idea for a cool fixer/utility - don't hesitate to file and issue or make a PR!
- Clean your project (remove cache, builds, xcodeproj etc)
- Fix Quick on SPM
- Update Swift version in given target or all targets
- Inhibit all warnings in given target or all targets
- Go to your SPM project.
- Backup/commit your files.
- Clean your project if needed.
- Run
swift package generate-xcodeproj
(make sure it passes) - Install this gem using
gem install spm_utils
Whenever something goes wrong with building/caching/resolving, try cleaning your project:
spm_utils clean_project
See issue Quick#751 and PR swift-package-manager#955. TL;DR because of SPM, Quick can't set CLANG_ENABLE_MODULES
by itself.
This script automates it for you:
spm_utils fix_quick
By running swift package generate-xcodeproj
you don't necessarily get all your targets built with Swift 4 (see SR-5940). You might also want to change one of the targets to use Swift 3 or 4. This script fixes that for you!
spm_utils swift 3.0
spm_utils swift 4.0
spm_utils swift 4.2
spm_utils swift --target Quick --target Nimble 4.2
In CocoaPods there is an option to hide your dependencies warnings. This basically does the same thing.
spm_utils inhibit_all_warnings
spm_utils inhibit_all_warnings --target Nimble
spm_utils inhibit_all_warnings --target Nimble --target Moya
MIT.