Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of mbed-sdk-tools by
Diff: export/exporters.py
- Revision:
- 23:fbae331171fa
- Parent:
- 13:ab47a20b66f0
- Child:
- 24:25bff2709c20
--- a/export/exporters.py Sat Jul 16 00:34:03 2016 +0100 +++ b/export/exporters.py Sat Jul 16 22:51:17 2016 +0100 @@ -21,6 +21,8 @@ class OldLibrariesException(Exception): pass +class FailedBuildException(Exception) : pass + class Exporter(object): TEMPLATE_DIR = dirname(__file__) DOT_IN_RELATIVE_PATH = False @@ -107,7 +109,7 @@ } return project_data - def progen_gen_file(self, tool_name, project_data): + def progen_gen_file(self, tool_name, project_data, progen_build=False): """ Generate project using ProGen Project API """ settings = ProjectSettings() project = Project(self.program_name, [project_data], settings) @@ -115,6 +117,11 @@ # thinks it is not dict but a file, and adds them to workspace. project.project['common']['include_paths'] = self.resources.inc_dirs project.generate(tool_name, copied=not self.sources_relative) + if progen_build: + print("Project exported, building...") + result = project.build(tool_name) + if result == -1: + raise FailedBuildException("Build Failed") def __scan_all(self, path): resources = []