e-sites / Natrium

A pre-build (Swift) script to alter your Xcode project at pre-build-time per environment, build configuration and target.
https://www.e-sites.nl
MIT License
145 stars 15 forks source link

How can I specify array of dictionaries in plists value? #9

Closed 646b closed 5 years ago

646b commented 5 years ago
plists:
    "Resources/Info.plist":
        CFBundleURLTypes:
            - CFBundleURLSchemes:
                - "#{FacebookUrlScheme}"
              CFBundleTypeRole: "Editor"
            - CFBundleURLSchemes:
                - "#{GoogleUrlScheme}"
              CFBundleTypeRole: "Editor"

This code results in empty array. Am I doing something wrong?

Thanks.

basvankuijck commented 5 years ago

This is currently not possible. Because Natrium expects the following structure:

plists:
    "NatriumExampleProject/Info.plist":
        CFBundleDisplayName:
            Staging: App_staging
            Production: App

I would suggest doing the following: Make xcconfig variables in .natrium.yml:

xcconfig:
    FACEBOOK_URL_SCHEME: "#{FacebookUrlScheme}"
    GOOGLE_URL_SCHEME: "#{GoogleUrlScheme}"

And use them in your Info.plist file: $(FACEBOOK_URL_SCHEME) and $(GOOGLE_URL_SCHEME)

646b commented 5 years ago

It worked, thank you!