Customize `GoogleService-Info.plist` target membership
Hello, I have used XcodeGen the Great 🥇 in our application and it works flawlessly unless there is one little issue with GoogleService-Info.plist files. I have three GoogleService-Info.plist files, each related to a separate application environment (develop, stage, and production) and I have to use them in a single Xcode target. Following is the MyApp structure.
targets:
MyApp:
type: application
platform: iOS
sources:
- path: MyApp
- path: MyApp/Resources/GoogleService-Infos/DEV/GoogleService-Info.plist
buildPhase: none
- path: MyApp/Resources/GoogleService-Infos/INT/GoogleService-Info.plist
buildPhase: none
- path: MyApp/Resources/GoogleService-Infos/PROD/GoogleService-Info.plist
buildPhase: none
I added a script in the build phases to select the proper Info.plist file and then copy it inside my app's bundle directory. In this case, I have to set an unselected target membership on them and don't need to have them on copy bundle sources inside build phases.
I tried to set buildphases: none for them but it didn't work. This note inside the project spec > buildPhase already mentioned it I guess Note that Info.plist files will never be added to any build phases, no matter what this setting is..
- path: Source/Resources/GoogleService-Infos/INT/GoogleService-Info.plist
buildPhase: none
I'm using the 2.38.0 version of XcodeGen. I'm encountering the opposite case of #1045 please help me THX. 🙏
i have a similar use case but have 3 targets
ApplicationProd ApplicationStage ApplicationDebug
in the file structure i have
YourApp//Configurations/Debug <- which has all debug specifig files YourApp/Configurations/Stage <- which has all stage specifig files YourApp/Configurations/Production <- which has all prod specifig files
under sources
on the production target you'd do like this.. sources: - path: YourApp excludes: - Configurations/Debug/** - Configurations/Stage/**
and mimick for the others similarly thats how i solved it atleast
another solution could be to use the createIntermediateGroups on the sources and then have different configurations
another solution could be to use the createIntermediateGroups on the sources and then have different configurations
- path: MyApp/Resources
excludes:
- "GoogleService-Infos"
- "GoogleService-Infos/**"
- "GoogleService-Infos/**/*.*"
- path: MyApp/Resources/GoogleService-Infos/DEV
type: folder
buildPhase: none
- path: MyApp/Resources/GoogleService-Infos/INT
type: folder
buildPhase: none
- path: MyApp/Resources/GoogleService-Infos/PROD
type: folder
buildPhase: none
I managed to solve it by defining those path types as folder (as @alessdiimperio mentioned, createIntermediateGroups option). Please notice that the build phase option none will not apply to 'info.plist' files but it will work on folder type.
This is what it should look like. It's an intermediate group referenced directly from disk with no target membership. This worked for me.