Skip to content

Add xcconfig templates and ConfigKey protocol#58

Draft
ssestak wants to merge 3 commits intomainfrom
feature/xcconfig-template
Draft

Add xcconfig templates and ConfigKey protocol#58
ssestak wants to merge 3 commits intomainfrom
feature/xcconfig-template

Conversation

@ssestak
Copy link
Copy Markdown
Contributor

@ssestak ssestak commented Mar 24, 2026

Summary

Adds xcconfig-based configuration management to the SwiftUI App template with per-environment config files (Debug, Beta, Release, Local) and a new ConfigKey protocol in FuturedHelpers for type-safe Info.plist value retrieval with automatic Base64 decoding.

Changes

  • ConfigKey protocol with default implementation that reads from Bundle.main Info.plist and auto-decodes Base64 values
  • ConfigKeyError with descriptive error messages guiding developers to check xcconfig/Info.plist wiring
  • Debug config includes Local.xcconfig via #include? for git-ignored local secrets
  • Beta and Release configs are empty by design — values injected via CI
  • TemplateInfo.plist updated to wire all xcconfig files into the Xcode project template under a Configuration group

Diagram

View diagram
flowchart TD
    subgraph xcconfig["xcconfig files"]
        Local["Local.xcconfig\n(git-ignored secrets)"]
        Debug["Debug.xcconfig\n(dev settings)"]
        Beta["Beta.xcconfig\n(CI injected)"]
        Release["Release.xcconfig\n(CI injected)"]
    end

    Local -->|"#include?"| Debug
    Debug --> Build["Build Settings"]
    Beta --> Build
    Release --> Build
    Build --> Plist["Info.plist\n$(KEY_NAME)"]
    Plist --> ConfigKey["ConfigKey protocol\n(auto Base64 decode)"]
    ConfigKey --> App["App code\ntry AppConfigKey.apiKey.value"]
Loading

Notes

  • Local.xcconfig should be added to .gitignore in consumer projects to keep secrets out of version control

Šimon Šesták and others added 3 commits March 24, 2026 13:41
Add Debug, Beta, Release, and Local xcconfig files in a Configuration
group. Debug includes Local via optional #include. Each config has
placeholder keys for API_KEY, API_BASE_URL, and OTHER_SWIFT_FLAGS.
Xcconfigs are wired to build configurations via baseConfigurationReferenceRelativePath.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add reusable ConfigKey protocol to FuturedHelpers for type-safe
access to Info.plist values from xcconfig with Base64 decoding support.
Add instructional comments to all xcconfig files explaining how to
wire keys to Info.plist and access them using ConfigKey.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove placeholder TODOs from Beta and Release configs,
replacing them with notes about CI-injected values. Update
Debug config with Local.xcconfig guidance for API keys.
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 this pull request may close these issues.

1 participant