slather 2.8.5 → 2.8.6

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: 8b31a46c5d0af53d36513b448201896c97d6fb17724367390f65e4f7ced63101
4
- data.tar.gz: c5f8496a737ec10a79294a07b6da6a45676257aa9050f70879f0b3c51aa7b0bd
3
+ metadata.gz: 563be2e4074d110c301911497e05aafc0d08d167bcd31c7e5dc071a4f15cc15d
4
+ data.tar.gz: a8b335702c8fdc46378eed147e08f29a8a460b223a896b3e5185b1c68c9ee61d
5
5
  SHA512:
6
- metadata.gz: 9df9cc272e6528f31f72df7acdd8f747bd502db70785b90b388ca92a140ffb8e2fac6c10d76eecee098da6225645c5f70dc77c365a52ec7df19992d744fbc91e
7
- data.tar.gz: 7bc423a81f24a7faffa30f00941ada25fb1df3b19a11e26edbb74ff7efea4ff0e239fece6ffd7698dac14ee7e128896bf048d204be5e7a851e3ec35e7de0935f
6
+ metadata.gz: b261def42ccc80ef74fbf08a84a4cdf907eb1ca3c4dc2f5d7213f88b93e0dfebc8d9d0616d89bac919679e9fc2e6dc92be85e26948483c95e89d0354c2b52ade
7
+ data.tar.gz: 87e365c0986fa63a2098db6f77bcd539a10e031e8333b5144c967942e547870b784d770a4d1760d06e7bfad4c44813d9674dea2d917b0ccb98b04ee4bb1035d8
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## v2.8.6
4
+
5
+ * Apply dedupe to profdata coverage as well
6
+ [RoySRodney](https://github.com/RoySRodney)
7
+ [#579](https://github.com/SlatherOrg/slather/pull/579)
8
+
9
+ * Add Swift Package support
10
+ [michel-moreau](https://github.com/michel-moreau)
11
+ [#584](https://github.com/SlatherOrg/slather/pull/584)
12
+
13
+ * Bump nokogiri minimum version to fix security advisories
14
+ [carloskvasir](https://github.com/carloskvasir)
15
+ [#585](https://github.com/SlatherOrg/slather/pull/585)
16
+
3
17
  ## v2.8.5
4
18
 
5
19
  * Update xcodeproj to 1.27.1 to support Xcode 16 folder references
@@ -113,6 +113,8 @@ class CoverageCommand < Clamp::Command
113
113
  xcodeproj_path_to_open = xcodeproj_path || Slather::Project.yml["xcodeproj"]
114
114
  if xcodeproj_path_to_open
115
115
  project = Slather::Project.open(xcodeproj_path_to_open)
116
+ elsif File.exist?("Package.swift")
117
+ project = Slather::Project.open(".")
116
118
  else
117
119
  raise StandardError, "Must provide an xcodeproj either via the 'slather [SUBCOMMAND] [PROJECT].xcodeproj' command or through .slather.yml"
118
120
  end
@@ -50,7 +50,11 @@ module Slather
50
50
  alias_method :setup_for_coverage, :slather_setup_for_coverage
51
51
 
52
52
  def self.open(xcodeproj)
53
- proj = super
53
+ if File.directory?(xcodeproj) && File.exist?(File.join(xcodeproj, "Package.swift"))
54
+ proj = self.new(xcodeproj)
55
+ else
56
+ proj = super
57
+ end
54
58
  proj.xcodeproj = xcodeproj
55
59
  proj
56
60
  end
@@ -86,7 +90,11 @@ module Slather
86
90
  end
87
91
 
88
92
  if derived_data_path == nil
89
- derived_data_path = File.expand_path('~') + "/Library/Developer/Xcode/DerivedData/"
93
+ if File.exist?(File.join(self.xcodeproj, "Package.swift"))
94
+ derived_data_path = File.join(self.xcodeproj, ".build")
95
+ else
96
+ derived_data_path = File.expand_path('~') + "/Library/Developer/Xcode/DerivedData/"
97
+ end
90
98
  end
91
99
 
92
100
  derived_data_path
@@ -126,7 +134,11 @@ module Slather
126
134
  end
127
135
  end
128
136
 
129
- coverage_files
137
+ if coverage_files.empty?
138
+ raise StandardError, "No coverage files found."
139
+ else
140
+ dedupe(coverage_files)
141
+ end
130
142
  end
131
143
  private :profdata_coverage_files
132
144
 
@@ -201,10 +213,13 @@ module Slather
201
213
  private :create_profdata
202
214
 
203
215
  def remove_extension(path)
216
+ return "" if self.products.nil? || self.products.empty?
204
217
  path.split(".")[0..-2].join(".")
205
218
  end
206
219
 
207
220
  def first_product_name
221
+ # If products is nil it means we are likely using a Swift Package and not an xcodeproj
222
+ return "" if self.products.nil? || self.products.empty?
208
223
  first_product = self.products.first
209
224
  # If name is not available it computes it using
210
225
  # the path by dropping the 'extension' of the path.
@@ -216,11 +231,19 @@ module Slather
216
231
  raise StandardError, "The specified build directory (#{self.build_directory}) does not exist" unless File.exist?(self.build_directory)
217
232
  dir = nil
218
233
  if self.scheme
219
- dir = Dir[File.join(build_directory,"/**/CodeCoverage/#{self.scheme}")].first
234
+ product_name = first_product_name
235
+ if !product_name.empty?
236
+ dir = Dir[File.join(build_directory,"/**/#{product_name}")].first
237
+ end.first
220
238
  else
221
239
  dir = Dir[File.join(build_directory,"/**/#{first_product_name}")].first
222
240
  end
223
241
 
242
+ if dir == nil
243
+ # Swift Package Manager
244
+ dir = Dir[File.join(build_directory,"/**/codecov")].first
245
+ end
246
+
224
247
  if dir == nil
225
248
  # Xcode 7.3 moved the location of Coverage.profdata
226
249
  dir = Dir[File.join(build_directory,"/**/CodeCoverage")].first
@@ -379,6 +402,9 @@ module Slather
379
402
  end
380
403
 
381
404
  def configure_output_directory
405
+ if self.source_directory.nil? && File.exist?(File.join(self.xcodeproj, "Package.swift"))
406
+ self.source_directory = self.xcodeproj
407
+ end
382
408
  self.output_directory ||= self.class.yml["output_directory"] if self.class.yml["output_directory"]
383
409
  end
384
410
 
@@ -1,3 +1,3 @@
1
1
  module Slather
2
- VERSION = '2.8.5' unless defined?(Slather::VERSION)
2
+ VERSION = '2.8.6' unless defined?(Slather::VERSION)
3
3
  end
data/slather.gemspec CHANGED
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
29
29
 
30
30
  spec.add_dependency 'clamp', '~> 1.3'
31
31
  spec.add_dependency 'xcodeproj', '~> 1.27'
32
- spec.add_dependency 'nokogiri', '>= 1.14.3'
32
+ spec.add_dependency 'nokogiri', '>= 1.19.4'
33
33
  spec.add_dependency 'CFPropertyList', '>= 2.2', '< 4'
34
34
 
35
35
  spec.add_runtime_dependency 'activesupport'
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slather
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.5
4
+ version: 2.8.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Larsen
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-11-10 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: bundler
@@ -170,14 +169,14 @@ dependencies:
170
169
  requirements:
171
170
  - - ">="
172
171
  - !ruby/object:Gem::Version
173
- version: 1.14.3
172
+ version: 1.19.4
174
173
  type: :runtime
175
174
  prerelease: false
176
175
  version_requirements: !ruby/object:Gem::Requirement
177
176
  requirements:
178
177
  - - ">="
179
178
  - !ruby/object:Gem::Version
180
- version: 1.14.3
179
+ version: 1.19.4
181
180
  - !ruby/object:Gem::Dependency
182
181
  name: CFPropertyList
183
182
  requirement: !ruby/object:Gem::Requirement
@@ -212,7 +211,6 @@ dependencies:
212
211
  - - ">="
213
212
  - !ruby/object:Gem::Version
214
213
  version: '0'
215
- description:
216
214
  email:
217
215
  - mark@venmo.com
218
216
  executables:
@@ -326,7 +324,6 @@ homepage: https://github.com/SlatherOrg/slather
326
324
  licenses:
327
325
  - MIT
328
326
  metadata: {}
329
- post_install_message:
330
327
  rdoc_options: []
331
328
  require_paths:
332
329
  - lib
@@ -341,8 +338,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
341
338
  - !ruby/object:Gem::Version
342
339
  version: '0'
343
340
  requirements: []
344
- rubygems_version: 3.5.18
345
- signing_key:
341
+ rubygems_version: 4.0.22
346
342
  specification_version: 4
347
343
  summary: Test coverage reports for Xcode projects
348
344
  test_files: