spotify / XCRemoteCache

Other
838 stars 52 forks source link

Support not defined object for Swift output map #9

Closed polac24 closed 3 years ago

polac24 commented 3 years ago

Swift compiler may be invoked without object in the *-OutputFileMap.json. Example: when Xcode builds a swiftmodule in an "index build", passes a simplified swift file compilation info (empty in practice). This PR does not require the object property and in such case, just don't create one.

*-OutputFileMap.json in the 'indexbuild' action:

...
    "/absolute/path/to/file.swift": {},
...

*-OutputFileMap.json in the 'build' action:

...
    "/absolute/path/to/file.swift": {
        "dependencies": "{redacted}/DerivedData/{redacted}/Build/Intermediates.noindex/{redacted}/Debug-iphonesimulator/{redacted}.build/Objects-normal/x86_64/file.d",
        "diagnostics": "{redacted}/DerivedData/{redacted}/Build/Intermediates.noindex/{redacted}/Debug-iphonesimulator/{redacted}.build/Objects-normal/x86_64/file.dia",
        "llvm-bc": "{redacted}/DerivedData/{redacted}/Build/Intermediates.noindex/{redacted}/Debug-iphonesimulator/{redacted}.build/Objects-normal/x86_64/file.bc",
        "object": "{redacted}/DerivedData/{redacted}/Build/Intermediates.noindex/{redacted}/Debug-iphonesimulator/{redacted}.build/Objects-normal/x86_64/file.o",
        "swift-dependencies": "{redacted}/DerivedData/{redacted}/Build/Intermediates.noindex/{redacted}/Debug-iphonesimulator/{redacted}.build/Objects-normal/x86_64/file.swiftdeps",
        "swiftmodule": "/Users/bartoszp/src/client-ios/DerivedData/{redacted}/Build/Intermediates.noindex/{redacted}.build/Debug-iphonesimulator/{redacted}.build/Objects-normal/x86_64/file~partial.swiftmodule"
    },
...