Clone of official tools

Revision:
23:fbae331171fa
Parent:
13:ab47a20b66f0
Child:
24:25bff2709c20
diff -r 9e85236d8716 -r fbae331171fa export/exporters.py
--- 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 = []