Merge pull request #4804 from johanstokking/fix/4802-copy-static-files

Copy static files only
pull/4786/head
Jimmy Brisson 2017-07-27 09:47:32 -05:00 committed by GitHub
commit 78a1eddf61
2 changed files with 12 additions and 8 deletions

View File

@ -344,13 +344,14 @@ def export_project(src_paths, export_path, target, ide, libraries_paths=None,
if label not in toolchain.target.features:
resource.add(res)
if isinstance(zip_proj, basestring):
zip_export(join(export_path, zip_proj), name, resource_dict, files,
inc_repos)
zip_export(join(export_path, zip_proj), name, resource_dict,
files + exporter.static_files, inc_repos)
else:
zip_export(zip_proj, name, resource_dict, files, inc_repos)
zip_export(zip_proj, name, resource_dict,
files + exporter.static_files, inc_repos)
else:
for exported in files:
if not exists(join(export_path, basename(exported))):
copyfile(exported, join(export_path, basename(exported)))
for static_file in exporter.static_files:
if not exists(join(export_path, basename(static_file))):
copyfile(static_file, join(export_path, basename(static_file)))
return exporter

View File

@ -72,8 +72,11 @@ class Exporter(object):
jinja_loader = FileSystemLoader(os.path.dirname(os.path.abspath(__file__)))
self.jinja_environment = Environment(loader=jinja_loader)
self.resources = resources
self.generated_files = [join(self.TEMPLATE_DIR, "GettingStarted.html"),
join(self.TEMPLATE_DIR, ".mbed")]
self.generated_files = []
self.static_files = (
join(self.TEMPLATE_DIR, "GettingStarted.html"),
join(self.TEMPLATE_DIR, ".mbed"),
)
self.builder_files_dict = {}
self.add_config()