xcov 0.9 → 0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -1
- data/lib/xcov/options.rb +18 -0
- data/lib/xcov/runner.rb +35 -18
- data/lib/xcov/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: 737f8ea92f893afc5a980b14d96eb2446459fddf
|
4
|
+
data.tar.gz: 01852ffe68f8afe3068c2fa0c06044518074df43
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6db9d575d18049bc4dcf766797f222a8bfdae1b6a171b804da3bcaf64ded9880666e9166eb7cf0c5c2a53fc087e20e0211c44d97e3944f92448efdc138a0405d
|
7
|
+
data.tar.gz: 6f718e72b58466a30fc0ad680ebdf8c1c7c9ba8f61a2918359aa78c95a9cf305ea7f08c94721d9191cc29bdca6bb7e159fad32c9c3cf495c02ed3881478f73e1
|
data/README.md
CHANGED
@@ -51,6 +51,9 @@ xcov -w LystSDK.xcworkspace -s LystSDK -o xcov_output
|
|
51
51
|
* `--exclude_targets`: Comma separated list of targets to exclude from coverage report.
|
52
52
|
* `--slack_url` `-i`: Incoming WebHook for your Slack group to post results (optional).
|
53
53
|
* `--slack_channel` `-e`: Slack channel where the results will be posted (optional).
|
54
|
+
* `--html_report`: Enables the creation of a html report. Enabled by default (optional).
|
55
|
+
* `--json_report`: Enables the creation of a json report (optional).
|
56
|
+
* `--markdown_report`: Enables the creation of a markdown report (optional).
|
54
57
|
* `--skip_slack`: Add this flag to avoid publishing results on Slack (optional).
|
55
58
|
|
56
59
|
### Ignoring files
|
@@ -86,7 +89,7 @@ xcov(
|
|
86
89
|
```
|
87
90
|
|
88
91
|
### [Danger](https://github.com/danger/danger)
|
89
|
-
With the *Danger* plugin you can receive your coverage reports directly on your pull requests. You can find more information on the plugin repository available [here](https://github.com/nakiostudio/danger-xcov
|
92
|
+
With the *Danger* plugin you can receive your coverage reports directly on your pull requests. You can find more information on the plugin repository available [here](https://github.com/nakiostudio/danger-xcov).
|
90
93
|
|
91
94
|
![screenshot](http://www.nakiostudio.com/danger-xcov.png)
|
92
95
|
|
@@ -95,6 +98,7 @@ With the *Danger* plugin you can receive your coverage reports directly on your
|
|
95
98
|
* [nakiostudio](https://github.com/nakiostudio)
|
96
99
|
* [opfeffer](https://github.com/opfeffer)
|
97
100
|
* [stevenreinisch](https://github.com/stevenreinisch)
|
101
|
+
* [hds](https://github.com/hds)
|
98
102
|
|
99
103
|
## License
|
100
104
|
This project is licensed under the terms of the MIT license. See the LICENSE file.
|
data/lib/xcov/options.rb
CHANGED
@@ -45,6 +45,24 @@ module Xcov
|
|
45
45
|
env_name: "XCOV_OUTPUT_DIRECTORY",
|
46
46
|
description: "The directory in which all reports will be stored",
|
47
47
|
default_value: File.join(containing, "xcov_report")),
|
48
|
+
FastlaneCore::ConfigItem.new(key: :html_report,
|
49
|
+
env_name: "XCOV_HTML_REPORT",
|
50
|
+
description: "Produce an HTML report",
|
51
|
+
optional: true,
|
52
|
+
is_string: false,
|
53
|
+
default_value: true),
|
54
|
+
FastlaneCore::ConfigItem.new(key: :markdown_report,
|
55
|
+
env_name: "XCOV_MARKDOWN_REPORT",
|
56
|
+
description: "Produce a Markdown report",
|
57
|
+
optional: true,
|
58
|
+
is_string: false,
|
59
|
+
default_value: false),
|
60
|
+
FastlaneCore::ConfigItem.new(key: :json_report,
|
61
|
+
env_name: "XCOV_JSON_REPORT",
|
62
|
+
description: "Produce a JSON report",
|
63
|
+
optional: true,
|
64
|
+
is_string: false,
|
65
|
+
default_value: false),
|
48
66
|
FastlaneCore::ConfigItem.new(key: :minimum_coverage_percentage,
|
49
67
|
short_option: "-m",
|
50
68
|
env_name: "XCOV_MINIMUM_COVERAGE_PERCENTAGE",
|
data/lib/xcov/runner.rb
CHANGED
@@ -31,30 +31,47 @@ module Xcov
|
|
31
31
|
# Create output path
|
32
32
|
output_path = Xcov.config[:output_directory]
|
33
33
|
FileUtils.mkdir_p(output_path)
|
34
|
-
resources_path = File.join(output_path, "resources")
|
35
|
-
FileUtils.mkdir_p(resources_path)
|
36
34
|
|
37
|
-
#
|
38
|
-
|
39
|
-
FileUtils.cp_r(path, resources_path)
|
40
|
-
end
|
35
|
+
# Convert report to xCov model objects
|
36
|
+
report = Report.map(report_json)
|
41
37
|
|
42
|
-
|
43
|
-
|
44
|
-
FileUtils.
|
38
|
+
if Xcov.config[:html_report] then
|
39
|
+
resources_path = File.join(output_path, "resources")
|
40
|
+
FileUtils.mkdir_p(resources_path)
|
41
|
+
|
42
|
+
# Copy images to output resources folder
|
43
|
+
Dir[File.join(File.dirname(__FILE__), "../../assets/images/*")].each do |path|
|
44
|
+
FileUtils.cp_r(path, resources_path)
|
45
|
+
end
|
46
|
+
|
47
|
+
# Copy stylesheets to output resources folder
|
48
|
+
Dir[File.join(File.dirname(__FILE__), "../../assets/stylesheets/*")].each do |path|
|
49
|
+
FileUtils.cp_r(path, resources_path)
|
50
|
+
end
|
51
|
+
|
52
|
+
# Copy javascripts to output resources folder
|
53
|
+
Dir[File.join(File.dirname(__FILE__), "../../assets/javascripts/*")].each do |path|
|
54
|
+
FileUtils.cp_r(path, resources_path)
|
55
|
+
end
|
56
|
+
|
57
|
+
# Create HTML report
|
58
|
+
File.open(File.join(output_path, "index.html"), "wb") do |file|
|
59
|
+
file.puts report.html_value
|
60
|
+
end
|
45
61
|
end
|
46
62
|
|
47
|
-
#
|
48
|
-
|
49
|
-
|
63
|
+
# Create Markdown report
|
64
|
+
if Xcov.config[:markdown_report] then
|
65
|
+
File.open(File.join(output_path, "report.md"), "wb") do |file|
|
66
|
+
file.puts report.markdown_value
|
67
|
+
end
|
50
68
|
end
|
51
69
|
|
52
|
-
#
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
file.puts report.html_value
|
70
|
+
# Create JSON report
|
71
|
+
if Xcov.config[:json_report] then
|
72
|
+
File.open(File.join(output_path, "report.json"), "wb") do |file|
|
73
|
+
file.puts report_json.to_json
|
74
|
+
end
|
58
75
|
end
|
59
76
|
|
60
77
|
# Post result
|
data/lib/xcov/version.rb
CHANGED
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: '0.
|
4
|
+
version: '0.10'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carlos Vidal
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06
|
11
|
+
date: 2016-07-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fastlane_core
|