yonaskolb / XcodeGen

A Swift command line tool for generating your Xcode project
MIT License
6.88k stars 809 forks source link

Allow changing macro expansions on test actions. #1468

Open erneestoc opened 2 months ago

erneestoc commented 2 months ago

There are cases where it's useful to specify an alternate target as macro expansion for tests instead of the default which it's currently the first buildable reference.

erneestoc commented 2 months ago

So basically, I'm trying to achieve a scheme where I can:

It seems to work for the most part except I'm losing my test macroExpansions. The problem is that I'm relying on my tests to be able to expand macros to find some files.

When setting up a scheme like this, the action will pick up the first buildable reference it finds, and sometimes, for some reason, none. So, I would like to explicitly define which buildable reference to use for the test macro expansion.

One potential solution is to avoid relying on $(SOURCE_ROOT) in my test env vars and instead hardcode the paths. However, I'm inclined to explore a solution that utilizes macros. What are your thoughts on this? @giginet @yonaskolb @freddi-kit

erneestoc commented 2 months ago

Maybe this instead? https://github.com/yonaskolb/XcodeGen/pull/1471

erneestoc commented 22 hours ago

@yonaskolb I had some conflicting logic with the previous PR I had to fix - if you can give it another check 🙏🏻