Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to generate plists and entitlements files. #406

Closed
lukewakeford opened this issue Sep 20, 2018 · 6 comments
Closed

Ability to generate plists and entitlements files. #406

lukewakeford opened this issue Sep 20, 2018 · 6 comments
Labels

Comments

@lukewakeford
Copy link
Contributor

I'm looking at using XcodeGen to simplify our CI for a white-label project.

Including existing plists and entitlement files works at the moment but it would be nicer to keep the setup for these in the same place as the rest of the project/target config as yaml/json.

Has this been considered before, if not why? and is there a better way to do this that I've not found yet?

Cheers.

@yonaskolb
Copy link
Owner

Hi @lukewakeford. I'm not totally clear on what you mean. Could you explain your use-case a bit more?
From what I understand a possible solution would be a project init command. That would be what issue #18 is about. If there is support for this it could be looked at. If you'd like to work on something like that, even better 😄
#273 also touches on this.

Also, I haven't work on it in a while but I was in the process of creating a generated starter xcodegen project to https://github.com/yonaskolb/Genesis as a customisable template

@lukewakeford
Copy link
Contributor Author

lukewakeford commented Sep 21, 2018

Hey @yonaskolb 👋

It looks like I could benefit from some of the other suggestions.
#18 - Generating a basic Xcode project would require a basic Info.plist and .entitlements files?
#273 - Generating new project specs based on a template would definitely benefit our white label setup.

Our white-label app has this structure:

  • Main App
    • Today Extension
    • Watch App

I've managed to re-produce our Xcode project using XcodeGen with a spec for each target which are kept generic. Each instance of our white-label app can then include these and override the configuration, provisioning, entitlements and plists as below:

include: 
  - ../app.yml
  - ../today.yml
  - ../watch.yml
name: Demo
settings:
  base:
    PRODUCT_BUNDLE_IDENTIFIER: xxxx
    GROUP_IDENTIFIER: xxxx
targets:
  App:
    sources:
      - path: Config
    settings:
      base:
        PRODUCT_BUNDLE_IDENTIFIER: com.xxxx
        INFOPLIST_FILE: Config/Production.plist
        CODE_SIGN_ENTITLEMENTS: Config/Production.entitlements
      configs:
        debug:
          PROVISIONING_PROFILE_SPECIFIER: match Development com.xxxx
        beta:
          PROVISIONING_PROFILE_SPECIFIER: match InHouse com.xxxx
        release:
          PROVISIONING_PROFILE_SPECIFIER: match AppStore com.xxxx
    dependencies:
      - target: Today
      - target: Watch

.. repeated for Today, Watch targets...

The entitlements and plist files already exist since Xcode made them for me and each white-label instance has these, but it would be nice to delete them and keep all this configuration in one spec file.

The .plist files are mostly identical across each white-label instance so I'd like to be able to include a template .plist file and then override/add just the values that change. the entitlements files are not massive (yet) but the same applies - maybe something like this:

targets: 
  App: 
    plist: 
      path: info.plist
      attributes: 
        - CFBundleName: MyAppName
        - UIStatusBarStyle: UIStatusBarStyleDefault
        - UIBackgroundModes: 
            - fetch
    entitlements: 
      path: app.entitlements
      attributes: 
        - com.apple.security.application-groups: group.xxxx.xxxx

If a path is not provided then generating an xml file with the given attributes would be sweet 👍

Thats where I'm at anyway. Let me know if you think this could be helpful for others or if mine is quite a specific use case.

@yonaskolb
Copy link
Owner

I think something like info and entitlements could be useful and wouldn't be that hard to add.

Another level would be that if you specified an info it could even create some default values based on the type and platform, but that would be harder and require more maintenance going forward

@yonaskolb
Copy link
Owner

@lukewakeford Added in #415! Let me know what you think. This will be useful in combination with targetTemplates, as you can define an iOS_app template and put all the common attributes in there

@lukewakeford
Copy link
Contributor Author

This looks excellent. Thanks so much! i'll be using this asap.

@yonaskolb
Copy link
Owner

Released in 2.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants