-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmergeklint.py
executable file
·51 lines (41 loc) · 1.48 KB
/
mergeklint.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/env bash
import os, os.path, sys
import glob
from xml.etree import ElementTree
BASE_DIRECTORY = "/bitrise/src"
xml_files = [
"app/build/reports/ktlint/ktlint-checkstyle.xml",
"app/build/reports/detekt/detekt-checkstyle.xml",
"component/build/reports/ktlint/ktlint-checkstyle.xml",
"component/build/reports/detekt/detekt-checkstyle.xml",
"data/build/reports/ktlint/ktlint-checkstyle.xml",
"data/build/reports/detekt/ktlint-checkstyle.xml",
"domain/build/reports/ktlint/ktlint-checkstyle.xml",
"domain/build/reports/detekt/detekt-checkstyle.xml",
"extensions/build/reports/ktlint/ktlint-checkstyle.xml",
"extensions/build/reports/detekt/detekt-checkstyle.xml",
]
xml_element_tree = None
print("lkzsdlkasdkl")
for xml_file in xml_files:
print("12123")
if not os.path.exists(xml_file):
continue;
if os.stat(xml_file).st_size == 0:
continue;
print("12 qwq123")
data = ElementTree.parse(xml_file).getroot()
for result in data.iter('file'):
if xml_element_tree is None:
xml_element_tree = data
insertion_point = xml_element_tree.findall("./file")
else:
insertion_point.extend(result)
if xml_element_tree is not None:
# print(ElementTree.tostring(xml_element_tree))
f = open( "test.xml", 'w' )
f.write( "\n" )
f.write( ElementTree.tostring(xml_element_tree).decode("utf-8") )
f.close()
if os.path.exists(xml_file):
print("FILE_NOT_EXIST")