Skip to content

Commit c291b4a

Browse files
authored
Merge pull request #6428 from theotherjimmy/many-source-export
Avoid incorrect config errors on export with many --source
2 parents 50773b1 + cd31272 commit c291b4a

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

tools/export/__init__.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -315,13 +315,11 @@ def export_project(src_paths, export_path, target, ide, libraries_paths=None,
315315
name = basename(normpath(abspath(src_paths[0])))
316316

317317
# Call unified scan_resources
318-
resource_dict = {loc: scan_resources(path, toolchain, inc_dirs=inc_dirs, collect_ignores=True)
318+
resource_dict = {loc: sum((toolchain.scan_resources(p, collect_ignores=True)
319+
for p in path),
320+
Resources())
319321
for loc, path in src_paths.items()}
320322
resources = Resources()
321-
toolchain.build_dir = export_path
322-
config_header = toolchain.get_config_header()
323-
resources.headers.append(config_header)
324-
resources.file_basepath[config_header] = dirname(config_header)
325323

326324
if zip_proj:
327325
subtract_basepath(resources, ".")
@@ -333,6 +331,13 @@ def export_project(src_paths, export_path, target, ide, libraries_paths=None,
333331
for _, res in resource_dict.items():
334332
resources.add(res)
335333

334+
toolchain.build_dir = export_path
335+
toolchain.config.load_resources(resources)
336+
toolchain.set_config_data(toolchain.config.get_config_data())
337+
config_header = toolchain.get_config_header()
338+
resources.headers.append(config_header)
339+
resources.file_basepath[config_header] = dirname(config_header)
340+
336341
# Change linker script if specified
337342
if linker_script is not None:
338343
resources.linker_script = linker_script

0 commit comments

Comments
 (0)