SPM fixers
Hey there! This is my repo for a bunch of fixers for SPM. All of this is mostly work in progress and written in Ruby. Which means this is probably not the best code you'll see these days and I recommend you to do a backup/commit before using this scripts. These were not tested on many projects yet, so please bear in mind that this is really experimental. Fortunately, I accept PRs to fix anything you see that is wrong! I will be really grateful for that, actually.
Before you use the script:
- Go to your SPM project.
- Backup/commit your files.
- Clean your project if needed.
- Run
swift build & swift package generate-xcodeproj(make sure it passes) - Install this gem using
gem install spm_fixers
Cleaning your project
Whenever something goes wrong with building/caching/resolving, try cleaning your project:
swift package clean && rm -rf .build && rm Package.resolved
Quick fixer
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 does it for you.
Steps:
- Make sure to follow the Before you use the script guide.
- Run
spm_fixers quick. - If everything goes correcly, your project should be fixed!
Swift4All - update all your dependencies to Swift 4
By running swift build & swift package generate-xcodeproj you don't necessarily get all your dependencies built with Swift 4 (see SR-5940). This script fixes that for you. You might want want to use my fork of Quick as Swift 4 is currently
broken, but PR#755 is waiting for the merge :)
.package(url: "https://github.com/sunshinejr/Quick.git", .branch("fix/spm_swift4"))
Steps:
- Go to your SPM project.
- Clean your packages by using
swift package clean - Run
swift build & swift package generate-xcodeproj(make sure it passes) - Run
gem install xcodeprojto install additional library for our scrip. - Run
ruby path/to/spm_swift4all.rbto update your Xcodeproj. - If everything goes correcly, you should have your project updated.
[WIP] Inhibit deps warnings - Basically CocoaPods' inhibit_all_warnings copy.
This currently does not work, but it would be awesome to have it working sometime in future.
License
MIT.