[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:
Steven Wu
2025-01-07 13:29:29 -08:00
parent 8f6ad4c5cd
commit ef99096e43
2 changed files with 13 additions and 9 deletions

View File

@@ -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)