Files created when opening SPM package in Xcode 11

The .swiftpm directory was created along with package mirroring. It is intended as a place for tools that operate on packages to store state or configuration files of their own that users are not expected to edit directly as source. Files should only be placed in that directory if they support some CLI or GUI operation of a separate tool. The directory is hidden because for the most part, users should not need to know it is there. As of Xcode 11, Xcode has begun using the directory for its own such storage.

Unfortunately, due to the potentially infinite uses that directory might see, it is impossible to make a general rule about which of its contents should or should not be checked in. It all depends on the tool that put them there.

  • The mirroring configuration (part of SwiftPM) sees use both for unchecked, workstation specific overrides, but also as checked, company‐wide mirror set‐ups.
  • Xcode seems to include a mix of files, some that have conventionally been checked in and others that have conventionally been ignored (speaking of such files’ use before Xcode supported packages). Whether the support for packages should change those conventions for various files seems to still be up in the air.
      • This is just my own thoughts, but if Xcode can regenerate it, why would you check it in? If, as others have mentioned in the following links, you only start with the generated ones, but modify the schemes in some way, then you will likely need to check them in to persist your changes. However, even if you do check them in, they will have no effect on raw package manager operations, won’t affect other platforms or other IDEs, and (probably) will be ignored by client packages, so relying on modifications to the generated files is probably unwise in most cases.

I personally will probably ignore the entire .swiftpm directory most of the time. But I haven’t switched very much over to Xcode 11 yet, so I may yet encounter something that could change my mind.

1 Like