Skip to content

New exporter build tests #2754

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 22, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tools/export/exporters.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ def progen_get_project_data(self):
# provide default data, some tools don't require any additional
# tool specific settings

if not self.check_supported(self.NAME):
raise TargetNotSupportedException("Target not supported")

def make_key(src):
"""turn a source file into it's group name"""
key = os.path.basename(os.path.dirname(src))
Expand Down Expand Up @@ -186,9 +189,6 @@ def progen_gen_file(self, project_data):

def progen_build(self):
"""Build a project that was already generated by progen"""
print("Project {} exported, building for {}...".format(
self.project_name, self.NAME))
sys.stdout.flush()
builder = ToolsSupported().get_tool(self.NAME)
result = builder(self.builder_files_dict[self.NAME], ProjectSettings()).build_project()
if result == -1:
Expand Down
15 changes: 9 additions & 6 deletions tools/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from tools.project_api import export_project


def setup_project(ide, target, program=None, source_dir=None, build=None):
def setup_project(ide, target, program=None, source_dir=None, build=None, export_path=None):
"""Generate a name, if not provided, and find dependencies

Positional arguments:
Expand All @@ -39,7 +39,7 @@ def setup_project(ide, target, program=None, source_dir=None, build=None):
if source_dir:
# --source is used to generate IDE files to toolchain directly
# in the source tree and doesn't generate zip file
project_dir = source_dir[0]
project_dir = export_path or source_dir[0]
if program:
project_name = TESTS[program]
else:
Expand All @@ -63,7 +63,7 @@ def setup_project(ide, target, program=None, source_dir=None, build=None):


def export(target, ide, build=None, src=None, macros=None, project_id=None,
clean=False, zip_proj=False, options=None):
clean=False, zip_proj=False, options=None, export_path=None, silent=False):
"""Do an export of a project.

Positional arguments:
Expand All @@ -77,14 +77,17 @@ def export(target, ide, build=None, src=None, macros=None, project_id=None,
project_id - the name of the project
clean - start from a clean state before exporting
zip_proj - create a zip file or not

Returns an object of type Exporter (tools/exports/exporters.py)
"""
project_dir, name, src, lib = setup_project(ide, target, program=project_id,
source_dir=src, build=build)
source_dir=src, build=build, export_path=export_path)

zip_name = name+".zip" if zip_proj else None

export_project(src, project_dir, target, ide, clean=clean, name=name,
macros=macros, libraries_paths=lib, zip_proj=zip_name, options=options)
return export_project(src, project_dir, target, ide, clean=clean, name=name,
macros=macros, libraries_paths=lib, zip_proj=zip_name,
options=options, silent=silent)


def main():
Expand Down
Loading