forked from atsamd-rs/atsamd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-all.py
executable file
·39 lines (28 loc) · 688 Bytes
/
build-all.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
#!/usr/bin/env python
import os
import yaml
import shlex
import subprocess
travis = yaml.safe_load(open('.travis.yml', 'r'))
for env in travis['env']:
words = shlex.split(env)
d = {}
for word in words:
key_value = word.split('=', 1)
d[key_value[0]] = key_value[1]
crate_dir = d["CRATE"]
cmd = [
'cargo',
'build',
]
examples = d.get("EXAMPLES", None)
if examples != None:
cmd.extend(shlex.split(examples))
features = d.get("FEATURES", None)
if features != None:
cmd.extend(shlex.split(features))
buildmode = d.get("BUILDMODE", None)
if buildmode != None:
cmd.extend(shlex.split(buildmode))
print(cmd)
subprocess.check_call(cmd, cwd=crate_dir)