seanhenry / SwiftMockGeneratorForXcode

An Xcode extension (plugin) to generate Swift test doubles automatically.
MIT License
748 stars 47 forks source link

[Feature request] Support from command line #34

Closed federico-jordan-peya closed 4 years ago

federico-jordan-peya commented 4 years ago

Hi guys, awesome work! Do you know how can I run the mock generator from terminal? I'd like to automate some process and the tool is perfect to do my mocks. Thanks in advance!

seanhenry commented 4 years ago

Hi @federico-jordan-peya

Thanks for raising this issue. I'm pleased you like the extension.

There isn't currently a command line tool but one could be added quite easily. What would you need it to do? Scan a directory and generate all mocks matching a certain pattern?

federico-jordan-peya commented 4 years ago

Yes, I think that would be great! Also it can be added as a precommit hook, or maybe as a test target build step.

seanhenry commented 4 years ago

Great, I'll look into it.

You might want to see what the performance is like before using a build step or commit hook but it should be fine for a small number of mocks.

federico-jordan-peya commented 4 years ago

Yes, I'm also aware of that. I think that the main benefit would be just running it from command line to update many mocks at once. Thanks you very much

federico-jordan-peya commented 4 years ago

Maybe we can filter the mocks with some comment on top of the class name like /// @GenerateMock

seanhenry commented 4 years ago

Hi @federico-jordan-peya

I've added a command line tool in the latest release. Let me know what you think.

federico-jordan-peya commented 4 years ago

Excellent @seanhenry, I will test it on my project. Thank you very much for attending the feature