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

Support xcconfig #59

Closed
toshi0383 opened this issue Sep 21, 2017 · 4 comments · Fixed by #64
Closed

Support xcconfig #59

toshi0383 opened this issue Sep 21, 2017 · 4 comments · Fixed by #64

Comments

@toshi0383
Copy link
Collaborator

Motivation

Auto apply xcconfig configurations like this.
xcode-configuration

Current Problems

I notice documentations do mention about xcconfig but looks like it's not working as expected.

  • Setting configFiles does not affect anything. (Bug? or maybe my spec is wrong)
  • There is no way to set base xcconfigs for PBXProject.
  • xcconfigs not being added to project

Proposal

So this is my proposal.

  • Support baseConfiguration for PBXProj
  • Rename target's configFiles with baseConfigurations for consistency.
  • (Optional) Rename configs to configurations since it looks like xcconfig and is misleading.
name: MyProject
configurations:
  Debug:
    baseConfiguration: configs/Debug.xcconfig
  OTA:
    baseConfiguration: configs/OTA.xcconfig
  Release:
    baseConfiguration: configs/Release.xcconfig
targets:
  MyApp:
    type: application
    platform: iOS
    sources: Sources/MyApp
    settings:
      PRODUCT_BUNDLE_IDENTIFIER: jp.toshi0383.hello
    baseConfigurations:
      Debug: configs/MyApp-Debug.xcconfig
      OTA: configs/MyApp-OTA.xcconfig
      Release: configs/MyApp-Release.xcconfig

If you guys feel happy with this outline, I can start working on a PR. 💪

@yonaskolb
Copy link
Owner

Hi @toshi0383, thanks for the suggestions!

Yeah, you're right there's no way to specify a project's xcconfig file. Setting configFiles on a target should be working though. Is it not?

In terms of adding them to the project, I'd like to keep defining configurations and applying xcconfig files in seperate dictionaries. While it's not hugely documented at the moment the include feature is highly used by myself and others, and seperating them makes the feature work better. Also it's nice to keep consistency between a project and a target in how things are defined.

About the renaming, I agree maybe configs to configurations would be better. I'd like to keep configFiles though, but would be open to configurationFiles. In either case, both the project and target properties should match.
Obviously both of these are breaking changes, so would need a major version bump, or still read the old values.

Feel free to get a PR up and going! 👍

@toshi0383
Copy link
Collaborator Author

toshi0383 commented Sep 21, 2017

Yeah, you're right there's no way to specify a project's xcconfig file. Setting configFiles on a target should be working though. Is it not?

Yeah maybe my spec is wrong. Would you mind sharing a working example spec for me?

In terms of adding them to the project, I'd like to keep defining configurations and applying xcconfig files in seperate dictionaries.

Could you share outline spec? I don't see the whole picture yet, since I haven't used include feature.
It's XcodeGen specific feature, right?

I agree maybe configs to configurations would be better.

Alright. I will fix this maybe in different PR.

I'd like to keep configFiles though, but would be open to configurationFiles. In either case, both the project and target properties should match.

Great! I will take configurationFiles, because it's better suited to the Cocoa API naming conventions.

Obviously both of these are breaking changes, so would need a major version bump, or still read the old values.

Sure, I am going to at first deprecate it and add warning message when people use the old values.
[warning] configFile is deprecated. Use configurationFiles instead.

@toshi0383
Copy link
Collaborator Author

Could you share outline spec? I don't see the whole picture yet, since I haven't used include feature.

So this is what I came up with. What do you think?

name: MyProject
configurations:
  Debug: debug
  OTA: release
  Release: release
configurationFiles:
  Debug: configs/MyApp-Debug.xcconfig
  OTA: configs/MyApp-OTA.xcconfig
  Release: configs/MyApp-Release.xcconfig
targets:
  MyApp:
    type: application
    platform: iOS
    sources: Sources/MyApp
    settings:
      PRODUCT_BUNDLE_IDENTIFIER: jp.toshi0383.hello
    configurationFiles:
      Debug: configs/MyApp-Debug.xcconfig
      OTA: configs/MyApp-OTA.xcconfig
      Release: configs/MyApp-Release.xcconfig

@yonaskolb yonaskolb mentioned this issue Sep 23, 2017
5 tasks
@toshi0383
Copy link
Collaborator Author

🚀

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

Successfully merging a pull request may close this issue.

2 participants