@@ -104,33 +104,32 @@ def zip_export(file_name, prefix, resources, project_files, inc_repos):
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 , resource in resources .iteritems ():
108
- for res in [resource ] + resource .features .values ():
109
- to_zip = (
110
- res .headers + res .s_sources + res .c_sources + \
111
- res .cpp_sources + res .libraries + res .hex_files + \
112
- [res .linker_script ] + res .bin_files + res .objects + \
113
- res .json_files + res .lib_refs + res .lib_builds )
114
- if inc_repos :
115
- for directory in res .repo_dirs :
116
- for root , _ , files in walk (directory ):
117
- for repo_file in files :
118
- source = join (root , repo_file )
119
- to_zip .append (source )
120
- res .file_basepath [source ] = res .base_path
121
- to_zip += res .repo_files
122
- for source in to_zip :
123
- if source :
124
- zip_file .write (
125
- source ,
126
- join (prefix , loc ,
127
- relpath (source , res .file_basepath [source ])))
128
- for source in res .lib_builds :
129
- target_dir , _ = splitext (source )
130
- dest = join (prefix , loc ,
131
- relpath (target_dir , res .file_basepath [source ]),
132
- ".bld" , "bldrc" )
133
- zip_file .write (source , dest )
107
+ for loc , res in resources .iteritems ():
108
+ to_zip = (
109
+ res .headers + res .s_sources + res .c_sources + \
110
+ res .cpp_sources + res .libraries + res .hex_files + \
111
+ [res .linker_script ] + res .bin_files + res .objects + \
112
+ res .json_files + res .lib_refs + res .lib_builds )
113
+ if inc_repos :
114
+ for directory in res .repo_dirs :
115
+ for root , _ , files in walk (directory ):
116
+ for repo_file in files :
117
+ source = join (root , repo_file )
118
+ to_zip .append (source )
119
+ res .file_basepath [source ] = res .base_path
120
+ to_zip += res .repo_files
121
+ for source in to_zip :
122
+ if source :
123
+ zip_file .write (
124
+ source ,
125
+ join (prefix , loc ,
126
+ relpath (source , res .file_basepath [source ])))
127
+ for source in res .lib_builds :
128
+ target_dir , _ = splitext (source )
129
+ dest = join (prefix , loc ,
130
+ relpath (target_dir , res .file_basepath [source ]),
131
+ ".bld" , "bldrc" )
132
+ zip_file .write (source , dest )
134
133
135
134
136
135
@@ -223,8 +222,13 @@ def export_project(src_paths, export_path, target, ide, libraries_paths=None,
223
222
macros = macros )
224
223
files .append (config_header )
225
224
if zip_proj :
225
+ for resource in resource_dict .values ():
226
+ for label , res in resource .features .iteritems ():
227
+ if label not in toolchain .target .features :
228
+ resource .add (res )
226
229
if isinstance (zip_proj , basestring ):
227
- zip_export (join (export_path , zip_proj ), name , resource_dict , files , inc_repos )
230
+ zip_export (join (export_path , zip_proj ), name , resource_dict , files ,
231
+ inc_repos )
228
232
else :
229
233
zip_export (zip_proj , name , resource_dict , files , inc_repos )
230
234
0 commit comments