From 2af565c827181a833e0fb1d6215676efd1552001 Mon Sep 17 00:00:00 2001 From: Olaf Hagendorf Date: Tue, 30 Dec 2014 19:21:09 +0100 Subject: [PATCH 1/5] Update README.md --- workspace_tools/export/README.md | 1089 ++++++++++++++++++++++++------ 1 file changed, 901 insertions(+), 188 deletions(-) diff --git a/workspace_tools/export/README.md b/workspace_tools/export/README.md index 768b79cbfe..ca87279f63 100644 --- a/workspace_tools/export/README.md +++ b/workspace_tools/export/README.md @@ -1,195 +1,908 @@ -Exporter Toolchain/Platform Support +Exporter IDE/Platform Support ----------------------------------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LPCXpressoCode SourceryCoIDEDS-5GCC ARMIARKEIL uVision
NXP LPC1768
NXP LPC1549
NXP LPC11U24
NXP LPC812
NXP LPC4088
NXP LPC1347
NXP LPC1114
Freescale KL05Z
Freescale KL20D5M
Freescale KL25Z
Freescale KL46Z
Freescale K64F
ST Nucleo F030R8
ST Nucleo F103RB
Platformcodesourcerycoideds5_5emblocksgcc_armiarkdslpcxpressouvision
ST Nucleo F302R8
ST Nucleo F401RE
ST Nucleo L152RE
ARCH_BLE------
Nordic NRF51822
ARCH_GPRS--------
ARCH_MAX------
ARCH_PRO-
ARM_MPS2--------
BLE_SMURFS------
BLE_SMURFS_OTA--------
DISCO_F051R8-------
DISCO_F100RB-------
DISCO_F303VC------
DISCO_F334C8------
DISCO_F407VG-----
DISCO_F429ZI------
DISCO_L053C8-------
HRM1017------
K20D50M-----
K22F----
K64F----
KL05Z----
KL25Z----
KL43Z------
KL46Z-----
LPC1114----
LPC11C24-------
LPC11U24----
LPC11U24_301--------
LPC11U35_401-----
LPC11U35_501-----
LPC11U35_Y5_MBUG--------
LPC11U37_501--------
LPC11U68-------
LPC1347------
LPC1549----
LPC1768-
LPC2368-------
LPC4088----
LPC4330_M0---------
LPC4330_M4-----
LPC4337--------
LPC810---------
LPC812------
LPC824--------
LPCCAPPUCCINO-----
MTS_GAMBIT------
MTS_MDOT_F405RG----
MTS_MDOT_F411RE-----
NRF51822------
NRF51822_OTA--------
NRF51822_Y5_MBUG--------
NRF51_DK------
NRF51_DK_OTA--------
NRF51_DONGLE------
NUCLEO_F030R8----
NUCLEO_F070RB-----
NUCLEO_F072RB----
NUCLEO_F091RC-------
NUCLEO_F103RB------
NUCLEO_F302R8----
NUCLEO_F303RE-------
NUCLEO_F334R8----
NUCLEO_F401RE----
NUCLEO_F411RE----
NUCLEO_L053R8-----
NUCLEO_L152RE----
OC_MBUINO--------
RBLAB_BLENANO--------
RBLAB_NRF51822--------
RZ_A1H---------
SSCI824---------
STM32F3XX--------
STM32F407------
UBLOX_C027-
WALLBOT_BLE--------
XADOW_M0--------
+Total IDEs: 9 +
Total platforms: 74 +
Total permutations: 225 From b57fefbd0c19e7d3e25582f2af044fc7aaa5b6d2 Mon Sep 17 00:00:00 2001 From: ohagendorf Date: Tue, 30 Dec 2014 19:26:43 +0100 Subject: [PATCH 2/5] [workspace_tools] project.py adding 2 cmdline options - Adding an option to print a matrix similar to build.py -S with targets and supported IDEs - Adding an option to write README.md in workspace_tools/export --- workspace_tools/export/__init__.py | 58 +++++++++++++++++++++++++++++- workspace_tools/project.py | 32 ++++++++++++++++- 2 files changed, 88 insertions(+), 2 deletions(-) diff --git a/workspace_tools/export/__init__.py b/workspace_tools/export/__init__.py index e35785a66f..8cba2a453b 100644 --- a/workspace_tools/export/__init__.py +++ b/workspace_tools/export/__init__.py @@ -21,7 +21,7 @@ from shutil import copytree, rmtree from workspace_tools.utils import mkdir from workspace_tools.export import uvision4, codesourcery, codered, gccarm, ds5_5, iar, emblocks, coide, kds from workspace_tools.export.exporters import zip_working_directory_and_clean_up, OldLibrariesException -from workspace_tools.targets import EXPORT_MAP +from workspace_tools.targets import TARGET_NAMES, EXPORT_MAP EXPORTERS = { 'uvision': uvision4.Uvision4, @@ -118,3 +118,59 @@ def setup_user_prj(user_dir, prj_path, lib_paths=None): if lib_paths is not None: for lib_path in lib_paths: copy_tree(lib_path, join(user_lib, basename(lib_path))) + +def get_unique_supported_ides(): + """ Get list of all unique IDEs supported by targets """ + unique_supported_ides = [] + for key in EXPORTERS.iterkeys(): + unique_supported_ides.append(key) + return unique_supported_ides + +def mcu_ide_matrix(verbose_html=False, platform_filter=None): + """ Shows target map using prettytable """ + supported_ides = [] + for key in EXPORTERS.iterkeys(): + supported_ides.append(key) + supported_ides.sort() + from prettytable import PrettyTable, ALL # Only use it in this function so building works without extra modules + + # All tests status table print + columns = ["Platform"] + supported_ides + pt = PrettyTable(columns) + # Align table + for col in columns: + pt.align[col] = "c" + pt.align["Platform"] = "l" + + perm_counter = 0 + target_counter = 0 + for target in sorted(TARGET_NAMES): + target_counter += 1 + + row = [target] # First column is platform name + for ide in supported_ides: + text = "-" + if target in EXPORTERS[ide].TARGETS: + if verbose_html: + text = "✓" + else: + text = "x" + perm_counter += 1 + row.append(text) + pt.add_row(row) + + pt.border = True + pt.vrules = ALL + pt.hrules = ALL + # creates a html page suitable for a browser + # result = pt.get_html_string(format=True) if verbose_html else pt.get_string() + # creates a html page in a shorter format suitable for readme.md + result = pt.get_html_string() if verbose_html else pt.get_string() + result += "\n" + result += "Total IDEs: %d\n"% (len(supported_ides)) + if verbose_html: result += "
" + result += "Total platforms: %d\n"% (target_counter) + if verbose_html: result += "
" + result += "Total permutations: %d"% (perm_counter) + if verbose_html: result = result.replace("&", "&") + return result diff --git a/workspace_tools/project.py b/workspace_tools/project.py index 234fbd1e04..6f7fd1c473 100644 --- a/workspace_tools/project.py +++ b/workspace_tools/project.py @@ -8,7 +8,7 @@ from optparse import OptionParser from workspace_tools.paths import EXPORT_DIR, EXPORT_WORKSPACE, EXPORT_TMP from workspace_tools.paths import MBED_BASE, MBED_LIBRARIES -from workspace_tools.export import export, setup_user_prj, EXPORTERS +from workspace_tools.export import export, setup_user_prj, EXPORTERS, mcu_ide_matrix from workspace_tools.utils import args_error from workspace_tools.tests import TESTS, Test, TEST_MAP from workspace_tools.targets import TARGET_NAMES @@ -65,6 +65,18 @@ if __name__ == '__main__': default=False, help="list available programs in order and exit") + parser.add_option("-S", "--list-matrix", + action="store_true", + dest="supported_ides", + default=False, + help="displays supported matrix of MCUs and IDEs") + + parser.add_option("-E", + action="store_true", + dest="supported_ides_html", + default=False, + help="writes workspace_tools/export/README.md") + (options, args) = parser.parse_args() # Print available tests in order and exit @@ -72,6 +84,24 @@ if __name__ == '__main__': print '\n'.join(map(str, sorted(TEST_MAP.values()))) sys.exit() + # Only prints matrix of supported IDEs + if options.supported_ides: + print mcu_ide_matrix() + exit(0) + + # Only prints matrix of supported IDEs + if options.supported_ides_html: + html = mcu_ide_matrix(verbose_html=True) + f = open("./export/README.md","w") + try: + f.write("Exporter IDE/Platform Support\n") + f.write("-----------------------------------\n") + f.write("\n"); + f.write(html) + finally: + f.close() + exit(0) + # Clean Export Directory if options.clean: if exists(EXPORT_DIR): From f75f3c92e3b95eedb9fa1b082d03e6d7bc885b2e Mon Sep 17 00:00:00 2001 From: ohagendorf Date: Tue, 30 Dec 2014 20:08:36 +0100 Subject: [PATCH 3/5] [workspace_tools] project.py adding 2 cmdline options Forgot to remove an unsed method. --- workspace_tools/export/__init__.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/workspace_tools/export/__init__.py b/workspace_tools/export/__init__.py index 8cba2a453b..0b7164d73a 100644 --- a/workspace_tools/export/__init__.py +++ b/workspace_tools/export/__init__.py @@ -119,13 +119,6 @@ def setup_user_prj(user_dir, prj_path, lib_paths=None): for lib_path in lib_paths: copy_tree(lib_path, join(user_lib, basename(lib_path))) -def get_unique_supported_ides(): - """ Get list of all unique IDEs supported by targets """ - unique_supported_ides = [] - for key in EXPORTERS.iterkeys(): - unique_supported_ides.append(key) - return unique_supported_ides - def mcu_ide_matrix(verbose_html=False, platform_filter=None): """ Shows target map using prettytable """ supported_ides = [] From 28435e93bf0bace391015e34bffba66afc724338 Mon Sep 17 00:00:00 2001 From: Olaf Hagendorf Date: Mon, 26 Jan 2015 17:43:08 +0100 Subject: [PATCH 4/5] [workspace_tools] project.py - some changes ... ... suggested by PrzemekWirkus --- workspace_tools/export/README.html | 908 +++++++++++++++++++++++++++++ workspace_tools/project.py | 18 +- 2 files changed, 919 insertions(+), 7 deletions(-) create mode 100644 workspace_tools/export/README.html diff --git a/workspace_tools/export/README.html b/workspace_tools/export/README.html new file mode 100644 index 0000000000..a8797f9b5a --- /dev/null +++ b/workspace_tools/export/README.html @@ -0,0 +1,908 @@ +Exporter IDE/Platform Support +----------------------------------- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Platformcodesourcerycoideds5_5emblocksgcc_armiarkdslpcxpressouvision
ARCH_BLE------
ARCH_GPRS--------
ARCH_MAX------
ARCH_PRO-
ARM_MPS2--------
BLE_SMURFS------
BLE_SMURFS_OTA--------
DISCO_F051R8-------
DISCO_F100RB-------
DISCO_F303VC------
DISCO_F334C8------
DISCO_F407VG-----
DISCO_F429ZI------
DISCO_L053C8-------
HRM1017------
K20D50M-----
K22F----
K64F----
KL05Z----
KL25Z----
KL43Z------
KL46Z-----
LPC1114----
LPC11C24-------
LPC11U24----
LPC11U24_301--------
LPC11U35_401-----
LPC11U35_501-----
LPC11U35_Y5_MBUG--------
LPC11U37_501--------
LPC11U68-------
LPC1347------
LPC1549----
LPC1768-
LPC2368-------
LPC4088----
LPC4330_M0---------
LPC4330_M4-----
LPC4337--------
LPC810---------
LPC812------
LPC824--------
LPCCAPPUCCINO-----
MTS_GAMBIT------
MTS_MDOT_F405RG----
MTS_MDOT_F411RE-----
NRF51822------
NRF51822_OTA--------
NRF51822_Y5_MBUG--------
NRF51_DK------
NRF51_DK_OTA--------
NRF51_DONGLE------
NUCLEO_F030R8----
NUCLEO_F070RB-----
NUCLEO_F072RB----
NUCLEO_F091RC-------
NUCLEO_F103RB------
NUCLEO_F302R8----
NUCLEO_F303RE-------
NUCLEO_F334R8----
NUCLEO_F401RE----
NUCLEO_F411RE----
NUCLEO_L053R8-----
NUCLEO_L152RE----
OC_MBUINO--------
RBLAB_BLENANO--------
RBLAB_NRF51822--------
RZ_A1H---------
SSCI824---------
STM32F3XX--------
STM32F407------
UBLOX_C027-
WALLBOT_BLE--------
XADOW_M0--------
+Total IDEs: 9 +
Total platforms: 74 +
Total permutations: 225 \ No newline at end of file diff --git a/workspace_tools/project.py b/workspace_tools/project.py index 6f7fd1c473..b8f9e8452d 100644 --- a/workspace_tools/project.py +++ b/workspace_tools/project.py @@ -92,14 +92,18 @@ if __name__ == '__main__': # Only prints matrix of supported IDEs if options.supported_ides_html: html = mcu_ide_matrix(verbose_html=True) - f = open("./export/README.md","w") try: - f.write("Exporter IDE/Platform Support\n") - f.write("-----------------------------------\n") - f.write("\n"); - f.write(html) - finally: - f.close() + with open("./export/README.html","w") as f: # you have to rename README.htlm to README.md manually + f.write("Exporter IDE/Platform Support\n") + f.write("-----------------------------------\n") + f.write("\n"); + f.write(html) + f.close() + except IOError as e: + print "I/O error({0}): {1}".format(e.errno, e.strerror) + except: + print "Unexpected error:", sys.exc_info()[0] + raise exit(0) # Clean Export Directory From a9bde7df030b99d07bd4a0dc0aee43702ccd29cd Mon Sep 17 00:00:00 2001 From: Olaf Hagendorf Date: Tue, 27 Jan 2015 10:50:51 +0100 Subject: [PATCH 5/5] [workspace_tools] project.py - some more changes ... ... suggested by PrzemekWirkus --- workspace_tools/project.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/workspace_tools/project.py b/workspace_tools/project.py index b8f9e8452d..7bf165b0bd 100644 --- a/workspace_tools/project.py +++ b/workspace_tools/project.py @@ -93,12 +93,11 @@ if __name__ == '__main__': if options.supported_ides_html: html = mcu_ide_matrix(verbose_html=True) try: - with open("./export/README.html","w") as f: # you have to rename README.htlm to README.md manually + with open("./export/README.md","w") as f: f.write("Exporter IDE/Platform Support\n") f.write("-----------------------------------\n") - f.write("\n"); + f.write("\n") f.write(html) - f.close() except IOError as e: print "I/O error({0}): {1}".format(e.errno, e.strerror) except: