Skip to content

Commit bd89e12

Browse files
author
Bogdan Marinescu
committed
Added build script for travis (build_travis.py)
1 parent e69956a commit bd89e12

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
install: "sudo $TRAVIS_BUILD_DIR/travis/install_dependencies.sh > /dev/null"
33
python:
44
- "2.7"
5-
script: "python workspace_tools/build.py -r -e -U -u -d -b -t GCC_ARM"
5+
script: "python workspace_tools/build_travis.py"

workspace_tools/build_travis.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Travis-CI build script
2+
3+
import os
4+
import sys
5+
6+
################################################################################
7+
# Configure builds here
8+
# "libs" can contain "dsp", "rtos", "eth", "usb_host", "usb", "ublox"
9+
10+
build_list = (
11+
{ "target": "LPC1768", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "eth", "usb_host", "usb", "ublox"] },
12+
{ "target": "KL25Z", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "usb"] },
13+
{ "target": "LPC4088", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "usb"] },
14+
)
15+
16+
################################################################################
17+
# Driver
18+
19+
def run_builds(dry_run):
20+
for build in build_list:
21+
toolchain_list = build["toolchains"]
22+
if type(toolchain_list) != type([]): toolchain_list = [toolchain_list]
23+
for toolchain in toolchain_list:
24+
cmdline = "python workspace_tools/build.py -m %s -t %s -c " % (build["target"], toolchain)
25+
libs = build.get("libs", [])
26+
if libs:
27+
cmdline = cmdline + " ".join(["--" + l for l in libs])
28+
if dry_run:
29+
print(cmdline)
30+
else:
31+
if os.system(cmdline) != 0:
32+
sys.exit(1)
33+
34+
if __name__ == "__main__":
35+
run_builds("-s" in sys.argv)

0 commit comments

Comments
 (0)