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)
Related
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.
I have spent the last week trying to get my TFS Branch / VSO / Azure Release Branch Continous Deployment setup, but have failed miserably. Right now I am just trying to get CD working with out branching, I have it pointed at my solution but I am falling over myself on the obj and bin folder. If I exclude the bin folder from the project it complains because it cant build the project. I can't get tfignore to work, if I change the folder it still tracks the changes.
I have a folder structure of:
\Dev\Web\Umbraco Master Solution\Umbraco.Extensions\bin
\Dev\Web\Umbraco Master Solution\Umbraco.Extensions\obj
\Dev\Web\.tfignore
my tfignore includes the lines:
\Umbraco Master Solution\Umbraco.Extensions\bin
\Umbraco Master Solution\Umbraco.Extensions\obj
I'm not really sure where to go from here.
It is almost always a bad idea to checkin your bin folder. If the build fails when you exclude it, that likely means you have a DLL that is referenced from the bin (also not good). You should use Nuget packages where possible for your dependencies. Its easy to make your own if needed. Or you can place the DLLs you need to reference in a different folder at the root of your solution and referenced those instead.
I am assuming you would like to check-in the Bin of the project you are referencing. when you set up your build, you have to select a configuration to build. Make sure that the configuration you are building has the project you are referencing set to Build.
I agree with chief7 that it's a bad idea to check in your bin folder.
This is about outdated repo details inside XCode. The case is:
I'm reusing a supporting library from an old project in a new one.
I used "Add files to X project..." functionality to copy them to the new place.
"Automagically" the files were copied with a reference to an old SVN repo, that don't exit anymore.
So... Now I have a project with 2 repos visible, incl. one inactive. I can't commit changes to copied files, as the old repo is still linked.
Two question here:
Is there a way to edit old repo data?
Is there a way to move the copied files to the new repo, where the rest of the project is?
Ultimately I need to commit both parts ;)
Thank you.
OK. So resolving this issues required several steps to be performed. Not sure if all were required, but the eventually I got it right.
Commit all changes you can (in my case all but the folder that was linked with the old repo). Archive your projects.
Go to the root folder of your project and use svn switch --relocate command to merge repos. Details: how to change svn settings
Remove the project from XCode (via Organizer) delete the entire project folder
Remove repos in the Organizer
Fetch whatever was committed in the SVN again. Do that and create a new project. If you see any missing files highlighted in red, like my folder that couldn't be committed, delete it.
Manually add the missing files / folder that to the project, from a local copy.
Now you can commit to the repo!
Tiresome, like most things in XCode... ;)
It's obvious behaviour, when adding new files in a branch, then checking out to another branch, those files appear in red. But I tried to remove them and they are definitely removed when gettig back to the original branch where they were created, so it seems it's not a good idea to remove them. So how to handle that since the Xcode is throwing that stupid compiling error. Thanx.
This is not the obvious or correct behavior. Your project file is not checked into your Git repository. Some people think this is a way to avoid conflicts but it's just a way to make your project not compile.
git ls-files *.xcodeproj
Will show you if your project.pbxproj managed by Git.
You fix this by manually fixing your build settings so every thing compiles and runs then checkin your project file. You will need to do this in each branch. Your project file will not only have files that have been removed but missing files that have been added.
I'm just getting started with xcode. I created a sample new project, and would like to import it into my svn repository. I configured xcode to be aware of my repository, and xcode claims the it has successfully authenticated the connection.
I cannot, however, seem to figure out how to get my actual xcode project to manage its source in the repository. I select Project Settings -> SCM Repository -> "myrepository". But that doesn't seem to have accomplished anything. When I try to "commit entire project", xcode tells me: "/Users/me/Documents/test1" is not a working copy.
Any ideas? I'm probably missing something obvious, right?
Did you check out your subversion repository folder for your project to your local directory first?
If not, it's not really a working copy at all. A "working copy" is a local checkout of a repository folder, tracked using hidden .svn folders.
If you haven't checked out a repository folder, all you have is a folder. Subversion won't be able to handle that at all.
I suggest you read the Subversion e-book, and specifically the part about working copies.