You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If my local Xcode project contains ProtocolA that confirms to ProtocolB in a different local Xcode project, how can I generate code for ProtocolA?
More Context
My Xcode project, "ProjectA", has two dependencies, both of which are other local Xcode projects that I created, "ProjectB" and "ProjectC". I have this situation in one of my Swift files within ProjectA:
// file within ProjectA
import ProjectB
// sourcery: AutoMockable
protocol ProtocolA: ProtocolB {
// ProtocolB lives within ProjectB
}
I'm trying to generate mocks for ProtocolA within ProjectA, but I'm failing to include the data associated with ProtocolB. Here is what I'm hoping for, within ProjectA:
// autogenerated file within ProjectA
class ProtocolAMock: ProtocolA {
// Protocol A related variables/functions
...
...
// Protocol B related variables/functions
...
...
}
I've tried the following two configurations in my config.yml file:
For both of these configurations, it correctly generates the expected results for the protocols defined with ProjectA. However, within ProjectA, it also generates the code for the protocols in ProjectB and ProjectC. Since I'm also running Sourcery separately for ProjectB and ProjectC, I am left with duplicated code across these projects.
Therefore, my question is: how can I configure Sourcery to say "scan projects B and C for data to help generate code in project A, but don't also generate everything for projects B and C"?
thank you very much for creating issue! 🤝
I will do my best to try to resolve this. But please keep in mind this sounds like more of a full new feature.
Feel free to investigate and resolve this on your own, since Sourcery is open source and every contribution is very much appreciated by the community 👥 I will provide guidance in case you would have questions.
Sweet, I'll try to implement this feature! Can you point me to where in the codebase you handle the config files, specifically where you handle tags like sources? Thanks!
tl;dr
If my local Xcode project contains
ProtocolA
that confirms toProtocolB
in a different local Xcode project, how can I generate code forProtocolA
?More Context
My Xcode project, "ProjectA", has two dependencies, both of which are other local Xcode projects that I created, "ProjectB" and "ProjectC". I have this situation in one of my Swift files within ProjectA:
I'm trying to generate mocks for
ProtocolA
within ProjectA, but I'm failing to include the data associated withProtocolB
. Here is what I'm hoping for, within ProjectA:I've tried the following two configurations in my
config.yml
file:For both of these configurations, it correctly generates the expected results for the protocols defined with ProjectA. However, within ProjectA, it also generates the code for the protocols in ProjectB and ProjectC. Since I'm also running Sourcery separately for ProjectB and ProjectC, I am left with duplicated code across these projects.
Therefore, my question is: how can I configure Sourcery to say "scan projects B and C for data to help generate code in project A, but don't also generate everything for projects B and C"?
I'm imagining something like this (pseudocode):
The text was updated successfully, but these errors were encountered: