xcov 1.7.5 → 1.8.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
  SHA256:
3
- metadata.gz: ad78b9f52d699c7e6bf5dcc683bc4667554fc69195715a82421e94857c8d423b
4
- data.tar.gz: d7bd573a388548e5c4a5db7dae2ccadb15f2af07f8320d1306501bee2060075e
3
+ metadata.gz: 4526b635eb46bf75720b1500d99610a6cf613b7acbdb1c8ad5c92c44b01654cb
4
+ data.tar.gz: c75f27cdcaf0139d0851611aa265411ed6da2fc88ea03a825cf025a057fed304
5
5
  SHA512:
6
- metadata.gz: 6b85d2d86d36d973ea3c5c1955d65f52f49025e69ad3fa9f9cdd9ad04f448a7fbd51fab37be40d1d80c8ec11a08dede70e9283b3807917d8f2551685463173c0
7
- data.tar.gz: 7a7cbc59f9f5294e1ecdf0e897b42dc8cadcf21766c117f0b0063a6a7bcbc6e2eaa3c160c8007510bb69fd8193add232adbbf62c9fe22d5eb41e31839297c694
6
+ metadata.gz: 6e201d6e8d6948b48985cb0b1120b6548648b190c207dc0758511b14a353970d3bd5824cbf12e5d72f4f9d282e291268254e713d00bc12c4f3cb71c1dc827cfd
7
+ data.tar.gz: b0cbc01d2a6d0f542a85132c70c02d7927428fb4c79d91782e865ac356461229f33787f336f5e030eda15f538206183e0cd5d0852c8f591e081a395c5551ffc5
data/README.md CHANGED
@@ -61,6 +61,7 @@ xcov -w LystSDK.xcworkspace -s LystSDK -o xcov_output
61
61
  * `--source_directory` `-r`: The path to project's root directory (optional).
62
62
  * `--derived_data_path` `-j`: Path of your project `Derived Data` folder (optional).
63
63
  * `--xccov_file_direct_path` `-f`: Direct path to the xccoverage/xccovreport file to parse to generate code coverage (optional).
64
+ * `--cloned_source_packages_path` `-C`: Sets a custom path for Swift Package Manager dependencies (optional).
64
65
  * `--minimum_coverage_percentage` `-m`: Raise exception if overall coverage percentage is under this value (ie. 75.0).
65
66
  * `--include_test_targets`: Enables coverage reports for `.xctest` targets.
66
67
  * `--ignore_file_path` `-x`: Relative or absolute path to the file containing the list of ignored files.
@@ -79,7 +80,10 @@ xcov -w LystSDK.xcworkspace -s LystSDK -o xcov_output
79
80
  * `--coveralls_repo_token`: Repository token to be used by integrations not compatible with Coveralls (optional).
80
81
  * `--slack_username`: The username which is used to publish to slack (optional).
81
82
  * `--slack_message`: The message which is published together with a successful report (optional).
83
+ * `--xcconfig`: Use an extra XCCONFIG file to build your app (optional).
84
+ * `--ideFoundationPath`: Absolute path to the IDEFoundation.framework binary (optional).
82
85
  * `--legacy_support`: Enables parsing coverage reports generated by Xcode 9.2 or previous versions.
86
+ * `--is_swift_package`: Enables generating coverage reports for Package.swift derived projects.
83
87
 
84
88
  _**Note:** All paths you provide should be absolute and unescaped_
85
89
 
data/lib/xcov/manager.rb CHANGED
@@ -17,8 +17,10 @@ module Xcov
17
17
  Xcov.config = options
18
18
 
19
19
  # Set project options
20
- FastlaneCore::Project.detect_projects(options)
21
- Xcov.project = FastlaneCore::Project.new(options)
20
+ if !Xcov.config[:is_swift_package]
21
+ FastlaneCore::Project.detect_projects(options)
22
+ Xcov.project = FastlaneCore::Project.new(options)
23
+ end
22
24
 
23
25
  # Set ignored files handler
24
26
  Xcov.ignore_handler = IgnoreHandler.new
@@ -47,7 +49,7 @@ module Xcov
47
49
 
48
50
  # Find .xccoverage file
49
51
  # If no xccov direct path, use the old derived data path method
50
- if xccov_file_direct_paths.nil?
52
+ if xccov_file_direct_paths.empty?
51
53
  extension = Xcov.config[:legacy_support] ? "xccoverage" : "xccovreport"
52
54
 
53
55
  test_logs_path = derived_data_path + "Logs/Test/"
@@ -198,11 +200,11 @@ module Xcov
198
200
  def xccov_file_direct_paths
199
201
  # If xccov_file_direct_path was supplied, return
200
202
  if Xcov.config[:xccov_file_direct_path].nil?
201
- return nil
203
+ return []
202
204
  end
203
205
 
204
- path = Xcov.config[:xccov_file_direct_path]
205
- return [Pathname.new(path).to_s]
206
+ paths = Xcov.config[:xccov_file_direct_path]
207
+ return paths.map { |path| Pathname.new(path).to_s }
206
208
  end
207
209
 
208
210
  def process_xcresults!(xcresult_paths)
@@ -58,6 +58,10 @@ module Xcov
58
58
  # Create target objects
59
59
  targets = targets.map { |target| Target.map(target) }.sort { |lhs, rhs| lhs.name <=> rhs.name }
