3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'fastlane/lib/fastlane/junit_generator.rb', line 3
def self.generate(results)
containing_folder = ENV['FL_REPORT_PATH'] || FastlaneCore::FastlaneFolder.path || Dir.pwd
path = File.join(containing_folder, 'report.xml')
@steps = results
xml_path = File.join(Fastlane::ROOT, "lib/assets/report_template.xml.erb")
xml = ERB.new(File.read(xml_path)).result(binding)
xml = xml.gsub('system_', 'system-').delete("\e")
begin
File.write(path, xml)
rescue => ex
UI.error(ex)
UI.error("Couldn't save report.xml at path '#{File.expand_path(output_path)}', make sure you have write access to the containing directory.")
end
return path
end
|