Merge pull request #6428 from theotherjimmy/many-source-export

Avoid incorrect config errors on export with many --source
pull/6467/head
Cruz Monrreal 2018-03-26 14:25:53 -05:00 committed by GitHub
commit c291b4ad32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 5 deletions

View File

@ -315,13 +315,11 @@ def export_project(src_paths, export_path, target, ide, libraries_paths=None,
name = basename(normpath(abspath(src_paths[0])))
# Call unified scan_resources
resource_dict = {loc: scan_resources(path, toolchain, inc_dirs=inc_dirs, collect_ignores=True)
resource_dict = {loc: sum((toolchain.scan_resources(p, collect_ignores=True)
for p in path),
Resources())
for loc, path in src_paths.items()}
resources = Resources()
toolchain.build_dir = export_path
config_header = toolchain.get_config_header()
resources.headers.append(config_header)
resources.file_basepath[config_header] = dirname(config_header)
if zip_proj:
subtract_basepath(resources, ".")
@ -333,6 +331,13 @@ def export_project(src_paths, export_path, target, ide, libraries_paths=None,
for _, res in resource_dict.items():
resources.add(res)
toolchain.build_dir = export_path
toolchain.config.load_resources(resources)
toolchain.set_config_data(toolchain.config.get_config_data())
config_header = toolchain.get_config_header()
resources.headers.append(config_header)
resources.file_basepath[config_header] = dirname(config_header)
# Change linker script if specified
if linker_script is not None:
resources.linker_script = linker_script