Skip to content

sunshinejr/spm_utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SPM utils

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!

Current functionalities:

  1. Clean your project (remove cache, builds, xcodeproj etc)
  2. Fix Quick on SPM
  3. Update Swift version in given target or all targets
  4. Inhibit all warnings in given target or all targets

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 package generate-xcodeproj (make sure it passes)
  5. Install this gem using gem install spm_utils

Cleaning your project

Whenever something goes wrong with building/caching/resolving, try cleaning your project:

spm_utils clean_project

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 automates it for you:

spm_utils fix_quick

Swift version - update your targets to Swift 3 or 4

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!

To update all targets to use Swift 3:

spm_utils swift 3.0

To update all targets to use Swift 4:

spm_utils swift 4.0

To update all targets to use Swift 4.2:

spm_utils swift 4.2

To update few targets to use Swift 4.2:

spm_utils swift --target Quick --target Nimble 4.2

Inhibit warnings

In CocoaPods there is an option to hide your dependencies warnings. This basically does the same thing.

To inhibit warnings for all targets

spm_utils inhibit_all_warnings

To inhibit warnings for only one target

spm_utils inhibit_all_warnings --target Nimble

To inhibit warnings for multiple targets

spm_utils inhibit_all_warnings --target Nimble --target Moya

License

MIT.

About

Bunch of utility scripts for Swift Package Manager.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages