(
subdict, subdict_path, data, aux_data, includes, check
)
| 269 | |
| 270 | |
| 271 | def LoadBuildFileIncludesIntoDict( |
| 272 | subdict, subdict_path, data, aux_data, includes, check |
| 273 | ): |
| 274 | includes_list = [] |
| 275 | if includes is not None: |
| 276 | includes_list.extend(includes) |
| 277 | if "includes" in subdict: |
| 278 | for include in subdict["includes"]: |
| 279 | # "include" is specified relative to subdict_path, so compute the real |
| 280 | # path to include by appending the provided "include" to the directory |
| 281 | # in which subdict_path resides. |
| 282 | relative_include = os.path.normpath( |
| 283 | os.path.join(os.path.dirname(subdict_path), include) |
| 284 | ) |
| 285 | includes_list.append(relative_include) |
| 286 | # Unhook the includes list, it's no longer needed. |
| 287 | del subdict["includes"] |
| 288 | |
| 289 | # Merge in the included files. |
| 290 | for include in includes_list: |
| 291 | if "included" not in aux_data[subdict_path]: |
| 292 | aux_data[subdict_path]["included"] = [] |
| 293 | aux_data[subdict_path]["included"].append(include) |
| 294 | |
| 295 | gyp.DebugOutput(gyp.DEBUG_INCLUDES, "Loading Included File: '%s'", include) |
| 296 | |
| 297 | MergeDicts( |
| 298 | subdict, |
| 299 | LoadOneBuildFile(include, data, aux_data, None, False, check), |
| 300 | subdict_path, |
| 301 | include, |
| 302 | ) |
| 303 | |
| 304 | # Recurse into subdictionaries. |
| 305 | for k, v in subdict.items(): |
| 306 | if isinstance(v, dict): |
| 307 | LoadBuildFileIncludesIntoDict(v, subdict_path, data, aux_data, None, check) |
| 308 | elif isinstance(v, list): |
| 309 | LoadBuildFileIncludesIntoList(v, subdict_path, data, aux_data, check) |
| 310 | |
| 311 | |
| 312 | # This recurses into lists so that it can look for dicts. |
no test coverage detected