|
| 1 | +""" |
| 2 | +mbed SDK |
| 3 | +Copyright (c) 2011-2013 ARM Limited |
| 4 | +
|
| 5 | +Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | +you may not use this file except in compliance with the License. |
| 7 | +You may obtain a copy of the License at |
| 8 | +
|
| 9 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +
|
| 11 | +Unless required by applicable law or agreed to in writing, software |
| 12 | +distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | +See the License for the specific language governing permissions and |
| 15 | +limitations under the License. |
| 16 | +""" |
| 17 | +import sys |
| 18 | +from time import time |
| 19 | +from os.path import join, abspath, dirname |
| 20 | + |
| 21 | +# Be sure that the tools directory is in the search path |
| 22 | +ROOT = abspath(join(dirname(__file__), "..")) |
| 23 | +sys.path.append(ROOT) |
| 24 | + |
| 25 | +from workspace_tools.build_api import build_mbed_libs |
| 26 | +from workspace_tools.targets import TARGET_MAP |
| 27 | + |
| 28 | + |
| 29 | +OFFICIAL_MBED_LIBRARY_BUILD = ( |
| 30 | + ('KL25Z', ('ARM',)), |
| 31 | + ('LPC11U24', ('ARM', 'uARM')), |
| 32 | + ('LPC1768', ('ARM', 'GCC_ARM', 'GCC_CR', 'GCC_CS', 'IAR')), |
| 33 | + ('LPC2368', ('ARM',)), |
| 34 | + ('LPC812', ('uARM',)), |
| 35 | + ('LPC1347', ('ARM',)), |
| 36 | + ('LPC4088', ('ARM',)) |
| 37 | +) |
| 38 | + |
| 39 | + |
| 40 | +if __name__ == '__main__': |
| 41 | + start = time() |
| 42 | + failures = [] |
| 43 | + successes = [] |
| 44 | + for target_name, toolchains in OFFICIAL_MBED_LIBRARY_BUILD: |
| 45 | + for toolchain in toolchains: |
| 46 | + id = "%s::%s" % (target_name, toolchain) |
| 47 | + try: |
| 48 | + build_mbed_libs(TARGET_MAP[target_name], toolchain) |
| 49 | + successes.append(id) |
| 50 | + except Exception, e: |
| 51 | + failures.append(id) |
| 52 | + print e |
| 53 | + |
| 54 | + # Write summary of the builds |
| 55 | + print "\n\nCompleted in: (%.2f)s" % (time() - start) |
| 56 | + |
| 57 | + if successes: |
| 58 | + print "\n\nBuild successes:" |
| 59 | + print "\n".join([" * %s" % s for s in successes]) |
| 60 | + |
| 61 | + if failures: |
| 62 | + print "\n\nBuild failures:" |
| 63 | + print "\n".join([" * %s" % f for f in failures]) |
0 commit comments