在提交PR的時候,無意間發現了在xcworkspace/xcshareddata中多了一個名為IDEWorkspaceChecks.plist的文件。自己並沒有手動創建此文件,在網上查了一下,最終對其有了大概的了解。
簡介
我們先看一下它里面的內容:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>IDEDidComputeMac32BitWarning</key> <true/> </dict> </plist>
它是一個xml文件(plist的源碼模式),里面包含了一個key的定義,那就是IDEDidComputeMac32BitWarning的key,value為true。經過查閱蘋果官網文檔,原來是Xcode9.3搞的鬼。
Xcode9.3自動為我們在workspace里面的share data中創建了一個IDEWorkspaceChecks.plist的文件,用來存儲workspace檢測的狀態,提交這個文件到source control,可以防止為打開工作區的用戶不必要地重新運行這些檢查。
Resolved Issues
Xcode 9.3 adds a new
IDEWorkspaceChecks.plistfile to a workspace's shared data, to store the state of necessary workspace checks. Committing this file to source control will prevent unnecessary rerunning of those checks for each user opening the workspace. (37293167)Resolved a performance issue when switching away from Issue Navigator into other Navigators, especially the Find Navigator. (35363603)
The source editor find and replace control now supports Full Keyboard Access. (33666790)
是否提交git
既然它是放在workspace包里面的xcshareddata文件夾中,那么它就是一個可以共享的文件,所以在gitignore的時候最好不要配置xcshareddata。對於workspace里面的xcuserdata,則是用戶自己的一些設置,例如斷點:

所以建議把xcuserdata整個目錄添加到.gitignore中。
