3

I have started modularizing Xcode project into multiple smaller Swift packages. I am wondering whether I should have used Xcode targets instead. The reason why I am asking this question is because I read Sppotify's article about their newly open-sourced XCRemoteCache tool. It specifically mentions that Xcode projects should be modularized into multiple Xcode targets due to caching of build artifacts. I am interested to know whether these two approaches have similar impact on caching of build artifacts. So what are the pros and cons of these two approaches?

TecHummer
  • 139
  • 1
  • 9
  • IDK anything about `XCRemoteCache`, but I really enjoyed modularization my project into SPM packages. The main perk for me was that file names/positions now had a single source of truth (the name and the position of the file on the file system), rather than also needing to be declared in a manifest (the xcode project file). This made it waaaay easier for me to rename files, move them around, switch between branches, etc. – Alexander Nov 23 '21 at 18:52
  • I literally started doing the exact same thing as you this month. I started off with Swift Packages, but making changes to the files was weird. I then tried frameworks, which was ok, but it turns out that you can't embed frameworks inside frameworks. It sometimes works, sometimes doesn't, which was the same with Swift Packages. Now I'm using targets. It's so much easier to manage and so less glitchy. – aheze Nov 23 '21 at 19:03

0 Answers0