forked from panda3d/panda3d
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_samples.py
More file actions
32 lines (26 loc) · 773 Bytes
/
build_samples.py
File metadata and controls
32 lines (26 loc) · 773 Bytes
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
import subprocess
import sys
import tempfile
SAMPLES_TO_BUILD = [
'asteroids',
]
SAMPLES_DIR = os.path.join(os.path.dirname(__file__), '..', 'samples')
def main():
build_base = tempfile.TemporaryDirectory()
dist_dir = tempfile.TemporaryDirectory()
for sample in SAMPLES_TO_BUILD:
sampledir = os.path.join(SAMPLES_DIR, sample)
os.chdir(sampledir)
args = [
sys.executable,
'setup.py',
'bdist_apps',
'--build-base', build_base.name,
'--dist-dir', dist_dir.name,
]
# This will raise a CalledProcessError if the build fails, which will cause
# this script to fail
subprocess.check_call(args)
if __name__ == '__main__':
main()