CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
Ardupilot

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: Ardupilot/ardupilot
Path: blob/master/Tools/scripts/build_examples.py
Views: 1798
1
#!/usr/bin/env python
2
3
# useful script to test the build of all example code
4
# This helps when doing large merges
5
# Peter Barker, June 2016
6
# based on build_examples.sh, Andrew Tridgell, November 2012
7
8
# AP_FLAKE8_CLEAN
9
10
import os
11
import sys
12
import optparse
13
14
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), '../autotest/pysim'))
15
16
import util # NOQA
17
18
19
class BuildExamples():
20
def __init__(self, targets=[], clean=False):
21
print("init")
22
self.targets = targets
23
self.clean = clean
24
25
def run(self):
26
for target in self.targets:
27
util.build_examples(target, clean=self.clean)
28
29
30
if __name__ == '__main__':
31
32
parser = optparse.OptionParser("build_examples.py")
33
parser.add_option(
34
"--target",
35
type='string',
36
default=['navio', 'Pixhawk1'],
37
help='list of targets for which to build examples', action='append'
38
)
39
parser.add_option("--clean", action='store_true', default=False, help='clean build')
40
opts, args = parser.parse_args()
41
42
buildexamples = BuildExamples(targets=opts.target, clean=opts.clean)
43
buildexamples.run()
44
45