xcode 11, sharing a group of utility classes between different projects

185 Views Asked by At

I have a set of utility classes that I reuse in several xcode projects.
I want to include the utility classes in every project. I currently do this by adding inside every xcode project a group and dropping there the files from the file system. This way, they are included in the compilation.

But every time I do filename changes in the utility classes (e.g. add/rename/delete a file) I have to go through all the projects and reflect the change there.

Some notes:

  • The projects are irrelevant, i.e. not different products from a suite of products. So I cannot use an all products project and do the separation at the targets level for each of the products.
  • When I do changes in a utility class from one of the projects, the changes should be reflected in all other projects.
  • the utility classes are already on a repo of their own.
  • I prefer not to make copies of the files of the utility classes inside every project
  • I do not want to do the trip of creating a framework that will then be used by every project. Not all classes are used by every project. I just want to have them compiled as a source files.

As a test, I made a project containing the utility classes and no target, added the project as a child of one of my projects. I.e. instead of having the yellow folder icon of the file group, I have a project icon containing the files.
The compilation does not seem to pick these files.

Maybe a cmakelists.txt file could serve this purpose? I.e. give to xcode an additional list of files to include in the compilation?

For the Windows's edition of my projects, I use Microsoft's Visual Studio "shared items" project which accomplishes exactly all these requirements.

What is your advice for xcode? Thanks!

Similar to:
Sharing classes between projects in xcode/objective-c
Sharing classes between Xcode projects

0

There are 0 best solutions below