danger-spm_version_updates 0.1.1 → 0.1.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b4b25309d2ebf835c0a6f0a13d22605cc95ef04aab3b73b48d2f780c273bec47
4
- data.tar.gz: 0421f910cdbbba4b4b39912510a5272b898e2ecf0b420e7bb50211d3fc2c3f97
3
+ metadata.gz: 6f3edb5f215f830ec9996754f188804ca79629de571e3f6d5d462c4e6a78f4ed
4
+ data.tar.gz: cc4e01f131130d1564fc0e5e65d64ff2f0ebe9beeae315c303117a932e805bd8
5
5
  SHA512:
6
- metadata.gz: 55238e841c8c1509667baf8dc4f44116eb4d3a792d24527bad0c00093daa69fc796155637489c986d4b5aecfa99a30122400cd98d3959b3678b747e3036b0270
7
- data.tar.gz: 85af80394fffbb6ec7779b633022b8d6315defd422731e49827b135081620e5b004624ec5980fff6878ba11df0e2ee0e2378b02849f379c557fab519207e0cc5
6
+ metadata.gz: 45ac718c4f0506e142277fcbe61a1fe6879bc0e0e49b760d240941076418cb0d7ccc491fa89e1e57b6bb203381e6557032ee45bf87c900821151ab4c356d5ccc
7
+ data.tar.gz: 40045fcf48475db57dec502b84934adfaea9c3a2d73794df73799d963d5d16d115e877fd54fe4cb8de3d9576e910f2ea93187709c0df11e9c0b50149843a8690
@@ -3,7 +3,7 @@ name: Publish Yard HTML to GitHub Pages
3
3
  on:
4
4
  push:
5
5
  tags:
6
- - "*"
6
+ - v*
7
7
  workflow_dispatch:
8
8
 
9
9
  jobs:
data/.rubocop.yml CHANGED
@@ -18,6 +18,13 @@ Style/MultilineIfModifier:
18
18
  Style/TrailingCommaInArrayLiteral:
19
19
  EnforcedStyleForMultiline: consistent_comma
20
20
 
21
+ Style/StderrPuts:
22
+ Enabled: false
23
+
24
+ Style/RegexpLiteral:
25
+ Enabled: true
26
+ EnforcedStyle: slashes
27
+
21
28
  RSpec/ExampleLength:
22
29
  Enabled: false
23
30
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- danger-spm_version_updates (0.1.1)
4
+ danger-spm_version_updates (0.1.2)
5
5
  danger-plugin-api (~> 1.0)
6
6
  semantic (~> 1.6)
7
7
  xcodeproj (~> 1.24)
data/README.md CHANGED
@@ -15,7 +15,9 @@ Note that version 0.1.0 is the last version to support Ruby 2.7
15
15
 
16
16
  ## Installation
17
17
 
18
- `gem install danger-spm_version_updates`
18
+ ```sh
19
+ gem install danger-spm_version_updates
20
+ ```
19
21
 
20
22
  or add the following to your Gemfile:
21
23
 
@@ -63,7 +65,7 @@ spm_version_updates.ignore_repos = ["https://github.com/pointfreeco/swift-snapsh
63
65
 
64
66
  Swift and the Swift logo are trademarks of Apple Inc.
65
67
 
66
- Copyright (c) 2023 Harold Martin <harold.martin@gmail.com>
68
+ Copyright (c) 2023 Harold Martin
67
69
 
68
70
  MIT License
69
71
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SpmVersionUpdates
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.2"
5
5
  end
@@ -4,13 +4,12 @@ require "semantic"
4
4
  require "xcodeproj"
5
5
 
6
6
  module Danger
7
- # A plugin for checking if there are versions upgrades available for SPM packages
7
+ # A Danger plugin for checking if there are versions upgrades available for SPM dependencies
8
8
  #
9
9
  # @example Check if MyApp's SPM dependencies are up to date
10
- #
11
10
  # spm_version_updates.check_for_updates("MyApp.xcodeproj")
12
11
  #
13
- # @see Harold Martin/danger-spm_version_updates
12
+ # @see hbmartin/danger-spm_version_updates
14
13
  # @tags swift, spm, swift package manager, xcode, xcodeproj, version, updates
15
14
  #
16
15
  class DangerSpmVersionUpdates < Plugin
@@ -45,7 +44,10 @@ module Danger
45
44
  resolved_version = resolved_versions[repository_url]
46
45
  kind = requirement["kind"]
47
46
 
48
- # kind can be major, minor, range, exact, branch, or commit
47
+ if resolved_version.nil?
48
+ $stderr.puts("Unable to locate the current version for #{name} (#{repository_url}) in #{find_packages_resolved_file(xcodeproj_path)}")
49
+ next
50
+ end
49
51
 
50
52
  if kind == "branch"
51
53
  branch = requirement["branch"]
@@ -172,7 +174,9 @@ Newest version of #{name}: #{available_versions.first} (but this package is conf
172
174
  ) unless newest_above_reqs == newest_meeting_reqs || newest_meeting_reqs.to_s == resolved_version
