seanhenry / SwiftMockGeneratorForXcode

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

Use apple script to get current Xcode project directory #7

Closed LeonidKokhnovich closed 6 years ago

LeonidKokhnovich commented 6 years ago

I wonder if it was considered to use Apple Script (https://gist.github.com/schwa/3822611) to check what is the currently opened project folder instead of manually specifying it in the mock generator util.

seanhenry commented 6 years ago

Interesting. I haven’t considered using AppleScript for something like this.

I’d be interested to know how you’re using the mock generator. Do you tend to have multiple projects open at the same time? Or are you changing projects frequently?

LeonidKokhnovich commented 6 years ago

I have an app project that includes few other subprojects. Subprojects are not stored within the main app directory. I usually switch between them quite often while working on the main app. In order to make the mock generator work, I have to specify the root folder for all Xcode projects and that's why mock generator sometimes works quite slowly for me (10+ seconds).

seanhenry commented 6 years ago

I can see why that’s annoying. Let me look into this.

seanhenry commented 6 years ago

I've created a release to detect the directory of the open Xcode project. It should fix your problem as long as you are opening your subprojects in another Xcode window and not editing them directly from your main project.

It would be useful to get your feedback when you've tried it out.

LeonidKokhnovich commented 6 years ago

It works, thank you!