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:

  1. Go to your SPM project.
  2. Backup/commit your files.
  3. Clean your project if needed.
  4. Run swift build & swift package generate-xcodeproj (make sure it passes)
  5. 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:

  1. Make sure to follow the Before you use the script guide.
  2. Run spm_fixers quick.
  3. 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:

  1. Go to your SPM project.
  2. Clean your packages by using swift package clean
  3. Run swift build & swift package generate-xcodeproj (make sure it passes)
  4. Run gem install xcodeproj to install additional library for our scrip.
  5. Run ruby path/to/spm_swift4all.rb to update your Xcodeproj.
  6. 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.