Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions lib/Frontend/ModuleInterfaceLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1460,13 +1460,13 @@ struct ExplicitSwiftModuleLoader::Implementation {
for (auto &entry: *mapNode) {
auto key = getScalaNodeText(entry.getKey());
auto val = getScalaNodeText(entry.getValue());
if (key == "SwiftModule") {
if (key == "moduleName") {
moduleName = val;
} else if (key == "SwiftModulePath") {
} else if (key == "modulePath") {
result.modulePath = val;
} else if (key == "SwiftDocPath") {
} else if (key == "docPath") {
result.moduleDocPath = val;
} else if (key == "SwiftSourceInfoPath") {
} else if (key == "sourceInfoPath") {
result.moduleSourceInfoPath = val;
} else {
// Being forgiving for future fields.
Expand All @@ -1480,16 +1480,16 @@ struct ExplicitSwiftModuleLoader::Implementation {
}
// [
// {
// "SwiftModule": "A",
// "SwiftModulePath": "A.swiftmodule",
// "SwiftDocPath": "A.swiftdoc",
// "SwiftSourceInfoPath": "A.swiftsourceinfo"
// "moduleName": "A",
// "modulePath": "A.swiftmodule",
// "docPath": "A.swiftdoc",
// "sourceInfoPath": "A.swiftsourceinfo"
// },
// {
// "SwiftModule": "B",
// "SwiftModulePath": "B.swiftmodule",
// "SwiftDocPath": "B.swiftdoc",
// "SwiftSourceInfoPath": "B.swiftsourceinfo"
// "moduleName": "B",
// "modulePath": "B.swiftmodule",
// "docPath": "B.swiftdoc",
// "sourceInfoPath": "B.swiftsourceinfo"
// }
// ]
void parseSwiftExplicitModuleMap(StringRef fileName) {
Expand Down
8 changes: 4 additions & 4 deletions test/ScanDependencies/explicit-module-map.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
// RUN: %target-swift-frontend -emit-module -emit-module-path %t/inputs/Foo.swiftmodule -emit-module-doc-path %t/inputs/Foo.swiftdoc -emit-module-source-info -emit-module-source-info-path %t/inputs/Foo.swiftsourceinfo -module-cache-path %t.module-cache %t/foo.swift -module-name Foo

// RUN: echo "[{" > %/t/inputs/map.json
// RUN: echo "\"SwiftModule\": \"Foo\"," >> %/t/inputs/map.json
// RUN: echo "\"SwiftModulePath\": \"%/t/inputs/Foo.swiftmodule\"," >> %/t/inputs/map.json
// RUN: echo "\"SwiftDocPath\": \"%/t/inputs/Foo.swiftdoc\"," >> %/t/inputs/map.json
// RUN: echo "\"SwiftSourceInfoPath\": \"%/t/inputs/Foo.swiftsourceinfo\"" >> %/t/inputs/map.json
// RUN: echo "\"moduleName\": \"Foo\"," >> %/t/inputs/map.json
// RUN: echo "\"modulePath\": \"%/t/inputs/Foo.swiftmodule\"," >> %/t/inputs/map.json
// RUN: echo "\"docPath\": \"%/t/inputs/Foo.swiftdoc\"," >> %/t/inputs/map.json
// RUN: echo "\"sourceInfoPath\": \"%/t/inputs/Foo.swiftsourceinfo\"" >> %/t/inputs/map.json
// RUN: echo "}]" >> %/t/inputs/map.json

// RUN: %target-swift-ide-test -print-module-comments -module-to-print=Foo -enable-swiftsourceinfo -source-filename %s -explicit-swift-module-map-file %t/inputs/map.json | %FileCheck %s
Expand Down