|
9 | 9 |
|
10 | 10 | modules = []
|
11 | 11 |
|
12 |
| -with open(input_json, 'r') as file: |
| 12 | +with open(input_json, "r") as file: |
13 | 13 | deps = json.load(file)
|
14 |
| - main_module_name = deps['mainModuleName'] |
15 |
| - module_names = deps['modules'][::2] |
16 |
| - module_details = deps['modules'][1::2] |
| 14 | + main_module_name = deps["mainModuleName"] |
| 15 | + module_names = deps["modules"][::2] |
| 16 | + module_details = deps["modules"][1::2] |
17 | 17 | # add all modules other than the main module into the module map.
|
18 | 18 | for name, detail in zip(module_names, module_details):
|
19 | 19 | kind, name = list(name.items())[0]
|
|
24 | 24 | module["moduleName"] = name
|
25 | 25 | module["isFramework"] = False
|
26 | 26 | if kind == "clang":
|
27 |
| - module["clangModulePath"] = name + ".pcm" |
28 |
| - module["clangModuleCacheKey"] = detail['details'][kind]["moduleCacheKey"] |
| 27 | + module["clangModulePath"] = detail["modulePath"] |
| 28 | + if "moduleCacheKey" in detail["details"][kind]: |
| 29 | + module["clangModuleCacheKey"] = detail["details"][kind][ |
| 30 | + "moduleCacheKey" |
| 31 | + ] |
29 | 32 | else:
|
30 |
| - module["modulePath"] = name + ".swiftmdoule" |
31 |
| - module["moduleCacheKey"] = detail['details'][kind]["moduleCacheKey"] |
| 33 | + module["modulePath"] = detail["modulePath"] |
| 34 | + if "moduleCacheKey" in detail["details"][kind]: |
| 35 | + module["moduleCacheKey"] = detail["details"][kind]["moduleCacheKey"] |
32 | 36 |
|
33 | 37 | modules.append(module)
|
34 | 38 |
|
|
0 commit comments