From 99579aade103542da434f18e6719693acde317ce Mon Sep 17 00:00:00 2001 From: Alexander Lukichev Date: Tue, 9 May 2017 13:19:32 +0300 Subject: [PATCH] Try another tag name when looking for project files. Between STM32CubeMX versions 4.12.0 and 4.20.1 there has been a change in generated .cproject file format: source file paths are specified by "locationURI" tag in the older version and by "location" in another. This helps locate source files in both older and newer .cproject files. Signed-off-by: Alexander Lukichev --- ST2Makefile.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ST2Makefile.py b/ST2Makefile.py index dfd1fcf..e758466 100644 --- a/ST2Makefile.py +++ b/ST2Makefile.py @@ -86,6 +86,8 @@ def replace_path(text): sys.stderr.write("Error: cannot parse TrueSTUDIO .project file: %s\r\n" % ts_project) sys.exit(T2M_ERR_PROJECT_FILE) nodes = root.findall('linkedResources/link[type=\'1\']/locationURI') +if not nodes: + nodes = root.findall('linkedResources/link[type=\'1\']/location') sources = [] for node in nodes: sources.append(replace_path(node.text))