Share compiled Xcode project - ios

I have an Xcode project and I have to share it with other developers. They have to work on a small part of this, and compile.
I started trying to convert a lot of code as framework, but it was beginning to be complex because of a lot of interweaving of #import.
Is possibile make project with some .o file e some that have to be build?
I'm open for any another way
NB: I forgot something fundamental: I want build some part of project because I don't want to permit to see how it is implemented

You can put it to github as a free, open repository, or make it private, but have to pay. Then necessary part of it can be linked as a submodule.
It's possible without a github also, if you have some centralized place, where you can put it.

You can separate the code you want them to work on and create a git submodule. They can then clone and work on the git submodule and push their work to the repo as they progress. You can then keep pulling their changes on that submodule.
Check these resources
Git Submodules: Adding, Using, Removing, Updating
Git Tools - Submodules
Essentially you will split your project into sub projects (doesnt need to be a new xcode project if there is no need for specific build settings) and track them as submodules in git.
So the scenario would be
Determining the code they must work on or the sub "project"
Create a submodule from that code (move the code to a folder in your project directory and initialize the submodule)
Push the submodule to your repo, e.g. github/bitbucket
Developers would pull down your submodule into their existing xcode project.
The submodule will contain only classes and files etc. that they need. All changes that they make to the submodule will be tracked and you can pull them and have continuous integration (some form).

Related

Using git submodules with xCode projects

I have a project (A), which is partially used as a submodule for another project (B). Both projects are under development.
Part of sources from submodule (A) added to my parent project (B) as links, without copying, so I can update thus files with git pull from directory with submodule.
Q1: Is it a normal workflow, to use submodules in such way?
Q2: Is there way to automate adding of new files to A, so them automatically
become parts of B?
Q3: I have issues after removing submodule code - all its parts displayed as absent in xCode, although everything is compiling and works fine.
You can use Cocoapods for this purposes. It automates includes and making changes. You can create local pod, just for sharing code, as well, as remote one

manage a project and a dynamic framework made from this project with a single git repository

I have an ios standalone project managed with git in a git repository.
With this code, I am creating an ios dynamic library which will have some slight modifications from the standalone code to make it work as a library.
Now I have to manage two different code bases and whenever I make a change in the standalone project, sometimes I miss the changes in the dynamic library.
Is it possible to manage the common code in the standalone project and dynamic library from a common repository or what is the right way to do this?
I need to maintain standalone project separately because I cannot run and debug the framework easily as the standalone project.
If the standalone project can live in a subfolder of the dynamic library project, then you can use git submodule to reference a SHA1 of the first project into the second one.
git submodule add git#github.com:AFNetworking/AFNetworking.git Vendor/AFNetworking
Each time you modify anything in that subfolder, you can commit and push as usual, but also go back to your main project (the dynamic one), add, commit and push to record the new SHA1 of your submodule.
The other approach would be to use a subtree (as illustrated here, see tutorial).
git subtree add --prefix=Vendor/AFNetworking --squash git#github.com:AFNetworking/AFNetworking.git master
I prefer the first approach, but you can see both used in the context of a IOS project in this article

Git submodule vs Git subtree vs dependency manager CocoaPods

I have two apps/projects - one for customers and one for workers. Both projects have the same back-end API related code, the same business-level objects, the same custom GUI controls and some functionality. I want to replace the identical code with the shared one. For example to move this code to a separate repo.
Since both projects are under development everything (including shared code) will be changed very often. Shared code will be usually updated as a part of one of these two projects.
What is the best way to share the code between two projects if I need an easy way to frequently update it?
My ideal use case will be the following:
I change the customer project (customer and shared code).
I commit and push new changes to the customer repo and to the shared code repo.
I open worker project, do pull for the shared code and then update worker code if it needs to reflect shared code changes.
P.S. Qestions Differences between git submodule and subtree and GIT Nested repositories: Composer vs. SubModules vs. Subtree vs.? have very good answers but it is still not clear what should I choose if I need an easy way to frequently update shared code.
I would use a git submodule personally, it's a very good link to a shared codebase that is itself a git repository that can be managed separately without being tracked in your other projects.
You can use git submodule foreach git pull origin master on both the client and worker side to pull in changes when the shared library is updated.

Tracking files in Git that are added by reference to project in Xcode

I have a few iOS projects that all use the same intro videos. The video files are not in any of the project folders. When I add them by reference to the Xcode projects, I can't track (add?) them with Git. Does the file need to be local to the project folder to add them to a repo, or is there a way to do this? I add them by reference so I can make changes to the one video and have it reflect in all the projects.
for situations like this, where i share code amongst projects, i create a git submodule that contains the common code, where the git submodule is basically a mini-clone of a git repository of that common code.
thus, for source that is shared, i can play with it in the submodule of one project without affecting the other projects until i'm happy with it and commit and push it to the submodule's origin/master, and merge it from there to the other projects. the same should be possible for binary as well.
this way, the tracking does show up in Xcode for me.

Master GIT repository with shared sub respoitories

I have created a basic admin system using RoR. It has very basic functionality such as users, roles, security features and a basic UI. I want to put this project into a master GIT repository.
If I want to create future projects, I'd like to use this base project as the foundation. Do I create braches?
MASTER PROJECT
MASTER PROJECT > SUB PROJECT #1
MASTER PROJECT > SUB PROJECT #2
So both sub projects are identical to the master project at this point. If I want to make a universal code change to any file within the MASTER PROJECT, how do I make that change trickle down to all sub projects. That is my FIRST QUESTION.
SECOND QUESTION:
What if I want to make a code change to a particular file on one of the sub projects?
e.g.: If I customize the layout in SUB PROJECT #2 (application.html.erb), I want that change only to affect SUB PROJECT #2. I want all sub projects to use the application.html.erb from MASTER PROJECT UNLESS it has changed (customized). It would be nice if SUB PROJECT #2 only contained the one customized file. All other missing files fallback on MASTER PROJECT.
THIRD QUESTION:
If I make a change to application.html.erb in the MASTER PROJECT, it is supposed to tickle that change down to all sub projects UNLESS one of the sub projects has a customized change to that file already. In this case, SUB PROJECT #2 does.
I'd want GIT to either:
a) Skip the update on application.html.erb on SUB PROJECT #2
OR
b) Prompt a warning to allow for some sort of merge.
Does that make sense? Is this setup possible? What would it be called? Where do i start?
Question 1:
You could use branches to track this. However, you should also consider whether what you need is simply a set of templates.
Git does not perform automatic merges by itself. You can write a script to do this, but otherwise you'll need to manually perform a git merge on each subproject branch.
Question 2:
Any branch you create will initially be identical to the original branch (master), at the time you created the branch. It will not change until you commit changes or merge in changes from the master branch. It wouldn't make sense to have this branch contain only the one customized file, so you may want to consider why you're asking for that if you want to use version control branches. The branch may only contain modifications to the one file, but nothing enforces this.
Question 3:
This is what git is designed for. When you do a git merge on the subproject branch, git will try to automatically merge the content and if it fails it will mark a conflict and allow you to manually perform a merge. You can also tell git to use another merge strategy, such as 'keep the local version', but this is a more advanced technique, and probably isn't what you want.
I recommend you start with the git-tutorial and make sure you have a good understanding of branching in git. Then, revisit this idea and make sure it still makes sense for what you're trying to acheive.
Maybe it's the right choice to put your master project into its own repository and make a new one for each project. There's git submodule which enables you to integrate other repositories in a project. YOu should try to have project specific changes only in the relating repositories, changes on the master project you can update via git submodule!

Resources