7 lessons learned from Tuist integration
Some weeks ago we started new project in small team. During proof-of-concept phase we tested Tuist as a tool mostly to solve ongoing issues with conflicting project files during merges and mess in Code Reviews. We decided to give it a try and see if it can really help us when building new project from scratch.
Some weeks have passed by and it's a good time to list a few things that might sound obvious, but are easy to be skipped during Tuist onboarding to the team and everyone working in Tuist project should be aware of.
1. Don't create targets in Xcode
Yes, this is why we have project powered with Tuist to do this job for us. It also applies to test targets!
2. Don't configure project in Xcode
Development team, certificates, provisioning profiles, build configuration, run scripts and more. Once project is generated by Tuist we tend to work as we used to do for years updating other things inside Xcode. Unfortunately this path leads to nowhere as next project files generation dismisses our changes. Tuist is here to help us configuring everything in it's configuration project.
3. Fastlane everything
Once you start working on your project you shortly notice reoccurring command flows. Fastlane everything, including dependencies update & project generation. Even, if some of the steps my not be needed everytime, when working in bigger team where you constantly switch branches or pull from repository and where not everyone is familiar with every detail of Tuist integration it's better to pack all the complicated stuff into one-liners that are not overwhelming.
4. Sources != Resources
By default, all source files for project land in two folders - Sources for complilable swift files and Resources for all supporting files like image assets. However, it's easy for someone not familiar with Tuist configuration scripts to put files into wrong folders - they look the same inside Xcode, right? So, where is the problem? Problem starts when compiling final project - swift files in Resources folder become invisible during compilation and our project has problems.
5. Define specific version of Tuist
You end your friday shift with stable project & green CI/CD, you spend you weekend doing everything other than thinking about project, you start your work on monday morning and all you can see is CI/CD in total mess. But hey, you haven't changed anything during weekend, right? So, what's going on?
Well, nothing special happened. Tuist, as every other maintained tool, just had a big release with breaking changes that broke your project generation. This is why you can & you should define local version of Tuist all the team, including CI/CD, is working on.
6. Patience is rewarded
Starting project with Tuist in September 2021 can still become a challenge. Although project is already in version 1.51.1 it still changes and introduces important features, like recently introduced support for SPM. Still documentation is not perfect and you need to spend some time figuring out how configure app signing or run scripts.
However, once figured out, every next similar thing is much easier to cope with. With time team starts seeing benefits of no .xcodeproj/project.pbxproj in repository and starts saving time during Code Reviews and project merging.
7. It's OK to stop using Tuist
If, at any time you feel that you reached the dead end and you can't move on with Tuist - it's ok. Just add project files to repository and work like before. You tried, you did your best. At the end it's just a tool - as perfect as it can be at the time, but may not be perfect for every project.
Trying to summarize
As you could imagine reading couple of points above, our first integration of Tuist did not went smoothly and we had some onboarding issues. At once, we actually even started considering giving up on Tuist as we seriously missed SPM integration. Luckily for us at that time it occured that SPM integration was just released with next Tuist version days ago and we could move on.
When publishing this post, 4 weeks after project start we feel much more confident in Tuist and already see huge benefits of work with this tool especially in early phases of project developed by couple of devs, when project structure changes are super frequent. Onboarding phase of this tool is over and it kinda became everyday tool you slowly start forgetting about on daily basis.