173
175
  end
174
176
 
175
- # Remove git call to list tags
177
+ # Call git to list tags
178
+ # @param [String] repo_url
179
+ # The URL of the dependency's repository
176
180
  # @return [Array<Semantic::Version>]
177
181
  def git_versions(repo_url)
178
182
  versions = `git ls-remote -t #{repo_url}`
@@ -190,6 +194,12 @@ Newest version of #{name}: #{available_versions.first} (but this package is conf
190
194
  versions
191
195
  end
192
196
 
197
+ # Calkl git to find the last commit on a branch
198
+ # @param [String] repo_url
199
+ # The URL of the dependency's repository
200
+ # @param [String] branch_name
201
+ # The name of the branch on which to find the last commit
202
+ # @return [String]
193
203
  def git_branch_last_commit(repo_url, branch_name)
194
204
  `git ls-remote -h #{repo_url}`
195
205
  .split("\n")
@@ -175,6 +175,20 @@ module Danger
175
175
  ]
176
176
  )
177
177
  end
178
+
179
+ it "Does not crash or warn when resolved version is missing from xcodeproj" do
180
+ @my_plugin.check_for_updates("#{File.dirname(__FILE__)}/support/fixtures/NoResolvedVersion.xcodeproj")
181
+
182
+ expect(@dangerfile.status_report[:warnings]).to eq([])
183
+ end
184
+
185
+ it "Does print to stderr when resolved version is missing from xcodeproj" do
186
+ expect {
187
+ @my_plugin.check_for_updates("#{File.dirname(__FILE__)}/support/fixtures/NoResolvedVersion.xcodeproj")
188
+ }.to output(
189
+ %r{Unable to locate the current version for kean/Nuke.*}
190
+ ).to_stderr
191
+ end
178
192
  end
179
193
  end
180
194
  end
