mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Test] Fix a typo in the test util python script
Fix the typo in GenerateExplicitModuleMap.py where the modulePath is mis-spelled. Use the module path from the dependency output json file directly instead, which means the script can be used to generate non-caching build module map as well since the module path actually matters for those builds.
This commit is contained in:
@@ -9,11 +9,11 @@ input_json = sys.argv[1]
|
||||
|
||||
modules = []
|
||||
|
||||
with open(input_json, 'r') as file:
|
||||
with open(input_json, "r") as file:
|
||||
deps = json.load(file)
|
||||
main_module_name = deps['mainModuleName']
|
||||
module_names = deps['modules'][::2]
|
||||
module_details = deps['modules'][1::2]
|
||||
main_module_name = deps["mainModuleName"]
|
||||
module_names = deps["modules"][::2]
|
||||
module_details = deps["modules"][1::2]
|
||||
# add all modules other than the main module into the module map.
|
||||
for name, detail in zip(module_names, module_details):
|
||||
kind, name = list(name.items())[0]
|
||||
@@ -24,11 +24,15 @@ with open(input_json, 'r') as file:
|
||||
module["moduleName"] = name
|
||||
module["isFramework"] = False
|
||||
if kind == "clang":
|
||||
module["clangModulePath"] = name + ".pcm"
|
||||
module["clangModuleCacheKey"] = detail['details'][kind]["moduleCacheKey"]
|
||||
module["clangModulePath"] = detail["modulePath"]
|
||||
if "moduleCacheKey" in detail["details"][kind]:
|
||||
module["clangModuleCacheKey"] = detail["details"][kind][
|
||||
"moduleCacheKey"
|
||||
]
|
||||
else:
|
||||
module["modulePath"] = name + ".swiftmdoule"
|
||||
module["moduleCacheKey"] = detail['details'][kind]["moduleCacheKey"]
|
||||
module["modulePath"] = detail["modulePath"]
|
||||
if "moduleCacheKey" in detail["details"][kind]:
|
||||
module["moduleCacheKey"] = detail["details"][kind]["moduleCacheKey"]
|
||||
|
||||
modules.append(module)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user