Brightify / Cuckoo

Boilerplate-free mocking framework for Swift!
MIT License
1.67k stars 174 forks source link

Automatically add generated class to XCode project without manual drag/drop #439

Closed mecoFarid closed 1 year ago

mecoFarid commented 1 year ago

In the CocoaPods documentations there is a part that says:

# After running once, locate `GeneratedMocks.swift` and drag it into your Xcode test target group.

Is there any way to automate this? Probably no one wants to manually play with generated code

MatyasKriz commented 1 year ago

The point of this is to add the generated file into the target, no playing around with the generated code required. 🙂 There might be a way to use the xcodeproj ruby gem to add this functionality, PRs are welcome. 😁

mecoFarid commented 1 year ago

Thanks for reply.

With this "no one wants to manually play with generated code", I actually meant the drag/drop 😬. Okay, I will check this as soon as I have time and create PR if I can achieve something.

Quick follow-up question: With current configuration, how is this done in CI pipelines? I mean if you wanna execute unit tests in CI server, how the generated file is added to target given we do not check the generated file into version control?

MatyasKriz commented 1 year ago

Oh, adding the file to the Xcode project modifies the .pbxproj manifest file that you have to commit into source control. Xcode then knows about the file, you only need to do this the first time you run the generator.

mecoFarid commented 1 year ago

Alright, that is nice.