spm_utils 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b4ce02f74f991372beab1718fed4fde916a14e1b
4
- data.tar.gz: 8de90016785062102c144b6bd889e43c3a66c9fb
3
+ metadata.gz: 7316f136772d74d77b72adfd37f5a7aa5203c529
4
+ data.tar.gz: 097e2f61e3784b95cd68dae8ae3812ee97537a52
5
5
  SHA512:
6
- metadata.gz: f4f4c7f38bead6aafef00233b1bc7bbd5ffcb9ce1e1a3e9a9bacad26c46404d81061db8b858989b029a5a65c5b9574718d6d77e0a160c181b63c54ee4a4fc816
7
- data.tar.gz: 38c935bdd9d180c9e3025b7961e410ab6eeedff3d97f3688bd0a66be1b58e5d7a6665a524fa219abb3f2dedbddcd062ea735390c10688420514a88d9b39e0209
6
+ metadata.gz: 0548797efb92f76b111468f9189a79fc03562327ea8cb6edf3716543561b97fbae7eacdcd70fe6759fb970339aa4f8e270efe38745028fc6cf640d7179ce0652
7
+ data.tar.gz: 0e16a89afebdb7818e0c3396304b564b778fabe03c5ecc52fc423c31606a0ab078466318b6148d27899dd7477b1335072e2c1653eb364bf9791cba8be73e6fb4
data/README.md CHANGED
@@ -1,47 +1,89 @@
1
- # SPM fixers
2
- 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.
3
- 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**.
4
- These were not tested on many projects yet, so please bear in mind that this is really experimental.
1
+ # SPM utils
2
+
3
+ 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! Please remember though, that all of this is mostly **work in progress** (it works on my computer™)
5
4
  Fortunately, I accept PRs to fix anything you see that is wrong! I will be really grateful for that, actually.
6
5
 
7
6
  ## Before you use the script:
8
- 1. Go to your SPM project.
9
- 1. Backup/commit your files.
10
- 1. Clean your project if needed.
11
- 1. Run `swift build & swift package generate-xcodeproj` (make sure it passes)
12
- 1. Install this gem using `gem install spm_fixers`
7
+
8
+ 1. Go to your SPM project.
9
+ 1. Backup/commit your files.
10
+ 1. Clean your project if needed.
11
+ 1. Run `swift package generate-xcodeproj` (make sure it passes)
12
+ 1. Install this gem using `gem install spm_utils`
13
13
 
14
14
  ## Cleaning your project
15
+
15
16
  Whenever something goes wrong with building/caching/resolving, try cleaning your project:
16
- `swift package clean && rm -rf .build && rm Package.resolved`
17
+
18
+ ```bash
19
+ spm_utils clean_project
20
+ ```
17
21
 
18
22
  ## Quick fixer
23
+
19
24
  See issue [Quick#751](https://github.com/Quick/Quick/issues/751) and PR [swift-package-manager#955](https://github.com/apple/swift-package-manager/pull/955). TL;DR because of SPM, Quick can't set `CLANG_ENABLE_MODULES` by itself.
20
- This script does it for you.
25
+ This script automates it for you:
26
+
27
+ ```bash
28
+ spm_utils fix_quick
29
+ ```
21
30
 
22
- Steps:
23
- 1. Make sure to follow the [Before you use the script](#before-you-use-the-script) guide.
24
- 1. Run `spm_fixers quick`.
25
- 1. If everything goes correcly, your project should be fixed!
31
+ ## Swift version - update your targets to Swift 3 or 4
26
32
 
27
- ## Swift4All - update all your dependencies to Swift 4
28
- By running `swift build & swift package generate-xcodeproj` you don't necessarily get all your dependencies built with Swift 4 (see [SR-5940](https://bugs.swift.org/browse/SR-5940)). This script fixes that for you. You might want want to use my fork of Quick as Swift 4 is currently
29
- broken, but [PR#755](https://github.com/Quick/Quick/pull/755) is waiting for the merge :)
33
+ By running `swift package generate-xcodeproj` you don't necessarily get all your targets built with Swift 4 (see [SR-5940](https://bugs.swift.org/browse/SR-5940)). You might also want to change one of the targets to use Swift 3 or 4. This script fixes that for you. _Note: You might want want to use my fork of Quick as Swift 4 is currently broken, but [PR#755](https://github.com/Quick/Quick/pull/755) is waiting for the merge :)_
34
+
35
+ ### To use my fork of Quick fix a temporary fix:
30
36
 
31
37
  ```swift
32
38
  .package(url: "https://github.com/sunshinejr/Quick.git", .branch("fix/spm_swift4"))
33
39
  ```
34
40
 
35
- Steps:
36
- 1. Go to your SPM project.
37
- 1. Clean your packages by using `swift package clean`
38
- 1. Run `swift build & swift package generate-xcodeproj` (make sure it passes)
39
- 1. Run `gem install xcodeproj` to install additional library for our scrip.
40
- 1. Run `ruby path/to/spm_swift4all.rb` to update your Xcodeproj.
41
- 1. If everything goes correcly, you should have your project updated.
41
+ ### To update all targets to use Swift 3:
42
+
43
+ ```bash
44
+ spm_utils swift 3.0
45
+ ```
46
+
47
+ ### To update all targets to use Swift 4:
48
+
49
+ ```bash
50
+ spm_utils swift 4.0
51
+ ```
52
+
53
+ ### To update all targets to use Swift 4.2:
54
+
55
+ ```bash
56
+ spm_utils swift 4.2
57
+ ```
58
+
59
+ ### To update few targets to use Swift 4.2:
60
+
61
+ ```bash
62
+ spm_utils swift --target Quick --target Nimble 4.2
63
+ ```
64
+
65
+ ## Inhibit warnings
66
+
67
+ In [CocoaPods](https://cocoapods.org) there is an option to hide your dependencies warnings. This basically does the same thing.
68
+
69
+ ### To inhibit warnings for all targets
70
+
71
+ ```bash
72
+ spm_utils inhibit_all_warnings
73
+ ```
74
+
75
+ ### To inhibit warnings for only one target
76
+
77
+ ```bash
78
+ spm_utils inhibit_all_warnings --target Nimble
79
+ ```
80
+
81
+ ### To inhibit warnings for multiple targets
82
+
83
+ ```bash
84
+ spm_utils inhibit_all_warnings --target Nimble --target Moya
85
+ ```
42
86
 
43
- ## [WIP] Inhibit deps warnings - Basically `CocoaPods'` `inhibit_all_warnings` copy.
44
- This currently does not work, but it would be awesome to have it working sometime in future.
87
+ ## License
45
88
 
46
- # License
47
89
  [MIT](https://github.com/sunshinejr/spm_fixers/blob/master/LICENSE).
@@ -9,7 +9,7 @@ require_relative '../lib/command/clean_project_command'
9
9
  require_relative '../lib/version'
10
10
 
11
11
  class MainCommand < Clamp::Command
12
- subcommand 'quick', 'Fix Quick\'s problem with SPM until it\'s resolved. See: https://github.com/Quick/Quick/issues/751', FixQuickCommand
12
+ subcommand 'fix_quick', 'Fix Quick\'s problem with SPM until it\'s resolved. See: https://github.com/Quick/Quick/issues/751', FixQuickCommand
13
13
  subcommand 'swift', 'Change Swift version of a target/targets', SwiftVersionCommand
14
14
  subcommand 'inhibit_all_warnings', 'Inhibit all warninigs in a target/targets', InhibitAllWarningsCommand
15
15
  subcommand 'clean_project', 'Remove .build dir, Package.resolved & packages cache', CleanProjectCommand
@@ -4,7 +4,7 @@ class SwiftVersionCommand < Clamp::Command
4
4
  # option ['--swift-version'], 'SWIFT_VERSION', 'What Swift version to change into', :required => true
5
5
 
6
6
  def execute
7
- supported_swift_versions = ['3', '4']
7
+ supported_swift_versions = ['3.0', '4.0', '4.2']
8
8
  if !supported_swift_versions.include? swift_version
9
9
  signal_usage_error "'#{swift_version}' swift version is not supported. Supported values: " + supported_swift_versions.map { |v| "'#{v}'" }.join(", ")
10
10
  end
@@ -1,3 +1,3 @@
1
1
  module SPMFixers
2
- VERSION = '0.0.1'
2
+ VERSION = '0.1.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spm_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Łukasz Mróz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-16 00:00:00.000000000 Z
11
+ date: 2018-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xcodeproj