yonaskolb / XcodeGen

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

Can't add custom flags with multiple templates #1347

Closed dungi closed 1 year ago

dungi commented 1 year ago

Hey,

I have different schemes, that contains different custom flags, like:

"PUSHNOTIFICATIONS ADS AR" "PUSHNOTIFICATIONS AR" ""

this is used for:

#if AR
do something that only AR tenants can do
#endif

in the project.yml I have something like this

targets:
  WEATHERAPP_BRASIL_WITH_AR:
    templates:
      - WeatherAppBase
      - ARFeatures
      - ADs

how can I dynamically add "AR" or "ADS" or "PUSHNOTIFICATIONS" to SWIFT_ACTIVE_COMPILATION_CONDITIONS - if I set SWIFT_ACTIVE_COMPILATION_CONDITIONS in the ARFeatures-Template, it will be overridden by the ADs-Template

yonaskolb commented 1 year ago

If you make SWIFT_ACTIVE_COMPILATION_CONDITIONS an array in yml instead of a string, that array should be merged by all the templates

SWIFT_ACTIVE_COMPILATION_CONDITIONS:
  - AR
dungi commented 1 year ago

Thanks :) sadly the default "DEBUG" Flag will be overridden too - didn't recognize. But I add it manually. Thanks.