@@ -129,7 +129,7 @@ def scan_and_copy_resources(self, prj_paths, trg_path, relative=False):
129129 # Copy only the file for the required target and toolchain
130130 lib_builds = []
131131 # Create the configuration object
132- cfg = Config (self .target , prj_paths )
132+ config = Config (self .target , prj_paths )
133133 for src in ['lib' , 'src' ]:
134134 resources = reduce (add , [self .__scan_and_copy (join (path , src ), trg_path ) for path in prj_paths ])
135135 lib_builds .extend (resources .lib_builds )
@@ -155,15 +155,20 @@ def scan_and_copy_resources(self, prj_paths, trg_path, relative=False):
155155
156156 if not relative :
157157 # Final scan of the actual exported resources
158- self . resources = self .toolchain .scan_resources (trg_path )
159- self . resources .relative_to (trg_path , self .DOT_IN_RELATIVE_PATH )
158+ resources = self .toolchain .scan_resources (trg_path )
159+ resources .relative_to (trg_path , self .DOT_IN_RELATIVE_PATH )
160160 else :
161161 # use the prj_dir (source, not destination)
162- self .resources = reduce (add , [self .toolchain .scan_resources (path ) for path in prj_paths ])
163- # Add all JSON files discovered during scanning to the configuration object
164- cfg .add_config_files (self .resources .json_files )
165- # Get data from the configuration system
166- self .config_macros = cfg .get_config_data_macros ()
162+ resources = self .toolchain .scan_resources (prj_paths [0 ])
163+ for path in prj_paths [1 :]:
164+ resources .add (toolchain .scan_resources (path ))
165+
166+ # Loads the resources into the config system which might expand/modify resources based on config data
167+ self .resources = config .load_resources (resources )
168+
169+ # And add the configuration macros to the toolchain
170+ self .config_macros = config .get_config_data_macros ()
171+
167172 # Check the existence of a binary build of the mbed library for the desired target
168173 # This prevents exporting the mbed libraries from source
169174 # if not self.toolchain.mbed_libs:
0 commit comments