Is it possible to include SPM checkouts in Git? - xcode

It's possible to store Checkout and Build directories when using CocoaPods and Carthage.
Is this possible using Xcode 11's SPM?
Or, if I could modify the location SPM uses for Checkouts, then I think this could work by setting this directory to somewhere in the workspace's directory structure.
(I'm in the camp that prefers to keep all assets required to build projects in the same Git repo as the project itself. Don't hate me :) )

You can't do this.
See my previous response to this question here.

Related

Swift Package Manager - How to add checkouts to source control? [duplicate]

I started using new Xcode 11 which integrates SPM.
I added first dependency to my project:
but detected that files are not fetched into my project folder but into Xcode's cache:
I would like to commit all my dependencies files into my main project repository so my question is:
Is it possible to change location of fetched packages via SPM using Xcode 11?
It's somewhat possible, although the solution isn't necessarily a good or great practice, so I can't recommend.
Set the DerivedData in workspace settings to be relative to the workspace.
Add gitignore rules such that the workspace/WORKSPACE_NAME_DIR/SourcePackages/checkouts and related files are includes. Maybe best to ensure repositories directory is not included.
Add a Run Script phase to remove .git and .gitignore files in the checkouts directory.
Obviously, this is fragile largely through fighting the way SPM works. The workspace settings are per person so it's not great in teams.
SwiftPM integration has been setup to prevent this. It clones the files into a DerivedData/ProjectName-[RandomStuff]. You should commit your Package.resolved into the repo to ensure that you get the same version of each dependency across clones of the project.

How to really work in team on React Native project?

How do you work in team on react native projects?
I'm working in Team of 2 people and having a lot of issues with working on the same project.
I don't understand how to properly create an environment so we can sync our code between each other while working on the same project. Now, we create a git repo with /ios and /android folders, but the thing is: the /ios folder always needs to be changed, because it links to the computer that was last building the project.
For example: we are working at the same time on different .js files and add a new npm dependency and we wish to sync our changes, so we commit changes to the Git repo and try to sync, this is where our pains begin.
The one need downloading the changed has to go to Xcode and manually update all the Framework Search Paths, Header Search Paths, delete libraries that Xcode doesn't see and then add them again.
I know it's moreof an Xcode problem, but I didn't see any detailed guide about team syncing in projects. I know that at Facebook people are doing a lot of cooperative work and I'd appreciate some input over our issues!
If you are using git, you can configure your .gitignore-file to prevent committing xcode-specific stuff and other configuration files.
I can highly recommend gitignore.io, which is a "web service designed to help you create .gitignore files for your Git repositories" [Source].
You can for example type in XCode (or AndroidStudio, ReactNative, Gradle, etc.) and it will automagically generate a .gitignore file for you.

How to convert Xcode project into workspace and avoid git merge conflicts

Currently I am working on a team project with Xcode that is stored in Foo.xcodeproj. We all work on our own branches and do git pull requests for merging into the common dev branch. I am at a point where I want to use CocoaPods and once I do a pod install then the workspace Foo.xcworkspace will be created. The CocoaPod docs say:
Make sure to always open the Xcode workspace instead of
the project file when building your project
On my branch I will have a workspace file whereas everyone else will be still working directly with the project file. I am trying to be preemptive and avoid difficult git merge conflicts. Will it matter if my teammates are still opening the project file or are we going to have merge conflict hell?
Being a one team you all should work in one either in Project or Workspace, are you the only one using cocoapods no one else in Team wants to get the functionalities available through Pods.
If you are the only one continuing with PODS be careful while committing the project file in git.
Answer to your question, just commit your Podfile, podfile.lock and .xcworkspace file in git and whenever the other teammate is getting the pull ask him to do a pod install and then open the .xcworkspace file to work as you did initially.

Xcode build folder appearing in svn

I am currently working on a project which is included in a versions(svn)repository. Although I'm not sure, I think I might have changed some settings in Xcode, affecting the way the source control saves the build folder in the repository. I was told it is a bad practice to commit the build folder, and asked why have I done that, but I had no answer at the moment. A screen will elucidate this more clear:
Even if I tried to delete (or ignore) those files from the repository, they are still created after I build the project. How should I proceed in order to prevent those build folders appear in versions' project tree?
Adding versioned folder to ignore-pattern does not affect data in SVN
You must ignore and remove folder from SVN, but keep it locally
For CLI it will be svn pe ... in the parent of build folder and svn rm build --keep-local (I don't know XCode GUI's equivalents)

How to manage external libraries in Xcode/git source control?

Okay, I'm trying to add Endpoints for Google App Engine to my app project.
The directions for the iOS client code say to download this svn project:
svn checkout \
http://google-api-objectivec-client.googlecode.com/svn/trunk/ \
google-api-objectivec-client-read-only
and then
The static library target should be dragged into your application project's Build Phases "Link Binary with Libraries" list.
As I understand it, for that to be possible, I should be basically following Apple's directions for static library child projects.
But now the Google code is not in my git repository, so when I attempt to clone my project to work on a different branch, it's not included and doesn't come along. And I can't add it to my project without causing an svn error.
What do I do about this? I could do a recursive copy of the code out of the svn working copy and explicitly check it into my git repository, but then it seems like updating to any future versions of that project from Google will be a nightmare. Or are child projects just a bad idea? I've never had good luck with Xcode trying to compile a separate static library and including the binary in my main project -- is that what I need to do?
It looks like you can do this trick to create a git copy of the svn repository, then create a submodule from the git copy:
Is it possible to have a Subversion repository as a Git submodule?

Resources