mirror of https://github.com/ARMmbed/mbed-os.git
Separate the import and compile steps for better integration with Jenkins
parent
ac5c685389
commit
f983292a6b
|
@ -52,20 +52,33 @@ def target_cross_toolchain(allowed_toolchains,
|
||||||
yield target, toolchain
|
yield target, toolchain
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
"""Entry point"""
|
"""Entry point"""
|
||||||
parser = ArgumentParser()
|
parser = ArgumentParser()
|
||||||
parser.add_argument(
|
subparsers = parser.add_subparsers()
|
||||||
|
import_cmd = subparsers.add_parser("import")
|
||||||
|
import_cmd.set_defaults(fn=do_import)
|
||||||
|
compile_cmd = subparsers.add_parser("compile")
|
||||||
|
compile_cmd.set_defaults(fn=do_compile)
|
||||||
|
compile_cmd.add_argument(
|
||||||
"toolchains", nargs="*", default=SUPPORTED_TOOLCHAINS,
|
"toolchains", nargs="*", default=SUPPORTED_TOOLCHAINS,
|
||||||
type=argparse_force_uppercase_type(SUPPORTED_TOOLCHAINS,
|
type=argparse_force_uppercase_type(SUPPORTED_TOOLCHAINS,
|
||||||
"toolchain"))
|
"toolchain"))
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
args.fn(args)
|
||||||
|
|
||||||
|
|
||||||
|
def do_import(_):
|
||||||
|
"""Do the import step of this process"""
|
||||||
|
for example, _ in EXAMPLES.iteritems():
|
||||||
|
subprocess.call(["mbed-cli", "import", example])
|
||||||
|
|
||||||
|
|
||||||
|
def do_compile(args):
|
||||||
|
"""Do the compile step"""
|
||||||
failures = []
|
failures = []
|
||||||
sucesses = []
|
sucesses = []
|
||||||
for example, requirements in EXAMPLES.iteritems():
|
for example, requirements in EXAMPLES.iteritems():
|
||||||
subprocess.call(["mbed-cli", "import", example])
|
|
||||||
os.chdir(basename(example))
|
os.chdir(basename(example))
|
||||||
for target, toolchain in target_cross_toolchain(args.toolchains,
|
for target, toolchain in target_cross_toolchain(args.toolchains,
|
||||||
**requirements):
|
**requirements):
|
||||||
|
|
Loading…
Reference in New Issue