60
60
 
61
+ if !Xcov.config[:include_zero_targets]
62
+ targets = targets.select { |target| target.coverage > 0 }
63
+ end
64
+
61
65
  Report.new(targets)
62
66
  end
63
67
 
@@ -73,7 +77,9 @@ module Xcov
73
77
  filtered_targets = filtered_targets.select { |target| self.included_targets.include?(target["name"])}
74
78
  end
75
79
 
76
- supported_targets = Xcov.project.targets
80
+ filtered_targets = filtered_targets.select { |target| !target["files"].empty? }
81
+
82
+ supported_targets = Xcov.config[:is_swift_package] ? [] : Xcov.project.targets
77
83
  if Xcov.config[:only_project_targets] && !supported_targets.empty?
78
84
  filtered_targets = filtered_targets.select do |target|
79
85
  name = target["name"]
data/lib/xcov/options.rb CHANGED
@@ -77,12 +77,16 @@ module Xcov
77
77
  key: :xccov_file_direct_path,
78
78
  short_option: "-f",
79
79
  env_name: "XCOV_FILE_DIRECT_PATH",
80
- description: "The path to the xccoverage/xccovreport/xcresult file to parse to generate code coverage",
80
+ description: "The path or array of paths to the xccoverage/xccovreport/xcresult files to parse to generate code coverage",
81
+ type: Array,
81
82
  optional: true,
82
83
  verify_block: proc do |value|
83
- v = File.expand_path(value.to_s)
84
- raise "xccoverage/xccovreport/xcresult file does not exist".red unless File.exist?(v)
85
- raise "Invalid xccov file type (must be xccoverage, xccovreport, xcresult)".red unless value.end_with? "xccoverage" or value.end_with? "xccovreport" or value.end_with? "xcresult"
84
+ values = value.is_a?(String) ? [value] : value
85
+ values.each do |value|
86
+ v = File.expand_path(value.to_s)
87
+ raise "xccoverage/xccovreport/xcresult file does not exist".red unless File.exist?(v)
88
+ raise "Invalid xccov file type (must be xccoverage, xccovreport, xcresult)".red unless value.end_with? "xccoverage" or value.end_with? "xccovreport" or value.end_with? "xcresult"
89
+ end
86
90
  end
87
91
  ),
88
92
  FastlaneCore::ConfigItem.new(
@@ -101,6 +105,22 @@ module Xcov
101
105
  type: String,
102
106
  optional: true
103
107
  ),
108
+ FastlaneCore::ConfigItem.new(
109
+ key: :use_system_scm,
110
+ env_name: "XCOV_USE_SYSTEM_SCM",
111
+ description: "Lets xcodebuild use system's scm configuration",
112
+ optional: true,
113
+ is_string: false,
114
+ default_value: false
115
+ ),
116
+ FastlaneCore::ConfigItem.new(
117
+ key: :is_swift_package,
118
+ env_name: "XCOV_IS_SWIFT_PACKAGE",
119
+ description: "Enables generating coverage reports for Package.swift derived projects",
120
+ optional: true,
121
+ is_string: false,
122
+ default_value: false
123
+ ),
104
124
 
105
125
  # Report options
106
126
  FastlaneCore::ConfigItem.new(
@@ -189,6 +209,13 @@ module Xcov
189
209
  is_string: false,
190
210
  default_value: false
191
211
  ),
212
+ FastlaneCore::ConfigItem.new(
213
+ key: :include_zero_targets,
214
+ env_name: "XCOV_INCLUDE_ZERO_TARGETS",
215
+ description: "Final report will include target even if the coverage is 0%",
216
+ is_string: false,
217
+ default_value: true
218
+ ),
192
219
  FastlaneCore::ConfigItem.new(
193
220
  key: :exclude_targets,
194
221
  optional: true,
data/lib/xcov/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module Xcov
2
2
 
3
- VERSION = "1.7.5"
3
+ VERSION = "1.8.0"
4
4
  DESCRIPTION = "xcov is a friendly visualizer for Xcode's code coverage files"
5
5
 
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xcov
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.5
4
+ version: 1.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carlos Vidal
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-24 00:00:00.000000000 Z
11
+ date: 2022-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fastlane
@@ -142,6 +142,20 @@ dependencies:
142
142
  - - ">="
143
143
  - !ruby/object:Gem::Version
144
144
  version: '0'
145
+ - !ruby/object:Gem::Dependency
146
+ name: rspec
147
+ requirement: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - ">="
150
+ - !ruby/object:Gem::Version
151
+ version: '0'
152
+ type: :development
153
+ prerelease: false
154
+ version_requirements: !ruby/object:Gem::Requirement
155
+ requirements:
156
+ - - ">="
157
+ - !ruby/object:Gem::Version
158
+ version: '0'
145
159
  description: xcov is a friendly visualizer for Xcode's code coverage files
146
160
  email:
147
161
  - nakioparkour@gmail.com
@@ -209,7 +223,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
209
223
  - !ruby/object:Gem::Version
210
224
  version: '0'
211
225
  requirements: []
212
- rubygems_version: 3.0.3
226
+ rubygems_version: 3.2.3
213
227
  signing_key:
214
228
  specification_version: 4
215
229
  summary: xcov is a friendly visualizer for Xcode's code coverage files