spm_utils 0.0.1 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +70 -28
- data/bin/spm_utils +1 -1
- data/lib/command/swift_version_command.rb +1 -1
- data/lib/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7316f136772d74d77b72adfd37f5a7aa5203c529
|
4
|
+
data.tar.gz: 097e2f61e3784b95cd68dae8ae3812ee97537a52
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0548797efb92f76b111468f9189a79fc03562327ea8cb6edf3716543561b97fbae7eacdcd70fe6759fb970339aa4f8e270efe38745028fc6cf640d7179ce0652
|
7
|
+
data.tar.gz: 0e16a89afebdb7818e0c3396304b564b778fabe03c5ecc52fc423c31606a0ab078466318b6148d27899dd7477b1335072e2c1653eb364bf9791cba8be73e6fb4
|
data/README.md
CHANGED
@@ -1,47 +1,89 @@
|
|
1
|
-
# SPM
|
2
|
-
|
3
|
-
|
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
|
-
|
9
|
-
1.
|
10
|
-
1.
|
11
|
-
1.
|
12
|
-
1.
|
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
|
-
|
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
|
25
|
+
This script automates it for you:
|
26
|
+
|
27
|
+
```bash
|
28
|
+
spm_utils fix_quick
|
29
|
+
```
|
21
30
|
|
22
|
-
|
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
|
-
|
28
|
-
|
29
|
-
|
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
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
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
|
-
##
|
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).
|
data/bin/spm_utils
CHANGED
@@ -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 '
|
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
|
data/lib/version.rb
CHANGED
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
|
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:
|
11
|
+
date: 2018-06-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: xcodeproj
|