mirror of https://github.com/ARMmbed/mbed-os.git
Remove duplicate files in zipped exports
The zipping function of the exporters would unconditionally add all files scanned by scan resources to a zip, including all of the files associated with each feature. This would conflict with `build_api.scan_resources` adding all of the files to the resources object that correspond to the enabled features. To resolve this difference in behavior, I made the zipping function oblivious to features and had the upper level function, which has access to the target configuration, do the proper merging.pull/3765/head
parent
aa6d673d70
commit
467bac1997
|
|
@ -104,8 +104,7 @@ def zip_export(file_name, prefix, resources, project_files, inc_repos):
|
|||
with zipfile.ZipFile(file_name, "w") as zip_file:
|
||||
for prj_file in project_files:
|
||||
zip_file.write(prj_file, join(prefix, basename(prj_file)))
|
||||
for loc, resource in resources.iteritems():
|
||||
for res in [resource] + resource.features.values():
|
||||
for loc, res in resources.iteritems():
|
||||
to_zip = (
|
||||
res.headers + res.s_sources + res.c_sources +\
|
||||
res.cpp_sources + res.libraries + res.hex_files + \
|
||||
|
|
@ -223,8 +222,13 @@ def export_project(src_paths, export_path, target, ide, libraries_paths=None,
|
|||
macros=macros)
|
||||
files.append(config_header)
|
||||
if zip_proj:
|
||||
for resource in resource_dict.values():
|
||||
for label, res in resource.features.iteritems():
|
||||
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,
|
||||
inc_repos)
|
||||
else:
|
||||
zip_export(zip_proj, name, resource_dict, files, inc_repos)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue