|
2 | 2 | import sys
|
3 | 3 | from os.path import join, abspath, dirname, exists
|
4 | 4 | from os.path import basename, relpath, normpath
|
5 |
| -from os import makedirs |
| 5 | +from os import makedirs, walk |
6 | 6 | ROOT = abspath(join(dirname(__file__), ".."))
|
7 | 7 | sys.path.insert(0, ROOT)
|
8 | 8 | import copy
|
@@ -104,16 +104,28 @@ def zip_export(file_name, prefix, resources, project_files):
|
104 | 104 | with zipfile.ZipFile(file_name, "w") as zip_file:
|
105 | 105 | for prj_file in project_files:
|
106 | 106 | zip_file.write(prj_file, join(prefix, basename(prj_file)))
|
107 |
| - for loc, res in resources.iteritems(): |
108 |
| - for source in \ |
109 |
| - res.headers + res.s_sources + res.c_sources + res.cpp_sources +\ |
110 |
| - res.libraries + res.hex_files + [res.linker_script] +\ |
111 |
| - res.bin_files + res.objects + res.json_files: |
112 |
| - if source: |
113 |
| - zip_file.write(source, |
114 |
| - join(prefix, loc, |
115 |
| - relpath(source, |
116 |
| - res.file_basepath[source]))) |
| 107 | + for loc, resource in resources.iteritems(): |
| 108 | + print resource.features |
| 109 | + for res in [resource] + resource.features.values(): |
| 110 | + extras = [] |
| 111 | + for directory in res.repo_dirs: |
| 112 | + for root, _, files in walk(directory): |
| 113 | + for repo_file in files: |
| 114 | + source = join(root, repo_file) |
| 115 | + extras.append(source) |
| 116 | + res.file_basepath[source] = res.base_path |
| 117 | + for source in \ |
| 118 | + res.headers + res.s_sources + res.c_sources +\ |
| 119 | + res.cpp_sources + res.libraries + res.hex_files + \ |
| 120 | + [res.linker_script] + res.bin_files + res.objects + \ |
| 121 | + res.json_files + res.lib_refs + res.lib_builds + \ |
| 122 | + res.repo_files + extras: |
| 123 | + if source: |
| 124 | + zip_file.write( |
| 125 | + source, |
| 126 | + join(prefix, loc, |
| 127 | + relpath(source, res.file_basepath[source]))) |
| 128 | + |
117 | 129 |
|
118 | 130 |
|
119 | 131 | def export_project(src_paths, export_path, target, ide,
|
|
0 commit comments