@@ -0,0 +1,80 @@
1
+ // !$*UTF8*$!
2
+ {
3
+ archiveVersion = 1;
4
+ classes = {
5
+ };
6
+ objectVersion = 54;
7
+ objects = {
8
+ /* Begin PBXGroup section */
9
+ F1465EF423AA94BF0055F7C3 = {
10
+ isa = PBXGroup;
11
+ children = (
12
+ F1465EFF23AA94BF0055F7C3 /* Demo */,
13
+ );
14
+ sourceTree = "<group>";
15
+ };
16
+ F1465EFF23AA94BF0055F7C3 /* Demo */ = {
17
+ isa = PBXGroup;
18
+ children = ();
19
+ path = Demo;
20
+ sourceTree = "<group>";
21
+ };
22
+ /* End PBXGroup section */
23
+
24
+ /* Begin PBXProject section */
25
+ F1465EF523AA94BF0055F7C3 /* Project object */ = {
26
+ isa = PBXProject;
27
+ attributes = {
28
+ BuildIndependentTargetsInParallel = YES;
29
+ LastSwiftUpdateCheck = 1420;
30
+ LastUpgradeCheck = 1420;
31
+ TargetAttributes = {
32
+ F1465EFC23AA94BF0055F7C3 = {
33
+ CreatedOnToolsVersion = 11.2.1;
34
+ };
35
+ };
36
+ };
37
+ buildConfigurationList = F1465EF823AA94BF0055F7C3 /* Build configuration list for PBXProject "Demo" */;
38
+ compatibilityVersion = "Xcode 9.3";
39
+ developmentRegion = en;
40
+ hasScannedForEncodings = 0;
41
+ knownRegions = (
42
+ en,
43
+ Base,
44
+ es,
45
+ "zh-Hans",
46
+ fr,
47
+ );
48
+ mainGroup = F1465EF423AA94BF0055F7C3;
49
+ packageReferences = (
50
+ 11BBD37629C1571400F7A968 /* XCRemoteSwiftPackageReference "Nuke" */,
51
+ );
52
+ productRefGroup = F1465EFE23AA94BF0055F7C3 /* Products */;
53
+ projectDirPath = "";
54
+ projectRoot = "";
55
+ targets = ();
56
+ };
57
+ /* End PBXProject section */
58
+
59
+ /* Begin XCConfigurationList section */
60
+ F1465EF823AA94BF0055F7C3 /* Build configuration list for PBXNativeTarget "Demo" */ = {
61
+ isa = XCConfigurationList;
62
+ buildConfigurations = ();
63
+ defaultConfigurationIsVisible = 0;
64
+ defaultConfigurationName = Release;
65
+ };
66
+ /* End XCConfigurationList section */
67
+
68
+ /* Begin XCRemoteSwiftPackageReference section */
69
+ 11BBD37629C1571400F7A968 /* XCRemoteSwiftPackageReference "Nuke" */ = {
70
+ isa = XCRemoteSwiftPackageReference;
71
+ repositoryURL = "https://github.com/kean/Nuke";
72
+ requirement = {
73
+ kind = upToNextMajorVersion;
74
+ minimumVersion = 12.1.6;
75
+ };
76
+ };
77
+ /* End XCRemoteSwiftPackageReference section */
78
+ };
79
+ rootObject = F1465EF523AA94BF0055F7C3 /* Project object */;
80
+ }
@@ -0,0 +1,256 @@
1
+ {
2
+ "pins" : [
3
+ {
4
+ "identity" : "abseil-cpp-binary",
5
+ "kind" : "remoteSourceControl",
6
+ "location" : "https://github.com/google/abseil-cpp-binary.git",
7
+ "state" : {
8
+ "revision" : "bfc0b6f81adc06ce5121eb23f628473638d67c5c",
9
+ "version" : "1.2022062300.0"
10
+ }
11
+ },
12
+ {
13
+ "identity" : "analytics-swift",
14
+ "kind" : "remoteSourceControl",
15
+ "location" : "git@github.com:hbmartin/analytics-swift.git",
16
+ "state" : {
17
+ "branch" : "main",
18
+ "revision" : "81ed4a83fc87ef074bb71b2b0bced199811dc3bb"
19
+ }
20
+ },
21
+ {
22
+ "identity" : "firebase-ios-sdk",
23
+ "kind" : "remoteSourceControl",
24
+ "location" : "https://github.com/firebase/firebase-ios-sdk",
25
+ "state" : {
26
+ "revision" : "8a8ec57a272e0d31480fb0893dda0cf4f769b57e",
27
+ "version" : "10.15.0"
28
+ }
29
+ },
30
+ {
31
+ "identity" : "googleappmeasurement",
32
+ "kind" : "remoteSourceControl",
33
+ "location" : "https://github.com/google/GoogleAppMeasurement.git",
34
+ "state" : {
35
+ "revision" : "03b9beee1a61f62d32c521e172e192a1663a5e8b",
36
+ "version" : "10.13.0"
37
+ }
38
+ },
39
+ {
40
+ "identity" : "googledatatransport",
41
+ "kind" : "remoteSourceControl",
42
+ "location" : "https://github.com/google/GoogleDataTransport.git",
43
+ "state" : {
44
+ "revision" : "aae45a320fd0d11811820335b1eabc8753902a40",
45
+ "version" : "9.2.5"
46
+ }
47
+ },
48
+ {
49
+ "identity" : "googleutilities",
50
+ "kind" : "remoteSourceControl",
51
+ "location" : "https://github.com/google/GoogleUtilities.git",
52
+ "state" : {
53
+ "revision" : "c38ce365d77b04a9a300c31061c5227589e5597b",
54
+ "version" : "7.11.5"
55
+ }
56
+ },
57
+ {
58
+ "identity" : "grpc-binary",
59
+ "kind" : "remoteSourceControl",
60
+ "location" : "https://github.com/google/grpc-binary.git",
61
+ "state" : {
62
+ "revision" : "f1b366129d1125be7db83247e003fc333104b569",
63
+ "version" : "1.50.2"
64
+ }
65
+ },
66
+ {
67
+ "identity" : "gtm-session-fetcher",
68
+ "kind" : "remoteSourceControl",
69
+ "location" : "https://github.com/google/gtm-session-fetcher.git",
70
+ "state" : {
71
+ "revision" : "d415594121c9e8a4f9d79cecee0965cf35e74dbd",
72
+ "version" : "3.1.1"
73
+ }
74
+ },
75
+ {
76
+ "identity" : "interop-ios-for-google-sdks",
77
+ "kind" : "remoteSourceControl",
78
+ "location" : "https://github.com/google/interop-ios-for-google-sdks.git",
79
+ "state" : {
80
+ "revision" : "2d12673670417654f08f5f90fdd62926dc3a2648",
81
+ "version" : "100.0.0"
82
+ }
83
+ },
84
+ {
85
+ "identity" : "leveldb",
86
+ "kind" : "remoteSourceControl",
87
+ "location" : "https://github.com/firebase/leveldb.git",
88
+ "state" : {
89
+ "revision" : "0706abcc6b0bd9cedfbb015ba840e4a780b5159b",
90
+ "version" : "1.22.2"
91
+ }
92
+ },
93
+ {
94
+ "identity" : "lookingglassui",
95
+ "kind" : "remoteSourceControl",
96
+ "location" : "https://github.com/ryanlintott/LookingGlassUI",
97
+ "state" : {
98
+ "revision" : "3257e1b5392a8b39e4620e09cfdb672d2be42855",
99
+ "version" : "0.3.1"
100
+ }
101
+ },
102
+ {
103
+ "identity" : "maplibre-gl-native-distribution",
104
+ "kind" : "remoteSourceControl",
105
+ "location" : "https://github.com/maplibre/maplibre-gl-native-distribution",
106
+ "state" : {
107
+ "revision" : "ffda61e298c1490d4860d5184e80d618aaadc089",
108
+ "version" : "5.13.0"
109
+ }
110
+ },
111
+ {
112
+ "identity" : "nanopb",
113
+ "kind" : "remoteSourceControl",
114
+ "location" : "https://github.com/firebase/nanopb.git",
115
+ "state" : {
116
+ "revision" : "819d0a2173aff699fb8c364b6fb906f7cdb1a692",
117
+ "version" : "2.30909.0"
118
+ }
119
+ },
120
+ {
121
+ "identity" : "phonenumberkit",
122
+ "kind" : "remoteSourceControl",
123
+ "location" : "https://github.com/marmelroy/PhoneNumberKit.git",
124
+ "state" : {
125
+ "revision" : "b456f2f9be10c1d183158220b831afd22697dd68",
126
+ "version" : "3.7.4"
127
+ }
128
+ },
129
+ {
130
+ "identity" : "promises",
131
+ "kind" : "remoteSourceControl",
132
+ "location" : "https://github.com/google/promises.git",
133
+ "state" : {
134
+ "revision" : "e70e889c0196c76d22759eb50d6a0270ca9f1d9e",
135
+ "version" : "2.3.1"
136
+ }
137
+ },
138
+ {
139
+ "identity" : "sentry-cocoa",
140
+ "kind" : "remoteSourceControl",
141
+ "location" : "https://github.com/getsentry/sentry-cocoa.git",
142
+ "state" : {
143
+ "revision" : "14aa6e47b03b820fd2b338728637570b9e969994",
144
+ "version" : "8.12.0"
145
+ }
146
+ },
147
+ {
148
+ "identity" : "sovran-swift",
149
+ "kind" : "remoteSourceControl",
150
+ "location" : "https://github.com/segmentio/Sovran-Swift.git",
151
+ "state" : {
152
+ "revision" : "64f3b5150c282a34af4578188dce2fd597e600e3",
153
+ "version" : "1.1.0"
154
+ }
155
+ },
156
+ {
157
+ "identity" : "swift-algorithms",
158
+ "kind" : "remoteSourceControl",
159
+ "location" : "https://github.com/apple/swift-algorithms.git",
160
+ "state" : {
161
+ "revision" : "bcd4f369ac962bc3e5244c9df778739f8f5bdbf1",
162
+ "version" : "1.1.0"
163
+ }
164
+ },
165
+ {
166
+ "identity" : "swift-argument-parser",
167
+ "kind" : "remoteSourceControl",
168
+ "location" : "https://github.com/apple/swift-argument-parser.git",
169
+ "state" : {
170
+ "revision" : "8f4d2753f0e4778c76d5f05ad16c74f707390531",
171
+ "version" : "1.2.3"
172
+ }
173
+ },
174
+ {
175
+ "identity" : "swift-asn1",
176
+ "kind" : "remoteSourceControl",
177
+ "location" : "https://github.com/apple/swift-asn1.git",
178
+ "state" : {
179
+ "revision" : "3664efa98bd302ec90e5b27ee1c0649fbcc365bc"
180
+ }
181
+ },
182
+ {
183
+ "identity" : "swift-case-paths",
184
+ "kind" : "remoteSourceControl",
185
+ "location" : "https://github.com/pointfreeco/swift-case-paths",
186
+ "state" : {
187
+ "revision" : "5da6989aae464f324eef5c5b52bdb7974725ab81",
188
+ "version" : "1.0.0"
189
+ }
190
+ },
191
+ {
192
+ "identity" : "swift-custom-dump",
193
+ "kind" : "remoteSourceControl",
194
+ "location" : "https://github.com/pointfreeco/swift-custom-dump",
195
+ "state" : {
196
+ "revision" : "3efbfba0e4e56c7187cc19137ee16b7c95346b79",
197
+ "version" : "1.1.0"
198
+ }
199
+ },
200
+ {
201
+ "identity" : "swift-numerics",
202
+ "kind" : "remoteSourceControl",
203
+ "location" : "https://github.com/apple/swift-numerics.git",
204
+ "state" : {
205
+ "revision" : "0a5bc04095a675662cf24757cc0640aa2204253b",
206
+ "version" : "1.0.2"
207
+ }
208
+ },
209
+ {
210
+ "identity" : "swift-protobuf",
211
+ "kind" : "remoteSourceControl",
212
+ "location" : "https://github.com/apple/swift-protobuf.git",
213
+ "state" : {
214
+ "revision" : "cf62cdaea48b77f1a631e5cb3aeda6047c2cba1d",
215
+ "version" : "1.23.0"
216
+ }
217
+ },
218
+ {
219
+ "identity" : "swift-snapshot-testing",
220
+ "kind" : "remoteSourceControl",
221
+ "location" : "https://github.com/pointfreeco/swift-snapshot-testing",
222
+ "state" : {
223
+ "revision" : "696b86a6d151578bca7c1a2a3ed419a5f834d40f",
224
+ "version" : "1.13.0"
225
+ }
226
+ },
227
+ {
228
+ "identity" : "swift-syntax",
229
+ "kind" : "remoteSourceControl",
230
+ "location" : "https://github.com/apple/swift-syntax.git",
231
+ "state" : {
232
+ "revision" : "74203046135342e4a4a627476dd6caf8b28fe11b",
233
+ "version" : "509.0.0"
234
+ }
235
+ },
236
+ {
237
+ "identity" : "swiftui-navigation",
238
+ "kind" : "remoteSourceControl",
239
+ "location" : "https://github.com/pointfreeco/swiftui-navigation",
240
+ "state" : {
241
+ "revision" : "6eb293c49505d86e9e24232cb6af6be7fff93bd5",
242
+ "version" : "1.0.2"
243
+ }
244
+ },
245
+ {
246
+ "identity" : "xctest-dynamic-overlay",
247
+ "kind" : "remoteSourceControl",
248
+ "location" : "https://github.com/pointfreeco/xctest-dynamic-overlay",
249
+ "state" : {
250
+ "revision" : "23cbf2294e350076ea4dbd7d5d047c1e76b03631",
251
+ "version" : "1.0.2"
252
+ }
253
+ }
254
+ ],
255
+ "version" : 2
256
+ }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: danger-spm_version_updates
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Harold Martin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-15 00:00:00.000000000 Z
11
+ date: 2024-03-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: danger-plugin-api
@@ -316,6 +316,8 @@ files:
316
316
  - spec/support/fixtures/Branch.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
317
317
  - spec/support/fixtures/ExactVersion.xcodeproj/project.pbxproj
318
318
  - spec/support/fixtures/ExactVersion.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
319
+ - spec/support/fixtures/NoResolvedVersion.xcodeproj/project.pbxproj
320
+ - spec/support/fixtures/NoResolvedVersion.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
319
321
  - spec/support/fixtures/UpToNextMajor.xcodeproj/project.pbxproj
320
322
  - spec/support/fixtures/UpToNextMajor.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
321
323
  - spec/support/fixtures/VersionRange.xcodeproj/project.pbxproj