toptal / gitignore.io

Create useful .gitignore files for your project
https://www.toptal.com/developers/gitignore
MIT License
8.23k stars 624 forks source link

SPM changes cause xcode project files to be ignored for "swift" target #366

Closed rcritz closed 7 years ago

rcritz commented 7 years ago

That's ok, maybe, if you're using SPM. However, there are a lot more swift projects out there being developed directly in xcode without SPM and this causes a vital, and unreconstructable portion of the project to be excluded from source control.

joeblau commented 7 years ago

Could you please elaborate more. Which versions of Swift Package Manager and Xcode?

rcritz commented 7 years ago

The versions of SPM and Xcode don't matter, actually. The problem is that someone added "*.xcodeproj" when they added the SPM section to the Swift .gitignore file. That's great if you're using SPM and letting it generate your project file. It's a disaster waiting to happen if you don't use SPM (the majority of Swift projects) and, in fact, start with an Xcode project.

Carthage and CocoaPods sections were moved out into independent files. I'd recommend the same for SPM since the majority of Swift programs don't use it.

Sent from my iPad

On Jul 20, 2017, at 7:27 AM, Joe Blau notifications@github.com wrote:

Could you please elaborate more. Which versions of Swift Package Manager and Xcode?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

joeblau commented 7 years ago

Oh you mean in the template! Hah I was confused at first. So what you're referring to is this.

https://github.com/dvcs/gitignore/blob/master/templates/SwiftPackageManager.gitignore#L4

You're right, that shouldn't be in there.

rcritz commented 7 years ago

Yes. If I do "git ignore swift" (I have it aliased to pull from the site), it ends with:

Swift.SwiftPackageManager Stack

Packages .build xcuserdata *.xcodeproj

Earlier in the output you find:

CocoaPods - Refactored to standalone file

Carthage - Refactored to standalone file

Which strikes me as a good thing to do with SPM as well. That way, you can do something like "git ignore swift,macos,spm >.gitignore" if and only if you're using SPM and not have it exclude the Xcode project file for all swift projects.

On Thu, Jul 20, 2017 at 10:26 AM, Joe Blau notifications@github.com wrote:

Oh you mean in the template! Hah I was confused at first. So what you're referring to is this.

https://github.com/dvcs/gitignore/blob/master/templates/ SwiftPackageManager.gitignore#L4

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/joeblau/gitignore.io/issues/366#issuecomment-316720396, or mute the thread https://github.com/notifications/unsubscribe-auth/ADQM6KEAMTD6s0-rE4ANh-P3kE7XsLreks5sP2OVgaJpZM4OdgRg .