fastlane-plugin-merge_junit_report 0.1.1 → 0.1.2
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3716bcc208607f2d0575d51d729d02e24f5c344b
|
4
|
+
data.tar.gz: 06a769322105e450d733cbeeb6d82668a2743571
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3fa421899c5a53dac78598ff99ab40cdaf3c1eb981e9bf91056fba23072f3b95a23d6b897492b7ccd46798a95fd01ade7075ad0586f99ac1f5ff0551c1d930a9
|
7
|
+
data.tar.gz: df720f764e7426af86d5c4c82d6f33034d975e3da15dfb988202d67a5d8f5befe13494f6dce4cd565b2a55ad4249b931fdb12eaf87015e68dab1ef13954b903f
|
data/README.md
CHANGED
@@ -12,9 +12,7 @@ fastlane add_plugin merge_junit_report
|
|
12
12
|
|
13
13
|
## About merge_junit_report
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
**Note to author:** Add a more detailed description about this plugin here. If your plugin contains multiple actions, make sure to mention them here.
|
15
|
+
Merges multiple Junit reports into one.
|
18
16
|
|
19
17
|
## Example
|
20
18
|
|
@@ -1,20 +1,10 @@
|
|
1
1
|
module Fastlane
|
2
2
|
module Actions
|
3
3
|
class MergeJunitReportAction < Action
|
4
|
+
UI = FastlaneCore::UI
|
5
|
+
|
4
6
|
def self.run(params)
|
5
7
|
input_files = params[:input_files]
|
6
|
-
|
7
|
-
if input_files.length < 1
|
8
|
-
ui.error("No input files!")
|
9
|
-
return
|
10
|
-
end
|
11
|
-
|
12
|
-
input_files.each { |input_file|
|
13
|
-
if !File.file?(input_file)
|
14
|
-
ui.error("File not found: #{input_file}")
|
15
|
-
return
|
16
|
-
end
|
17
|
-
}
|
18
8
|
|
19
9
|
xml_docs = input_files.map { |file| Nokogiri::XML(File.open(file))}
|
20
10
|
merger = Fastlane::Plugin::MergeJunitReport::Merger.new(xml_docs)
|
@@ -22,9 +12,10 @@ module Fastlane
|
|
22
12
|
|
23
13
|
# write to output_file
|
24
14
|
output_file = File.absolute_path(params[:output_file])
|
15
|
+
FileUtils.mkdir_p(File.dirname(output_file))
|
25
16
|
File.write(output_file, merged.to_xml)
|
26
17
|
|
27
|
-
|
18
|
+
UI.success("Reports merged to #{output_file} successfully")
|
28
19
|
end
|
29
20
|
|
30
21
|
def self.description
|
@@ -45,7 +36,13 @@ module Fastlane
|
|
45
36
|
env_name: "MERGE_JUNIT_REPORT_INPUT_FILES",
|
46
37
|
description: "A list of junit report files to merge from",
|
47
38
|
optional: false,
|
48
|
-
type: Array
|
39
|
+
type: Array,
|
40
|
+
verify_block: proc do |input_files|
|
41
|
+
UI.user_error!("No input files!") if input_files.length < 1
|
42
|
+
input_files.each { |input_file|
|
43
|
+
UI.user_error!("File not found: #{input_file}") if !File.file?(input_file)
|
44
|
+
}
|
45
|
+
end),
|
49
46
|
FastlaneCore::ConfigItem.new(key: :output_file,
|
50
47
|
env_name: "MERGE_JUNIT_REPORT_OUTPUT_FILE",
|
51
48
|
description: "The output file where all input files will be merged into",
|
@@ -62,14 +59,6 @@ module Fastlane
|
|
62
59
|
# [:ios, :mac, :android].include?(platform)
|
63
60
|
true
|
64
61
|
end
|
65
|
-
|
66
|
-
class << self
|
67
|
-
attr_accessor :ui
|
68
|
-
end
|
69
|
-
|
70
|
-
def self.ui
|
71
|
-
@ui ||= FastlaneCore::UI.new
|
72
|
-
end
|
73
62
|
|
74
63
|
end
|
75
64
|
end
|