added build-all.py script
This commit is contained in:
parent
dcc4c1b65a
commit
139a065f2c
2 changed files with 61 additions and 0 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -1,3 +1,5 @@
|
|||
|
||||
bin/
|
||||
examples/sandbox.txt
|
||||
copy+paste.txt
|
||||
.*.db
|
||||
|
|
|
|||
59
build-all.py
Executable file
59
build-all.py
Executable file
|
|
@ -0,0 +1,59 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import subprocess;
|
||||
import time;
|
||||
import atexit;
|
||||
import os;
|
||||
import pickle;
|
||||
|
||||
PICKLEFILE = ".build-all.db"
|
||||
|
||||
try:
|
||||
with open(PICKLEFILE, "rb") as stream:
|
||||
ftimes = pickle.load(stream);
|
||||
except:
|
||||
ftimes = dict();
|
||||
|
||||
def dumpftimes():
|
||||
with open(PICKLEFILE, "wb") as stream:
|
||||
pickle.dump(ftimes, stream);
|
||||
|
||||
atexit.register(dumpftimes);
|
||||
|
||||
buildtypes = set();
|
||||
|
||||
for x in os.listdir("buildtypes"):
|
||||
buildtype = x[:-4];
|
||||
|
||||
if buildtype not in ftimes:
|
||||
ftimes[buildtype] = time.time();
|
||||
|
||||
buildtypes.add(buildtype);
|
||||
|
||||
for buildtype in sorted(buildtypes, key = lambda x: -ftimes[x]):
|
||||
print("\033[32m" f"$ make buildtype={buildtype}" "\033[0m");
|
||||
|
||||
result = subprocess.run(["make", f"buildtype={buildtype}"]);
|
||||
|
||||
if result.returncode:
|
||||
ftimes[buildtype] = time.time();
|
||||
print("subcommand failed!");
|
||||
exit(1);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in a new issue