-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.py
32 lines (29 loc) · 982 Bytes
/
build.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
import os
from os import path
packages = [
d[0] for d in os.walk('.')
if path.isdir(d[0]) and 'pubspec.yaml' in os.listdir(d[0])
]
error_count = 0
for package_dir in packages:
commands = [
f'cd ./{package_dir}',
'flutter packages get',
'flutter analyze',
'flutter test --coverage'
]
command = '&&'.join(commands)
return_code = os.system(command)
if return_code == 0:
print(f'{package_dir} built successfully')
print('=================================================\n')
else:
error_count += 1
print(f'{package_dir} failed to build')
print('=================================================\n')
package_count = len(packages)
print('=================================================\n')
print(f'{package_count - error_count}/{package_count} modules succeeded building')
print('=================================================\n')
if error_count > 0:
raise RuntimeError()