fastlane-plugin-xcodetestcoverage 1.0.2 → 1.0.3

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: fbbeb5ada9ae797c979dc0400ea7bb0e20fec4fa20c50c7541e340fa179de39a
4
- data.tar.gz: eaf4dd8e7c14280ea49ca6df7ee8692b78d3bfad85ff35353b47f3f0f8273175
3
+ metadata.gz: 28e58f915de088334b8b586ab4bcd9718da8289aad879bb67ab7bcb3ee03aa8e
4
+ data.tar.gz: 96a3e4386aec4bbe17401fefa1c37f9be5dc00d5fc22f1fce38aa3199fe69a68
5
5
  SHA512:
6
- metadata.gz: f5283f51ab7317c0184c4df2cf22c21151c1e46daed21c1e1fad5ef30336656c84c042f3d6852f4cc04385bac94f88b34ff76983498d3332c02e93e9c0b24f59
7
- data.tar.gz: '09cf0f7cbb343d30e0b7eee1c46735389d11f68b58239ed9b6755b93a10edde78c07ccada618b9fba9c9c8965029bfc80cacae886648d872cf473ee68dedb487'
6
+ metadata.gz: d6a76c7821b6d2fd0d9891b85c40828cf1d80283d0c31927d82aa7fee3dce2c159adaffe8c7d82024d3302147af84e2f8eb8ee681afa4edb95673bb91ca60c89
7
+ data.tar.gz: 2c46b94fde49c93fdf9fe6b1e9c1950adf9d718a8f9d1f5d75e87e826faacd2cced3cf9093d818da5351f9391fdd1a617cb5403bc469e7a5f710d31709dcd356
data/README.md CHANGED
@@ -38,6 +38,8 @@ type: Proc
38
38
 
39
39
  coverageExceptionCallback - Optional coverage exception callback argument" optional: true, type: Proc
40
40
 
41
+ xcresultPath - alternative path to xcresult, optional: true, type: String
42
+
41
43
  ## Example
42
44
 
43
45
  Check out the [example `Fastfile`](fastlane/Fastfile) to see how to use this plugin. Try it by cloning the repo, running `fastlane install_plugins` and `bundle exec fastlane tests`.
@@ -62,7 +64,13 @@ xcodetestcoverage(minimumCoveragePercentage: 45.0,
62
64
  }
63
65
  )
64
66
  ```
65
-
67
+ You can use alternative path to xcresult. In this case, running a test via fastlane (with the command scan or run_tests) before xcodetestcoverage is optional.
68
+ ```bash
69
+ reportPath = "test.xcresult"
70
+ xcodetestcoverage(minimumCoveragePercentage: 30.0,
71
+ enableDataFailedException: true,
72
+ xcresultPath: reportPath)
73
+ ```
66
74
 
67
75
  ## Issues and Feedback
68
76
 
@@ -8,12 +8,15 @@ module Fastlane
8
8
  enableDataFailedException = params[:enableDataFailedException]
9
9
  minimumCoveragePercentage = params[:minimumCoveragePercentage]
10
10
  enableDefaultCoverageException = params[:enableDefaultCoverageException]
11
+ filePath = params[:xcresultPath]
11
12
  lineCoverage = nil
12
13
  coveredLines = nil
13
14
  executableLines = nil
14
15
 
15
- filePath = lane_context[SharedValues::SCAN_GENERATED_XCRESULT_PATH]
16
-
16
+ if !filePath
17
+ filePath = lane_context[SharedValues::SCAN_GENERATED_XCRESULT_PATH]
18
+ end
19
+
17
20
  if filePath && File.exists?(filePath)
18
21
  jsonResult = sh "xcrun xccov view --only-targets --report '#{filePath}' --json"
19
22
  if lineCoverageMatch = jsonResult.match('.*lineCoverage":(\d+.\d+).*')
@@ -101,7 +104,14 @@ module Fastlane
101
104
  key: :coverageExceptionCallback,
102
105
  description: "Optional coverage exception callback argument",
103
106
  optional: true,
104
- type: Proc)
107
+ type: Proc),
108
+
109
+ FastlaneCore::ConfigItem.new(
110
+ key: :xcresultPath,
111
+ env_name: "XCODETESTCOVERAGE_XCRESULTPATH",
112
+ description: "Alternative path to xcresult",
113
+ type: String,
114
+ optional: true)
105
115
  ]
106
116
  end
107
117
 
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Xcodetestcoverage
3
- VERSION = "1.0.2"
3
+ VERSION = "1.0.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-xcodetestcoverage
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yury Savitsky